Commit d0127539 authored by Alan Cox's avatar Alan Cox Committed by David S. Miller

[TTY]: Use tty_mode_ioctl() in network drivers.

We conciously make a change here - we permit mode and speed setting to
be done in things like SLIP mode. There isn't actually a technical
reason to disallow this. It's usually a silly thing to do but we can
do it and soemone might wish to do so.
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0fc00e24
...@@ -774,14 +774,8 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file, ...@@ -774,14 +774,8 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
break; break;
} }
/* Allow stty to read, but not set, the serial port */
case TCGETS:
case TCGETA:
err = n_tty_ioctl(tty, (struct file *) file, cmd, arg);
break;
default: default:
err = -ENOIOCTLCMD; err = tty_mode_ioctl(tty, file, cmd, arg);
} }
sp_put(sp); sp_put(sp);
......
...@@ -434,11 +434,6 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c ...@@ -434,11 +434,6 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
IRDA_ASSERT(dev != NULL, return -1;); IRDA_ASSERT(dev != NULL, return -1;);
switch (cmd) { switch (cmd) {
case TCGETS:
case TCGETA:
err = n_tty_ioctl(tty, file, cmd, arg);
break;
case IRTTY_IOCTDONGLE: case IRTTY_IOCTDONGLE:
/* this call blocks for completion */ /* this call blocks for completion */
err = sirdev_set_dongle(dev, (IRDA_DONGLE) arg); err = sirdev_set_dongle(dev, (IRDA_DONGLE) arg);
...@@ -454,7 +449,7 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c ...@@ -454,7 +449,7 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
err = -EFAULT; err = -EFAULT;
break; break;
default: default:
err = -ENOIOCTLCMD; err = tty_mode_ioctl(tty, file, cmd, arg);
break; break;
} }
return err; return err;
......
...@@ -309,16 +309,11 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -309,16 +309,11 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
err = 0; err = 0;
break; break;
case TCGETS:
case TCGETA:
err = n_tty_ioctl(tty, file, cmd, arg);
break;
case TCFLSH: case TCFLSH:
/* flush our buffers and the serial port's buffer */ /* flush our buffers and the serial port's buffer */
if (arg == TCIOFLUSH || arg == TCOFLUSH) if (arg == TCIOFLUSH || arg == TCOFLUSH)
ppp_async_flush_output(ap); ppp_async_flush_output(ap);
err = n_tty_ioctl(tty, file, cmd, arg); err = tty_perform_flush(tty, arg);
break; break;
case FIONREAD: case FIONREAD:
...@@ -329,7 +324,8 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -329,7 +324,8 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
break; break;
default: default:
err = -ENOIOCTLCMD; /* Try the various mode ioctls */
err = tty_mode_ioctl(tty, file, cmd, arg);
} }
ap_put(ap); ap_put(ap);
......
...@@ -349,16 +349,11 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -349,16 +349,11 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
err = 0; err = 0;
break; break;
case TCGETS:
case TCGETA:
err = n_tty_ioctl(tty, file, cmd, arg);
break;
case TCFLSH: case TCFLSH:
/* flush our buffers and the serial port's buffer */ /* flush our buffers and the serial port's buffer */
if (arg == TCIOFLUSH || arg == TCOFLUSH) if (arg == TCIOFLUSH || arg == TCOFLUSH)
ppp_sync_flush_output(ap); ppp_sync_flush_output(ap);
err = n_tty_ioctl(tty, file, cmd, arg); err = tty_perform_flush(tty, arg);
break; break;
case FIONREAD: case FIONREAD:
...@@ -369,7 +364,8 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -369,7 +364,8 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
break; break;
default: default:
err = -ENOIOCTLCMD; err = tty_mode_ioctl(tty, file, cmd, arg);
break;
} }
sp_put(ap); sp_put(ap);
......
...@@ -1218,14 +1218,8 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm ...@@ -1218,14 +1218,8 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
return 0; return 0;
/* VSV changes end */ /* VSV changes end */
#endif #endif
/* Allow stty to read, but not set, the serial port */
case TCGETS:
case TCGETA:
return n_tty_ioctl(tty, file, cmd, arg);
default: default:
return -ENOIOCTLCMD; return tty_mode_ioctl(tty, file, cmd, arg);
} }
} }
......
...@@ -719,12 +719,8 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file, ...@@ -719,12 +719,8 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
return 0; return 0;
case SIOCSIFHWADDR: case SIOCSIFHWADDR:
return -EINVAL; return -EINVAL;
/* Allow stty to read, but not set, the serial port */
case TCGETS:
case TCGETA:
return n_tty_ioctl(tty, file, cmd, arg);
default: default:
return -ENOIOCTLCMD; return tty_mode_ioctl(tty, file, cmd, arg);
} }
} }
......
...@@ -2735,16 +2735,8 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file, ...@@ -2735,16 +2735,8 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file,
return -EFAULT; return -EFAULT;
return set_mac_address(strip_info, &addr); return set_mac_address(strip_info, &addr);
} }
/*
* Allow stty to read, but not set, the serial port
*/
case TCGETS:
case TCGETA:
return n_tty_ioctl(tty, file, cmd, arg);
break;
default: default:
return -ENOIOCTLCMD; return tty_mode_ioctl(tty, file, cmd, arg);
break; break;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment