aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/oti6858.c
Commit message (Collapse)AuthorAgeFilesLines
* USB: oti6858: fix use-after-free in TIOCMIWAITJohan Hovold2013-04-251-4/+6
| | | | | | | | | | | | | | | commit 8edfdab37157d2683e51b8be5d3d5697f66a9f7b 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, indentation] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* tty: remove filp from the USB tty ioctlsAlan Cox2011-02-171-2/+2
| | | | | | | | 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-2/+2
| | | | | | | | 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-2/+2
| | | | | | | | | | 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 serial: add missing .usb_driver field in serial driversAlan Stern2011-01-221-0/+1
| | | | | | | | | | | | | | | | This patch (as1443) fixes a bug found in many of the USB serial drivers: They don't set the .usb_driver field in their usb_serial_driver structure. This field is needed for assigning dynamic IDs for device matching. In addition, starting with the 2.6.37 kernel, the .usb_driver field is needed for proper autosuspend operation. Without it, attempts to open the device file will fail. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Dan Williams <dcbw@redhat.com> CC: <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: don't use flush_scheduled_work()Tejun Heo2010-12-241-3/+2
| | | | | | | | | | | | | | | | | | | flush_scheduled_work() is being deprecated. Directly flush or cancel work items instead. * u_ether, isp1301_omap, speedtch conversions are straight-forward. * ochi-hcd should only flush when quirk_nec() is true as otherwise the work wouldn't have been initialized. * In oti6858, cancel_delayed_work() + flush_scheduled_work() -> cancel_delayed_work_sync(). Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Duncan Sands <duncan.sands@free.fr> Cc: linux-usb@vger.kernel.org
* USB: oti6858: use port write fifoJohan Hovold2010-05-201-37/+25
| | | | | | | | | | | Kill private write fifo and use port fifo instead (protected under port lock). Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: oti6858: use kfifo to implement write bufferingJohan Hovold2010-05-201-201/+17
| | | | | | | | | | | | Kill custom fifo implementation. Use private write fifo to minimise changes to lock handling. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: oti6858: declare send_data() as staticBill Pemberton2010-05-201-1/+1
| | | | | | Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: remove references to port->port.count from the serial driversAlan Stern2010-03-021-15/+6
| | | | | | | | | | | | This patch (as1344) removes references to port->port.count from the USB serial drivers. Now that serial ports are properly reference counted, port.count checking is unnecessary and incorrect. Drivers should assume that the port is in use from the time the open method runs until the close method is called. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB serial: make USB device id constantNémeth Márton2010-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The id_table field of the struct usb_device_id is constant in <linux/usb.h> so it is worth to make the initialization data also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Németh Márton <nm127@freemail.hu> Cc: Julia Lawall <julia@diku.dk> Cc: cocci@diku.dk Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: oti6858: fix DMA buffer on stackJohan Hovold2010-03-021-3/+10
| | | | | | Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: no unnecessary GFP_ATOMIC in oti6858Oliver Neukum2009-10-091-3/+3
| | | | | | | | GFP_ATOMIC without good cause is evil. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: USB serial termios bitsAlan Cox2009-09-191-11/+10
| | | | | | | | | Various drivers have hacks to mangle termios structures. This stems from the fact there is no nice setup hook for configuring the termios settings when the port is created Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: USB does not need the filp argument in the driversAlan Cox2009-09-191-4/+2
| | | | | | | | And indeed none of them use it. Clean this up as it will make moving to a standard open method rather easier. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usb-serial: replace shutdown with disconnect, releaseAlan Stern2009-06-151-4/+3
| | | | | | | | | | | | | | | | This patch (as1254) splits up the shutdown method of usb_serial_driver into a disconnect and a release method. The problem is that the usb-serial core was calling shutdown during disconnect handling, but drivers didn't expect it to be called until after all the open file references had been closed. The result was an oops when the close method tried to use memory that had been deallocated by shutdown. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: Bring the usb tty port structure into more useAlan Cox2009-06-111-52/+5
| | | | | | | | | | This allows us to clean stuff up, but is probably also going to cause some app breakage with buggy apps as we now implement proper POSIX behaviour for USB ports matching all the other ports. This does also mean other apps that break on USB will now work properly. Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* tty: usb-serial krefsAlan Cox2008-10-131-1/+2
| | | | | | | | | | | | | Use kref in the USB serial drivers so that we don't free tty structures from under the URB receive handlers as has historically been the case if you were unlucky. This also gives us a framework for general tty drivers to use tty_port objects and refcount. Contains two err->dev_err changes merged together to fix clashes in the -next tree. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Fix oti6858 debug levelScott Ashcroft2008-10-131-4/+0
| | | | | | | | | | | | | For some reason the oti6858 driver undefines and redefines the dbg macro. This makes it spew debugging messages at KERN_INFO instead of KERN_DEBUG. This patch removes the undef and define making the driver log like every other USB serial driver. Signed-off-by: Scott Ashcroft <scott.ashcroft@talk21.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* tty-usb-oti6858: Coding styleAlan Cox2008-07-221-66/+70
| | | | | | Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* usb_serial: API all changeAlan Cox2008-07-221-71/+48
| | | | | | | | | | | | | | | | | | | USB serial likes to use port->tty back pointers for the real work it does and to do so without any actual locking. Unfortunately when you consider hangup events, hangup/parallel reopen or even worse hangup followed by parallel close events the tty->port and port->tty pointers are not guaranteed to be the same as port->tty is the active tty while tty->port is the port the tty may or may not still be attached to. So rework the entire API to pass the tty struct. For console cases we need to pass both for now. This shows up multiple drivers that immediately crash with USB console some of which have been fixed in the process. Longer term we need a proper tty as console abstraction Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drivers/usb annotations and fixesAl Viro2008-04-281-6/+7
| | | | | | | | | | | | * endianness annotations * endianness fixes * missing get_unaligned/put_unaligned It's pretty much all over the place, changes to different files are independent. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Serial-parts-Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* USB: remove unnecessary type casting of urb->contextMing Lei2008-04-241-3/+3
| | | | | | | | urb->context code cleanup Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-241-54/+54
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: remove unneeded number endpoints settingsGreg Kroah-Hartman2008-04-241-3/+0
| | | | | | | | | The usb-serial core no longer checks these fields so remove them from all of the individual drivers. They will be removed from the usb-serial core in a patch later in the series. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: oti6858: fix TCFLSH ioctl handlingPaulius Zaleckas2008-04-241-4/+0
| | | | | | | | | | | Removes unimplemented TCFLSH handling from oti6858, because it was preventing TCFLSH handling by upper layer (line discipline) drivers (see drivers/char/tty_io.c line 3450). Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: last abuses of intfdata in close for usb-serial driversOliver Neukum2008-02-011-1/+1
| | | | | | | | | | these drivers abused intfdata in close() as flags for binding. That races with reprobing of those devices. This patch fixes that by using the flag and the locks introduced with the patch against mos7720. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: oti6858: cleanupAlan Cox2008-02-011-83/+46
| | | | | | | | | | | | - Rename the copied buffer functions from pl2303 to oti6858 to avodi confusion - Initialise speeds properly - Use modern baud rate handling - Remove GSERIAL/SSERIAL ioctl hacks that reference termios unlocked Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Add missing newlines to some uses of dev_<level> messagesJoe Perches2007-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found these while looking at printk uses. Add missing newlines to dev_<level> uses Add missing KERN_<level> prefixes to multiline dev_<level>s Fixed a wierd->weird spelling typo Added a newline to a printk Signed-off-by: Joe Perches <joe@perches.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Roland Dreier <rolandd@cisco.com> Cc: Tilman Schmidt <tilman@imap.cc> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Greg KH <greg@kroah.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: James Smart <James.Smart@Emulex.Com> Cc: Andrew Vasquez <andrew.vasquez@qlogic.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* usb: avoid redundant cast of kmalloc() return value in OTi-6858 driverJesper Juhl2007-10-121-1/+1
| | | | | | | | | | In drivers/usb/serial/oti6858.c::pl2303_buf_alloc() the return value of kmalloc() is being cast to "struct pl2303_buf *", but that need not be done here since kmalloc() returns "void *". Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: oti6858: Remove broken ioctl code in -mm tree and also the broken fixesAlan Cox2007-09-111-15/+0
| | | | | | | | | This stuff is simply not needed. Signed-off-by: Alan Cox <alan@redhat.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb-serial: fix oti6858.c segfault in termios handlingThomas Viehmann2007-08-221-6/+4
| | | | | | | | | | | | The oti6858 usb serial driver should use kernel_termios_to_user_termios/ user_termios_to_kernel_termios to avoid segfaults because the kernel uses a structure differing from that of user space with a different size. Signed-off-by: Thomas Viehmann <tv@beamnet.de> CC: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: oti6858: clean up urb->status usageGreg Kroah-Hartman2007-07-121-17/+18
| | | | | | | | | | This done in anticipation of removal of urb->status, which will make that patch easier to review and apply in the future. Cc: <linux-usb-devel@lists.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: oti6858 usb-serial driver (in Nokia CA-42 cable)Kees Lemmens2007-07-121-0/+1341
Last week I've been searching for a driver for the CA-42 cable (see usb below) that fitted my kernel 2.6.20. I only found an abandoned version for a driver on your website that indeed worked on 2.6.18 but wouldn't even compile with a more recent 2.6.20 kernel. I fiddled 2 evenings with the kernel code and have patched it up now to work with the modifications in the 2.6.20 kernel. The patch is attached hereafter and it works fine (at least for me :-) ). Bus 2 Device 13: ID 0ea0:6858 Ours Technology, Inc. I had to fiddle a little with the settings in .gnokiirc but that also occurred with the older 2.6.18 kernel. Nevertheless, on one system with this cable and my Nokia 6070 I had best results with : model = 6510 connection = dku5 while on an other system with the same kernel, cable and phone it only worked with : model = AT connection = serial serial_write_usleep = 1 From: Kees Lemmens <C.W.J.Lemmens@ewi.tudelft.nl> Cc: <pawel.kot@gmail.com> Cc: <bozo@andrews.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>