summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/ucom.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c
index a57d6f8..9c5c40f 100644
--- a/sys/dev/usb/ucom.c
+++ b/sys/dev/usb/ucom.c
@@ -546,6 +546,10 @@ ucomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
int error;
int s;
int d;
+#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
+ u_long oldcmd;
+ struct termios term;
+#endif
USB_GET_SC(ucom, UCOMUNIT(dev), sc);
tp = sc->sc_tty;
@@ -555,15 +559,28 @@ ucomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
DPRINTF(("ucomioctl: cmd = 0x%08lx\n", cmd));
+#if defined(COMPAT_43) || defined(COMPAT_SUNOS)
+ term = tp->t_termios;
+ oldcmd = cmd;
+ error = ttsetcompat(tp, &cmd, data, &term);
+ if (error != 0)
+ return (error);
+ if (cmd != oldcmd)
+ data = (caddr_t)&term;
+#endif
+
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
- if (error >= 0) {
+ if (error != ENOIOCTL) {
DPRINTF(("ucomioctl: l_ioctl: error = %d\n", error));
return (error);
}
+ s = spltty();
+
error = ttioctl(tp, cmd, data, flag);
disc_optim(tp, &tp->t_termios, sc);
- if (error >= 0) {
+ if (error != ENOIOCTL) {
+ splx(s);
DPRINTF(("ucomioctl: ttioctl: error = %d\n", error));
return (error);
}
@@ -580,8 +597,6 @@ ucomioctl(dev_t dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
DPRINTF(("ucomioctl: our cmd = 0x%08lx\n", cmd));
- s = spltty();
-
switch (cmd) {
case TIOCSBRK:
DPRINTF(("ucomioctl: TIOCSBRK\n"));
OpenPOWER on IntegriCloud