summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/mos7840.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next' of ↵Linus Torvalds2010-10-241-7/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits) Update broken web addresses in arch directory. Update broken web addresses in the kernel. Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget Revert "Fix typo: configuation => configuration" partially ida: document IDA_BITMAP_LONGS calculation ext2: fix a typo on comment in ext2/inode.c drivers/scsi: Remove unnecessary casts of private_data drivers/s390: Remove unnecessary casts of private_data net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data drivers/infiniband: Remove unnecessary casts of private_data drivers/gpu/drm: Remove unnecessary casts of private_data kernel/pm_qos_params.c: Remove unnecessary casts of private_data fs/ecryptfs: Remove unnecessary casts of private_data fs/seq_file.c: Remove unnecessary casts of private_data arm: uengine.c: remove C99 comments arm: scoop.c: remove C99 comments Fix typo configue => configure in comments Fix typo: configuation => configuration Fix typo interrest[ing|ed] => interest[ing|ed] Fix various typos of valid in comments ... Fix up trivial conflicts in: drivers/char/ipmi/ipmi_si_intf.c drivers/usb/gadget/rndis.c net/irda/irnet/irnet_ppp.c
| * drivers/usb: Remove unnecessary return's from void functionsJoe Perches2010-08-101-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Greg prefers this to go through the trivial tree. http://lkml.org/lkml/2010/6/24/1 There are about 2500 void functions in drivers/usb Only a few used return; at end of function. Standardize them a bit. Moved a statement down a line in drivers/usb/host/u132-hcd.c Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | tty: Convert the USB drivers to the new icount interfaceAlan Cox2010-10-221-24/+29
| | | | | | | | | | | | | | | | | | | | 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: serial/mos*: prevent reading uninitialized stack memoryDan Rosenberg2010-09-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The TIOCGICOUNT device ioctl in both mos7720.c and mos7840.c allows unprivileged users to read uninitialized stack memory, because the "reserved" member of the serial_icounter_struct struct declared on the stack is not altered or zeroed before being copied back to the user. This patch takes care of it. Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | usb: serial: mos7840: Add USB IDs to support more B&B USB/RS485 converters.Dave Ludlow2010-09-031-13/+22
| | | | | | | | | | | | | | | | | | | | | | Add the USB IDs needed to support the B&B USOPTL4-4P, USO9ML2-2P, and USO9ML2-4P. This patch expands and corrects a typo in the patch sent on 08-31-2010. Signed-off-by: Dave Ludlow <dave.ludlow@bay.ws> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* | usb: serial: mos7840: Add USB ID to support the B&B Electronics USOPTL4-2P.Dave Ludlow2010-09-031-0/+3
|/ | | | | | | | | | Add the USB ID needed to support B&B Electronic's 2-port, optically-isolated, powered, USB to RS485 converter. Signed-off-by: Dave Ludlow <dave.ludlow@bay.ws> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mos7840: fix null-pointer dereferenceJohan Hovold2010-06-041-1/+0
| | | | | | | | | Fix null-pointer dereference on error path. Cc: stable <stable@kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mos7840: Cleanup useless headerAlessio Igor Bogani2010-05-201-1/+0
| | | | | | | | BKL isn't anymore present into this file thus it is no necessary still include smp_lock.h. Signed-off-by: Alessio Igor Bogani <abogani@texware.it> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: tty: Prune uses of tty_request_room in the USB layerAlan Cox2010-03-021-1/+0
| | | | | | | | | | | We have lots of callers that do not need to do this in the first place. Remove the calls as they both cost CPU and for big buffers can mess up the multi-page allocation avoidance. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB serial: make USB device id constantNémeth Márton2010-03-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: mos7840: fix DMA buffers on stack and endianess bugsJohan Hovold2010-03-021-4/+18
| | | | | | Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: Extra device/vendor ID for mos7840 driverBlaise Gassend2009-12-231-2/+5
| | | | | | | Signed-off-by: Blaise Gassend <blaise.gasend_linux@m4x.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mos7840: add device IDs for B&B electronics devicesCliff Brake2009-12-111-3/+21
| | | | | | | Reviewed-by: John Pilles <jpilles@bb-elec.com> Signed-off-by: Cliff Brake <cbrake@bec-systems.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: USB does not need the filp argument in the driversAlan Cox2009-09-191-2/+1
| | | | | | | | 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>
* mos7840: remove old dead modem logicAlan Cox2009-09-191-115/+0
| | | | | | | | The modem ioctls are not routed via the ioctl method so kill the old dead code. The correct code is also already present and hooked in. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: aten uc2324 is really a moschip 7840Russell Lang2009-07-281-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've opened up the case, and the chips in the ATEN UC2324 are: Moschip MCS7840CV-AA 69507-6B1 0650 (USB to 4-port serial) (logo with AF kerned together) 0748 24BC02 SINGLP (unknown 8-pin chip) (logo looks like 3 or Z in circle) ZT3243LEEA 0752 B7A16420.T (4 chips, so this will be RS232 line driver) (Probably equivalent of Sipex SP3243) So the ATEN 2324 (aten2011.c driver), is definitely the Moschip 7840, and should use the mos7840.c driver. I expect you will remove the aten2011.c driver from the staging area. From the aten2011.c source code, the device ID for the UC2322 (2 port serial) is 0x7820, just like the Moschip evaluation board. This value should be added to the device id table of mos7840.c. Here's a patch that adds these devices to the driver. From: Russell Lang <gsview@ghostgum.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* headers: smp_lock.h reduxAlexey Dobriyan2009-07-121-0/+1
| | | | | | | | | | | | | * Remove smp_lock.h from files which don't need it (including some headers!) * Add smp_lock.h to files which do need it * Make smp_lock.h include conditional in hardirq.h It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT This will make hardirq.h inclusion cheaper for every PREEMPT=n config (which includes allmodconfig/allyesconfig, BTW) Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* USB: usb-serial: replace shutdown with disconnect, releaseAlan Stern2009-06-151-5/+37
| | | | | | | | | | | | | | | | 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>
* USB: mos7840: fix debug log messagesTony Cook2009-06-151-156/+162
| | | | | | | | | | This patch removes all the unnecessary "\n"s that the debug print statements have, which result in everything appearing double spaced and unreadable in the logs. Signed-off-by: Tony Cook <tony-cook@bigpond.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: Bring the usb tty port structure into more useAlan Cox2009-06-111-47/+1
| | | | | | | | | | 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>
* USB: removal of tty->low_latency hack dating back to the old serial codeOliver Neukum2009-04-231-6/+0
| | | | | | | | | | | | This removes tty->low_latency from all USB serial drivers that push data into the tty layer at hard interrupt context. It's no longer needed and actually harmful. Signed-off-by: Oliver Neukum <oliver@neukum.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: fix mos7840 problem with minor numbersTony Cook2009-04-231-11/+19
| | | | | | | | | | | This patch fixes a problem with any mos7840 device where the use of the field "minor" before it is initialised results in all the devices being overlaid in memory (minor = 0 for all instances) Contributed by: Phillip Branch Signed-off-by: Tony Cook <tony-cook@bigpond.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mos7840: add new device idTony Cook2009-04-231-0/+7
| | | | | | | | | | | | add USB ids for the mos7840 based ATEN International serial devices. Contributed by: Phillip Branch Signed-off-by: Tony Cook <tony-cook@bigpond.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: fix up urb->status usageGreg Kroah-Hartman2009-01-071-13/+25
| | | | | | | | Some of the usb-serial drivers are starting to use urb->status in ways they should not be doing. This fixes up some of them to prevent that. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: Drop the lock_kernel in the private ioctl hookAlan Cox2009-01-021-0/+3
| | | | | | | | We don't need the BKL here any more so it can go. In a couple of spots the driver requirements are not clear so push the lock down into the driver. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* USB: remove use of err() in drivers/usb/serialGreg Kroah-Hartman2008-10-171-12/+14
| | | | | | | | | err() is going away, so switch to dev_err() or printk() if it's really needed. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: remove info() macro from usb/serial driversGreg Kroah-Hartman2008-10-171-1/+2
| | | | | | | USB should not be having it's own printk macros, so remove info() and use the system-wide standard of dev_info() wherever possible. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tty: usb-serial krefsAlan Cox2008-10-131-3/+4
| | | | | | | | | | | | | 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>
* mos7840: remove loads of bogus assignments to statusAlan Cox2008-07-221-236/+164
| | | | | | 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-99/+66
| | | | | | | | | | | | | | | | | | | 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>
* USB: mos7840: test and propagate set_uart_reg return valueRoel Kluin2008-05-021-3/+2
| | | | | | | | | | The test for an mos7840_set_uart_reg() error return value only works when status is signed. propagate its error value. Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Cc: SL Baur <steve@xemacs.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: remove unnecessary type casting of urb->contextMing Lei2008-04-241-4/+4
| | | | | | | | 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-75/+75
| | | | | | | | __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-5/+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: serial: Note mos7480 and option don't lock modem statusAlan Cox2008-04-241-0/+1
| | | | | | Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: Add support for the mos7820/7840-based B&B USB/RS485 converter to mos7840.cDavid Ludlow2008-03-041-1/+14
| | | | | | | | | Add support for the mos7820/7840-based B&B USOPTL4_2/USOPTL4_4 USB/RS485 converter to mos7840.c Signed-off-by: Dave Ludlow <dave.ludlow@bay.ws> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Spelling fixesJoe Perches2008-02-011-4/+4
| | | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: free memory when writing fails in usb/serial/mos7840.cRoel Kluin2007-11-281-1/+1
| | | | | | | | Free buffer when writing ZLP_REG5 failed Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mos7840: Clean up old checks and stuffAlan Cox2007-10-251-21/+2
| | | | | | Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mos7720, mos7840: remove redundant urb checkFlorin Malita2007-07-191-19/+0
| | | | | | | | | | | | Coverity (1709, 1710, 1711, 1712, 1713) actually flagged these as REVERSE_INULLs (NULL check performed after dereference). But looking at the other drivers I can't see any similar tests and the USB core already makes sure urb is non-null - so might as well get rid of the checks. Signed-off-by: Florin Malita <fmalita@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mos7840.c: turn this into a serial driverAlan Cox2007-07-121-72/+0
| | | | | | | | | | | | | | The MOS driver is "interesting", in a bad kind of 'how the hell did this get merged' kind of way - Remove the bogus termios change check - Remove the duplicate code for half the ioctls - Remove the supporting code to duplicate the ioctl code Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: mos7840: clean up urb->status usageGreg Kroah-Hartman2007-07-121-15/+19
| | | | | | | | | | | 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> Cc: Paul Schroeder <pschroeder@uplogix.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: remove useless check in mos7840 found by coverityOliver Neukum2007-05-221-5/+0
| | | | | | | | this useless check should be removed. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: overhaul of mos7840 driverOliver Neukum2007-04-271-88/+145
| | | | | | | | | | | | | | | | | | | | | | This fixes: - breaking DMA rules about buffers - usage of _global_ variables to save a single device's attributes - racy access to urb->status - smp monotonity issue with statistics - use of one buffer for many simultaneous URBs - error handling introduced - several instances of following NULL pointers - use after free - unnecessary GFP_ATOMIC - GFP_KERNEL in interrupt - various cleanups - write room granularity issue that bit cdc-acm - race in shutdown Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] Char: tty_wakeup cleanupJiri Slaby2007-02-111-12/+2
| | | | | | | | | | | | | | tty_wakeup cleanup - remove wake_up_interruptible(&tty->write_wait) surrounding tty_wakup(tty); - substitute tty->ldisc.write_wakeup(tty) + wake_up() by tty_wakeup(tty); Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Acked-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* USB serial: add driver pointer to all usb-serial driversJohannes Hölzl2007-02-071-7/+9
| | | | | | | | | | | | | | Every usb serial driver should have a pointer to the corresponding usb driver. So the usb serial core can add a new id not only to the usb serial driver, but also to the usb driver. Also the usb drivers of ark3116, mos7720 and mos7840 missed the flag no_dynamic_id=1. This is added now. Signed-off-by: Johannes Hölzl <johannes.hoelzl@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb serial: Eliminate bogus ioctl codeAlan2006-12-201-6/+0
| | | | | | | | | | | | | Several drivers have bogus ioctl code that tries unneccessarily to override the standard processing. In the three cases here the actual code is not only wrong but also not required as they implement the proper set_termios method as well. Remove the junk. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] tty: switch to ktermiosAlan Cox2006-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the grungy swap all the occurrences in the right places patch that goes with the updates. At this point we have the same functionality as before (except that sgttyb() returns speeds not zero) and are ready to begin turning new stuff on providing nobody reports lots of bugs If you are a tty driver author converting an out of tree driver the only impact should be termios->ktermios name changes for the speed/property setting functions from your upper layers. If you are implementing your own TCGETS function before then your driver was broken already and its about to get a whole lot more painful for you so please fix it 8) Also fill in c_ispeed/ospeed on init for most devices, although the current code will do this for you anyway but I'd like eventually to lose that extra paranoia [akpm@osdl.org: bluetooth fix] [mp3@de.ibm.com: sclp fix] [mp3@de.ibm.com: warning fix for tty3270] [hugh@veritas.com: fix tty_ioctl powerpc build] [jdike@addtoit.com: uml: fix ->set_termios declaration] Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Martin Peschke <mp3@de.ibm.com> Acked-by: Peter Oberparleiter <oberpar@de.ibm.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] slab: remove SLAB_ATOMICChristoph Lameter2006-12-071-2/+2
| | | | | | | | SLAB_ATOMIC is an alias of GFP_ATOMIC Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* USB serial: replace kmalloc+memset with kzallocBurman Yan2006-12-011-2/+1
| | | | | | | | Replace kmalloc+memset with kzalloc Signed-off-by: Yan Burman <yan_952@hotmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud