Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+10 −16
Original line number Diff line number Diff line
@@ -774,14 +774,8 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file,
			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:
		err = -ENOIOCTLCMD;
		err = tty_mode_ioctl(tty, file, cmd, arg);
	}

	sp_put(sp);
+1 −6
Original line number Diff line number Diff line
@@ -434,11 +434,6 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c
	IRDA_ASSERT(dev != NULL, return -1;);

	switch (cmd) {
	case TCGETS:
	case TCGETA:
		err = n_tty_ioctl(tty, file, cmd, arg);
		break;

	case IRTTY_IOCTDONGLE:
		/* this call blocks for completion */
		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
			err = -EFAULT;
		break;
	default:
		err = -ENOIOCTLCMD;
		err = tty_mode_ioctl(tty, file, cmd, arg);
		break;
	}
	return err;
+3 −7
Original line number Diff line number Diff line
@@ -309,16 +309,11 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
		err = 0;
		break;

	case TCGETS:
	case TCGETA:
		err = n_tty_ioctl(tty, file, cmd, arg);
		break;

	case TCFLSH:
		/* flush our buffers and the serial port's buffer */
		if (arg == TCIOFLUSH || arg == TCOFLUSH)
			ppp_async_flush_output(ap);
		err = n_tty_ioctl(tty, file, cmd, arg);
		err = tty_perform_flush(tty, arg);
		break;

	case FIONREAD:
@@ -329,7 +324,8 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file,
		break;

	default:
		err = -ENOIOCTLCMD;
		/* Try the various mode ioctls */
		err = tty_mode_ioctl(tty, file, cmd, arg);
	}

	ap_put(ap);
+3 −7
Original line number Diff line number Diff line
@@ -349,16 +349,11 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
		err = 0;
		break;

	case TCGETS:
	case TCGETA:
		err = n_tty_ioctl(tty, file, cmd, arg);
		break;

	case TCFLSH:
		/* flush our buffers and the serial port's buffer */
		if (arg == TCIOFLUSH || arg == TCOFLUSH)
			ppp_sync_flush_output(ap);
		err = n_tty_ioctl(tty, file, cmd, arg);
		err = tty_perform_flush(tty, arg);
		break;

	case FIONREAD:
@@ -369,7 +364,8 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file,
		break;

	default:
		err = -ENOIOCTLCMD;
		err = tty_mode_ioctl(tty, file, cmd, arg);
		break;
	}

	sp_put(ap);
+1 −7
Original line number Diff line number Diff line
@@ -1218,14 +1218,8 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm
		return 0;
	/* VSV changes end */
#endif

	/* Allow stty to read, but not set, the serial port */
	case TCGETS:
	case TCGETA:
		return n_tty_ioctl(tty, file, cmd, arg);

	default:
		return -ENOIOCTLCMD;
		return tty_mode_ioctl(tty, file, cmd, arg);
	}
}

Loading