aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ssu100.c
Commit message (Collapse)AuthorAgeFilesLines
* USB: ssu100: fix overrun-error reportingJohan Hovold2014-12-141-7/+4
| | | | | | | | | | | | | | commit 75bcbf29c284dd0154c3e895a0bd1ef0e796160e upstream. Fix reporting of overrun errors, which should only be reported once using the inserted null character. Fixes: 6b8f1ca5581b ("USB: ssu100: set tty_flags in ssu100_process_packet") Signed-off-by: Johan Hovold <johan@kernel.org> [bwh: Backported to 3.2: - Use tty_port_tty_get() to look up tty_struct - Adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* USB: ssu100: fix use-after-free in TIOCMIWAITJohan Hovold2013-04-251-5/+7
| | | | | | | | | | | | | | | commit 43a66b4c417ad15f6d2f632ce67ad195bdf999e8 upstream. Use the port wait queue and make sure to check the serial disconnected flag before accessing private port data after waking up. This is is needed as the private port data (including the wait queue itself) can be gone when waking up after a disconnect. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* USB: serial: fix null-pointer dereferences on disconnectJohan Hovold2013-03-061-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | commit b2ca699076573c94fee9a73cb0d8645383b602a0 upstream. Make sure serial-driver dtr_rts is called with disc_mutex held after checking the disconnected flag. Due to a bug in the tty layer, dtr_rts may get called after a device has been disconnected and the tty-device unregistered. Some drivers have had individual checks for disconnect to make sure the disconnected interface was not accessed, but this should really be handled in usb-serial core (at least until the long-standing tty-bug has been fixed). Note that the problem has been made more acute with commit 0998d0631001 ("device-core: Ensure drvdata = NULL when no driver is bound") as the port data is now also NULL when dtr_rts is called resulting in further oopses. Reported-by: Chris Ruehl <chris.ruehl@gtsys.com.hk> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [bwh: Backported to 3.2: - Adjust context - Drop changes to quatech2.c] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* tty: remove filp from the USB tty ioctlsAlan Cox2011-02-171-1/+1
| | | | | | | | We don't use it so we can trim it from here as we try and stamp the file object dependencies out of the serial code. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tiocmset: kill the file pointer argumentAlan Cox2011-02-171-1/+1
| | | | | | | | Doing tiocmget was such fun we should do tiocmset as well for the same reasons Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tiocmget: kill off the passing of the struct fileAlan Cox2011-02-171-1/+1
| | | | | | | | | | We don't actually need this and it causes problems for internal use of this functionality. Currently there is a single use of the FILE * pointer. That is the serial core which uses it to check tty_hung_up_p. However if that is true then IO_ERROR is also already set so the check may be removed. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ssu100: remove max_packet_size calculationBill Pemberton2010-11-111-48/+8
| | | | | | | | The max_packet_size logic is taken from ftdi_sio, but it's not needed for this device. This also makes proces_read_urb simpler. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: Fix warning left over from TIOCGICOUNT changesAlan Cox2010-10-221-2/+0
| | | | | | Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: Convert the USB drivers to the new icount interfaceAlan Cox2010-10-221-21/+25
| | | | | | | | | | Simple pasting job using the new ops function. Also fix a couple of devices directly returning the internal struct (which happens at this point to match for the fields that matter but isn't correct or futureproof) Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ssu100: turn off debug flagBill Pemberton2010-09-031-1/+1
| | | | | | | | Remove the hard coding of the debug flag to 1. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Merge branch 'for-linus' of ↵Linus Torvalds2010-08-281-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: pxa27x_keypad - remove input_free_device() in pxa27x_keypad_remove() Input: mousedev - fix regression of inverting axes Input: uinput - add devname alias to allow module on-demand load Input: hil_kbd - fix compile error USB: drop tty argument from usb_serial_handle_sysrq_char() Input: sysrq - drop tty argument form handle_sysrq() Input: sysrq - drop tty argument from sysrq ops handlers
| * USB: drop tty argument from usb_serial_handle_sysrq_char()Dmitry Torokhov2010-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | Since handle_sysrq() does not take tty as argument anymore we can drop it from usb_serial_handle_sysrq_char() as well. Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Acked-by: Jason Wessel <jason.wessel@windriver.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
* | USB: ssu100: set tty_flags in ssu100_process_packetBill Pemberton2010-08-231-9/+29
| | | | | | | | | | | | | | | | | | flag was never set in ssu100_process_packet. Add logic to set it before calling tty_insert_flip_* Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: ssu100: add disconnect function for ssu100Bill Pemberton2010-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | Add a disconnect function to the functions of this device. The disconnect is a call to usb_serial_generic_disconnect() so it requires that symbol to be exported from generic.c. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: ssu100: rework logic for TIOCMIWAITBill Pemberton2010-08-231-35/+111
| | | | | | | | | | | | | | | | | | | | Rework the logic for TIOCMIWAIT to use wait_event_interruptible. This also adds support for TIOCGICOUNT. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: ssu100: add register parameter to ssu100_setregisterBill Pemberton2010-08-231-3/+4
| | | | | | | | | | | | | | | | | | | | The function ssu100_setregister was hard coded to only set the MCR register. Add a register parameter so that other registers can be set. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: ssu100: remove duplicate #defines in ssu100Bill Pemberton2010-08-231-55/+31
| | | | | | | | | | | | | | | | | | | | The ssu100 uses a TI16C550C UART so the SERIAL_ defines in this code are duplicates of those found in serial_reg.h. Remove the defines in ssu100.c and use the ones in the header file. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: ssu100: refine process_packet in ssu100Bill Pemberton2010-08-231-6/+2
| | | | | | | | | | | | | | | | | | | | The status information does not appear at the start of each incoming packet so the check for len < 4 at the start of ssu100_process_packet is wrong. Remove it. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | USB: ssu100: add locking for port private data in ssu100Bill Pemberton2010-08-231-1/+8
|/ | | | | | Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: add USB serial ssu100 driverBill Pemberton2010-08-101-0/+698
Add support for the Quatech SSU-100 single port usb to serial device. This driver is based on the ftdi_sio.c driver and the original serqt_usb driver from Quatech. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>