summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* change semantics of ldisc ->compat_ioctl()Al Viro2018-10-1311-100/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | First of all, make it return int. Returning long when native method had never allowed that is ridiculous and inconvenient. More importantly, change the caller; if ldisc ->compat_ioctl() is NULL or returns -ENOIOCTLCMD, tty_compat_ioctl() will try to feed cmd and compat_ptr(arg) to ldisc's native ->ioctl(). That simplifies ->compat_ioctl() instances quite a bit - they only need to deal with ioctls that are neither generic tty ones (those would get shunted off to tty_ioctl()) nor simple compat pointer ones. Note that something like TCFLSH won't reach ->compat_ioctl(), even if ldisc ->ioctl() does handle it - it will be recognized earlier and passed to tty_ioctl() (and ultimately - ldisc ->ioctl()). For many ldiscs it means that NULL ->compat_ioctl() does the right thing. Those where it won't serve (see e.g. n_r3964.c) are also easily dealt with - we need to handle the numeric-argument ioctls (calling the native instance) and, if such would exist, the ioctls that need layout conversion, etc. All in-tree ldiscs dealt with. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* kill TIOCSER[SG]WILDAl Viro2018-10-133-16/+0
| | | | | | | | | the only user is very old setserial rc script and even that (as far back as MCC Interim, AFAICS) doesn't actually fail - just gives one message during the boot ("Cannot scan for wild interrupts") and proceeds past that just fine. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* synclink_gt(): fix compat_ioctl()Al Viro2018-10-131-12/+4
| | | | | | compat_ptr() for pointer-taking ones... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* pty: fix compat ioctlsAl Viro2018-10-131-2/+12
| | | | | | pointer-taking ones need compat_ptr(); int-taking one doesn't. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* compat_ioctl - kill keyboard ioctl handlingAl Viro2018-10-131-29/+0
| | | | | | | all of those are provided only by vt and s390 tty3270; both have proper ->compat_ioctl() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* gigaset: add ->compat_ioctl()Al Viro2018-10-132-5/+11
| | | | | | ... and get rid of COMPAT_IOCTL() for its private ioctls Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* vt_compat_ioctl(): clean up, use compat_ptr() properlyAl Viro2018-10-131-22/+9
| | | | | | we need it for "convert the structure" cases too Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* gigaset: don't try to printk userland buffer contentsAl Viro2018-10-131-1/+1
| | | | | | especially when you've just copied it in... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* dgnc: don't bother with (empty) stub for TCXONCAl Viro2018-10-131-5/+0
| | | | | | | | for pity sake, that case is identical to their default: _and_ bears an explicit comment re leaving to ldisc. Which is what default is doing, obviously... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* dgnc: leave TIOC[GS]SOFTCAR to ldiscAl Viro2018-10-131-24/+0
| | | | | | no point duplicating that in tty_operations ->ioctl() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* remove fallback to drivers for TIOCGICOUNTAl Viro2018-10-131-5/+1
| | | | | | | none of them handles it anyway. Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* dgnc: break-related ioctls won't reach ->ioctl()Al Viro2018-10-131-75/+0
| | | | | | | kill the dead code, especially since ->break_ctl() will do the right thing anyway. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* kill the rest of tty COMPAT_IOCTL() entriesAl Viro2018-10-131-13/+0
| | | | | | | | | TIOCLINUX is handled by ->compat_ioctl() in the only place that has native ->ioctl() recognizing it, TIOC{START,STOP} are simply useless these days - unrecognized compat ioctl won't spew into syslog anymore. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* dgnc: TIOCM... won't reach ->ioctl()Al Viro2018-10-131-114/+0
| | | | | | | | bury the dead code (and ->tiocmget()/->tiocmset() are there, so I really wonder why have they kept the stuff that became unreachable with the introduction of those...) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* isdn_tty: TCSBRK{,P} won't reach ->ioctl()Al Viro2018-10-131-19/+0
| | | | | | | kill the long-dead code - it's been unreachable since 2008. Redundant, as well - generic will do exact same thing, since ->break_ctl is NULL here... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* kill capinc_tty_ioctl()Al Viro2018-10-131-7/+0
| | | | | | NULL ->ioctl() in tty_operations is treated as "returns -ENOIOCTLCMD"... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* take compat TIOC[SG]SERIAL treatment into tty_compat_ioctl()Al Viro2018-10-132-67/+81
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* synclink: reduce pointless checks in ->ioctl()Al Viro2018-10-134-8/+4
| | | | | | | it's never getting called with TIOC[SG]SERIAL anymore (nor has it ever supported those, while we are at it) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* complete ->[sg]et_serial() switchoverAl Viro2018-10-132-12/+6
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* usb_wwan: switch to ->[sg]et_serial()Al Viro2018-10-133-49/+23
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* whiteheat: switch to ->get_serial()Al Viro2018-10-131-27/+15
| | | | | | | | ... and fix the return value - on success it used to have ioctl(2) fill the user-supplied struct serial_struct and return -ENOTTY. Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* ti_usb_3410_5052: switch to ->[sg]et_serial()Al Viro2018-10-131-50/+24
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* ssu100: switch to ->get_serial()Al Viro2018-10-131-31/+11
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* quatech2: switch to ->get_serial()Al Viro2018-10-131-31/+11
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* pl2303: switch to ->get_serial()Al Viro2018-10-131-21/+8
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* opticon: switch to ->get_serial()Al Viro2018-10-131-31/+12
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mos7840: switch to ->get_serial()Al Viro2018-10-131-26/+13
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mos7720: switch to ->get_serial()Al Viro2018-10-131-21/+13
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* io_ti: switch to ->get_serial()Al Viro2018-10-131-33/+14
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* io_edgeport: switch to ->get_serial()Al Viro2018-10-131-21/+16
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* fdti_sio: switch to ->[sg]et_serial()Al Viro2018-10-131-27/+21
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* f81534: switch to ->get_serial()Al Viro2018-10-131-30/+8
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* f81232: switch to ->get_serial()Al Viro2018-10-131-28/+8
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* ark3116: switch to ->get_serial()Al Viro2018-10-131-30/+8
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* cdc-acm: switch to ->[sg]et_serial()Al Viro2018-10-131-27/+14
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* usb-serial: begin switching to ->[sg]et_serial()Al Viro2018-10-132-0/+22
| | | | | | | | | | | | add such methods for usb_serial_driver, provide tty_operations ->[sg]et_serial() calling those. For now the lack of methods in driver means ENOIOCTLCMD from usb-serial ->[sg]et_serial(), making tty_ioctl() fall back to calling ->ioctl(). Once all drivers are converted, we'll be returning -ENOTTY instead, completing the switchover. Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* rfcomm: get rid of mentioning TIOC[SG]SERIALAl Viro2018-10-131-8/+0
| | | | | | no support there Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* serial_core: switch to ->[sg]et_serial()Al Viro2018-10-131-26/+12
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mxser: switch to ->[sg]et_serial()Al Viro2018-10-131-46/+51
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* moxa: switch to ->[sg]et_serial()Al Viro2018-10-131-39/+40
| | | | | | | | | Pointless dead assignments in moxa_set_serial_info() killed off; they would've been a bug, if not for the fact that user-settable flags had never been used in that driver. Bogus from day 1, though... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* isicom: switch to ->[sg]et_serial()Al Viro2018-10-131-47/+25
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* ipwireless: switch to ->[sg]et_serial()Al Viro2018-10-131-18/+18
| | | | | Acked-by: David Sterba <dsterba@suse.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* cyclades: switch to ->[sg]et_serial()Al Viro2018-10-131-40/+37
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* amiserial: switch to ->[sg]et_serial()Al Viro2018-10-131-45/+33
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* greybus/uart: switch to ->[sg]et_serial()Al Viro2018-09-141-29/+18
| | | | | Reviewed-by: Johan Hovold <johan@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* fwserial: switch to ->[sg]et_serial()Al Viro2018-09-141-38/+28
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* simserial: switch to ->[sg]et_serial()Al Viro2018-09-141-4/+13
| | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* tty_ioctl(): start taking TIOC[SG]SERIAL into separate methodsAl Viro2018-09-142-5/+33
| | | | | | | ->set_serial() and ->get_serial() resp., both taking tty and a kernel pointer to serial_struct. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* mos7720: bury dead TIOCM... in ->ioctl()Al Viro2018-09-141-52/+0
| | | | | | | | | These ioctls never reach driver's ->ioctl() - tty_ioctl() handles them on its own. ->tiocm[gs]et() is what actually gets called, and mos7720 provides those, with results equivalent to what the unreachable code would be doing when called. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* tty_ioctl(): drop FIONBIO handlingAl Viro2018-09-141-30/+0
| | | | | | | | That code had been live for 11 weeks back in 1992, but it had been 26 years since sys_ioctl() began handling FIONBIO on its own. Time to to bury the body, already... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>