summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/ucom.c
diff options
context:
space:
mode:
authorakiyama <akiyama@FreeBSD.org>2003-11-16 11:58:21 +0000
committerakiyama <akiyama@FreeBSD.org>2003-11-16 11:58:21 +0000
commit1b190ee005252ca7adcc402d7cf805dcf04d4e1b (patch)
tree0279cf80a9e9bc346a873953d7238ca2ee308064 /sys/dev/usb/ucom.c
parent4569dd2ada3355c13470740172ec5e5d34735eac (diff)
downloadFreeBSD-src-1b190ee005252ca7adcc402d7cf805dcf04d4e1b.zip
FreeBSD-src-1b190ee005252ca7adcc402d7cf805dcf04d4e1b.tar.gz
Add missing ioctl functions.
MFC after: 1 week
Diffstat (limited to 'sys/dev/usb/ucom.c')
-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