aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/serial/ftdi_sio.c
AgeCommit message (Collapse)AuthorFilesLines
2010-05-20USB: ftdi_sio: clean up SIO write supportJohan Hovold1-40/+13
The original SIO devices require a control byte for every packet written. Clean up the unnecessarily messy implementation of this. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-20USB: ftdi_sio: switch to generic write implementationJohan Hovold1-172/+19
Switch to the generic, multi-urb, write implementation. Note that this will also make it fairly easy to use the generic fifo-based write implementation: simply unset the multi_urb_write flag and modify prepare_write_buffer (or unset if not using a legacy SIO device). This may be desirable for instance on an embedded system where optimal throughput at high baudrates may not be as important as other factors (e.g. no allocations during runtime and less pressure on host stack). Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-20USB: ftdi_sio: fix some coding style issuesJohan Hovold1-31/+14
Remove unnecessary comments stating function names at (some) opening/closing braces. Fix some whitespace issues. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-20USB: ftdi_sio: switch to generic read implementationJohan Hovold1-92/+7
Switch to generic read implementation and use process_read_urb to do device specific processing (handle line status). Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-20USB: serial: allow drivers to define bulk buffer sizesJohan Hovold1-15/+1
Allow drivers to define custom bulk in/out buffer sizes in struct usb_serial_driver. If not set, fall back to the default buffer size which matches the endpoint size. Three drivers are currently freeing the pre-allocated buffers and allocating larger ones to achieve this at port probe (ftdi_sio) or even at port open (ipaq and iuu_phoenix), which needless to say is suboptimal. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-20usb-serial: Use tty_port version console instead of usb_serial_portJason Wessel1-1/+1
Replace all instances of using the console variable in struct usb_serial_port with the struct tty_port version. CC: Alan Cox <[email protected]> CC: Alan Stern <[email protected]> CC: Oliver Neukum <[email protected]> CC: Andrew Morton <[email protected]> CC: [email protected] CC: [email protected] Signed-off-by: Jason Wessel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-19USB: ftdi_sio: Fix locking for change_speed() functionAlessio Igor Bogani1-2/+4
The change_speed() function should be serialized against multiple calls. Use the cfg_lock mutex to do this. Signed-off-by: Alessio Igor Bogani <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-19USB: serial: ftdi: add CONTEC vendor and product idDaniel Sangorrin1-0/+1
This is a patch to ftdi_sio_ids.h and ftdi_sio.c that adds identifiers for CONTEC USB serial converter. I tested it with the device COM-1(USB)H [[email protected]: keep the VIDs sorted a bit] Signed-off-by: Daniel Sangorrin <[email protected]> Cc: Andreas Mohr <[email protected]> Cc: Radek Liboska <[email protected]> Cc: stable <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: remove obsolete check in unthrottleJohan Hovold1-2/+1
No need to check ASYNCB_INITIALIZED anymore as commit e1108a63e10d344284011cccc06328b2cd3e5da3 (usb_serial: Use the shutdown() operation) make sure that there is no longer any call to unthrottle after device specific close (in which the read urb is killed). Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: remove unused tx_bytes counterJohan Hovold1-6/+0
Remove counter that is never exported. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: serial: ftdi: add CONTEC vendor and product idDaniel Sangorrin1-0/+1
This is a patch to ftdi_sio_ids.h and ftdi_sio.c that adds identifiers for CONTEC USB serial converter. I tested it with the device COM-1(USB)H Signed-off-by: Daniel Sangorrin <[email protected]> Cc: Andreas Mohr <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: serial: Remove unnecessary \n's from dbg usesJoe Perches1-1/+1
#define dbg adds the newline, messages shouldn't. Converted dbg("%s", "some string") to dbg("some string") Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: add new ftdi_sio device idsMitchell Solomon1-0/+4
PID patch for my products Signed-off-by: Mitchell Solomon <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: Replace BKL with a mutexAlessio Igor Bogani1-6/+8
As Alan Cox have pinpointed the driver still required protection against parallels calls to the config ioctl(). If lock is still necessary the use of BKL is abused here. So replace BKL with a more convenient mutex. Signed-off-by: Alessio Igor Bogani <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Johan Hovold <[email protected]> Cc: Alan Cox <[email protected]> Cc: Daniel Mack <[email protected]> Cc: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: correct spelling in implementation fileAndreas Mohr1-7/+7
- correct spelling - correct non-tabbed .tiocmget/.tiocmset entries Signed-off-by: Andreas Mohr <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: remove unnecessary initialisationsJohan Hovold1-9/+9
Return values are being initialised to zero only to be unconditionally assigned to a few instructions later. This may give the impression that zero is returned on success, which is not the case. Note also that ftdi_NDI_device_setup never reports errors. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: clean up modem status handlingJohan Hovold1-21/+16
Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: fix DMA buffers on stackJohan Hovold1-42/+27
Also remove unnecessary buffer allocations for zero-length transfers. Reported-by: Matti Aarnio <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: fix latency-timeout endianess bugJohan Hovold1-4/+10
Also fixes DMA transfer to stack for latency buffer. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: use error code from usb stack in read_latency_timerJohan Hovold1-3/+2
Use same semantics as for write_latency_timer. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: remove support for 5 and 6 data bitsMark Adamson1-3/+1
Removed CS5 and CS6 from data bits since these are not supported in FTDI hardware. Signed-off-by: Mark J. Adamson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: fix initialisation of latency timeoutJohan Hovold1-4/+5
Latency timeout was read but never stored on port probe. When ASYNC_LOW_LATENCY was cleared the device timeout would get set to 0 rather than the default 16ms. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: remove obsolete commentJohan Hovold1-2/+1
We always push characters to ldisc immediately regardless of ASYNC_LOW_LATENCY. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-03-02USB: ftdi_sio: fix error message on closeJohan Hovold1-1/+1
Resubmitting read urb fails with -EPERM if completion handler runs while urb is being killed on close. This should not be reported as an error. Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-02-16USB: ftdi_sio: add device IDs (several ELV, one Mindstorms NXT)Andreas Mohr1-3/+21
- add FTDI device IDs for several ELV devices and NXTCam of Lego Mindstorms NXT - add hopefully helpful new_id comment - remove less helpful "Due to many user requests for multiple ELV devices we enable them by default." comment (we simply add _all_ known devices - an enduser shouldn't have to fiddle with obscure module parameters...). - add myself to DRIVER_AUTHOR The missing NXTCam ID has been found at http://www.unixboard.de/vb3/showthread.php?t=44155 , ELV devices taken from ELV Windows .inf file. Signed-off-by: Andreas Mohr <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-02-16USB: ftdi_sio: new device id for papouch AD4USBRadek Liboska1-0/+1
added new device pid (PAPOUCH_AD4USB_PID) to ftdi_sio.h and ftdi_sio.c AD4USB measuring converter is a 4-input A/D converter which enables the user to measure to four current inputs ranging from 0(4) to 20 mA or voltage between 0 and 10 V. The measured values are then transferred to a superior system in digital form. The AD4USB communicates via USB. Powered is also via USB. datasheet in english is here: http://www.papouch.com/shop/scripts/pdf/ad4usb_en.pdf Signed-off-by: Radek Liboska <[email protected]>
2009-12-23USB: ftdi_sio: isolate all device IDs to new ftdi_sio_ids.h headerAndreas Mohr1-0/+1
This is a strictly move-only patch to relocate all FTDI device product ID definitions to their own ftdi_sio_ids.h header (following the usual *_ids.h kernel tree convention, too), thus correcting the slightly too messy appearance (crucial driver defines were stuck somewhere in the decaying middle swamp of the huge existing header). Compile-tested, based on latest mainline git. Signed-off-by: Andreas Mohr <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-12-11USB: ftdi_sio: add USB device ID's for B&B Electronics lineCliff Brake1-0/+14
Reviewed-by: John Pilles <[email protected]> Signed-off-by: Cliff Brake <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-12-11USB: serial: ftdi_sio: add space/mark parityRoland Koebler1-6/+12
Add mark and space parity, since the device supports it. Signed-off-by: Roland Koebler <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-11-30USB: ftdi_sio: Keep going when write errors are encountered.Eric W. Biederman1-2/+1
The use of urb->actual_length to update tx_outstanding_bytes implicitly assumes that the number of bytes actually written is the same as the number of bytes we tried to write. On error that assumption is violated so just use transfer_buffer_length the number of bytes we intended to write to the device. If an error occurs we need to fall through and call usb_serial_port_softint to wake up processes waiting in tty_wait_until_sent. Signed-off-by: Eric W. Biederman <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-10-09USB: ftdi_sio: re-implement read processingJohan Hovold1-252/+131
- Re-structure read processing. - Kill obsolete work queue and always push to tty in completion handler. - Use tty_insert_flip_string instead of per character push when possible. - Fix stalled-read regression in 2.6.31 by using urb status to determine when port is closed rather than port count. - Fix race with open/close by checking ASYNCB_INITIALIZED in unthrottle. - Kill private rx_flag and lock and use throttle flags in usb_serial_port instead. Signed-off-by: Johan Hovold <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-10-09USB: ftdi_sio: clean up read completion handlerJohan Hovold1-27/+1
Remove superfluous error checks in completion handler: - No need to check private data and urb pointers as we check urb-status before dereferencing priv (which is not freed until urb has been killed on close). - No need to check tty as it is checked again when processing. - No need to check urb->number_of_packets on bulk urb. Note that both private data and tty are checked again before processing (possibly from work queue which also is cancelled on close). Signed-off-by: Johan Hovold <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-10-09USB: ftdi_sio: remove unused rx_byte counterJohan Hovold1-13/+0
Remove unused rx_byte counter which is never exposed as noted by Alan Cox. Signed-off-by: Johan Hovold <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-10-09USB: ftdi_sio: remove tty->low_latencyJohan Hovold1-4/+0
Fixes tty_flip_buffer_push being called from hard interrupt context with low_latency set. Signed-off-by: Johan Hovold <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-09-23USB: serial: ftdi: handle gnICE+ JTAG adaptorsMichael Hennerich1-0/+2
Detect the UART on interface1 and blacklist interface0 (as that is the JTAG port). Signed-off-by: Michael Hennerich <[email protected]> Signed-off-by: Mike Frysinger <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-09-23USB: add PIDs for FTDI based OpenDCC hardware[email protected]1-0/+3
Some devices from the OpenDCC project are missing in the list of the FTDI PIDs. These PIDs are listed at http://www.opendcc.de/elektronik/usb/opendcc_usb.html (Sorry for the german only page.) This patch adds the three missing devices. Signed-off-by: Rainer Keller <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-09-23USB: serial: ftdi_sio: new hardware support - hameg power supplyPawel Ludwikow1-0/+2
I'd like to present my small patch enabling to use Hameg HM8143 programmable power supply with linux. Signed-off-by: Pawel Ludwikow <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-09-19tty: USB does not need the filp argument in the driversAlan Cox1-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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-08-07USB: ftdi_sio: add product_id for Marvell OpenRD Base, ClientDhaval Vasa1-0/+2
reference: http://www.open-rd.org Signed-off-by: Dhaval Vasa <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-08-07USB: ftdi_sio: add vendor and product id for Bayer glucose meter serial ↵Marko Hänninen1-0/+1
converter cable Attached patch adds USB vendor and product IDs for Bayer's USB to serial converter cable used by Bayer blood glucose meters. It seems to be a FT232RL based device and works without any problem with ftdi_sio driver when this patch is applied. See: http://winglucofacts.com/cables/ Signed-off-by: Marko Hänninen <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-07-28USB: ftdi_sio: Add support for GN Otometrics Aurical USB AudiometerVille Sundberg1-0/+1
The patch adds support for the GN Otometrics Aurical USB Audiometer (FT232BM-based). A new VID and a new PID is added. Signed-off-by: Ville Sundberg <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-07-13Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6Linus Torvalds1-1/+66
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (48 commits) USB: otg: fix module reinsert issue USB: handle zero-length usbfs submissions correctly USB: EHCI: report actual_length for iso transfers USB: option: remove unnecessary and erroneous code USB: cypress_m8: remove invalid Clear-Halt USB: musb_host: undo incorrect change in musb_advance_schedule() USB: fix LANGID=0 regression USB: serial: sierra driver id_table additions USB serial: Add ID for Turtelizer, an FT2232L-based JTAG/RS-232 adapter. USB: fix race leading to a write after kfree in usbfs USB: Sierra: fix oops upon device close USB: option.c: add A-Link 3GU device id USB: Serial: Add support for Arkham Technology adapters USB: Fix option_ms regression in 2.6.31-rc2 USB: gadget audio: select SND_PCM USB: ftdi: support NDI devices Revert USB: usbfs: deprecate and hide option for !embedded USB: usb.h: fix kernel-doc notation USB: RNDIS gadget, fix issues talking from PXA USB: serial: FTDI with product code FB80 and vendor id 0403 ...
2009-07-12USB serial: Add ID for Turtelizer, an FT2232L-based JTAG/RS-232 adapter.Krzysztof Halasa1-0/+2
Adds USB ID for Turtelizer, an FT2232L-based JTAG/RS-232 adapter. Signed-off-by: Krzysztof Ha³asa <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-07-12USB: ftdi: support NDI devicesMartin Geleynse1-1/+60
It enhances the driver for FTDI-based USB serial adapters to recognize and support Northern Digital Inc (NDI) measurement equipment. NDI has been providing this patch for various kernel flavors for several years and we would like to see these changes built in to the driver so that our equipement works without the need for customers to patch the kernel themselves. The patch makes small modifications to 2 files: ./drivers/usb/serial/ftdi_sio.c and ./drivers/usb/serial/ftdi_sio.h. It accomplishes 3 things: 1. Define the VID and PIDs to allow the driver to recognize the NDI devices. 2. Map the 19200 baud rate setting to our higher baud rate of 1.2Mb We would have chosen to map 38400 to the higher rate, similar to what several other vendors have done, but some of our legacy customers actually use 38400, therefore we remap 19200 to the higher rate. 3. We set the default transmit latency in the FTDI chip to 1ms for our devices. Our devices are typically polled at 60Hz and the default ftdi latency seriously affects turn-around time and results in missed data frames. We have created a modprobe option that allows this setting to be increased. This has proven necessary particularly in some virtualized environments. Signed-off-by: Martin P. Geleynse <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-07-12USB: serial: FTDI with product code FB80 and vendor id 0403Folkert van Heusden1-0/+1
It seems an USB device with vendor id 0403 and product code FB80 has an FTDI serial io chip as well: http://ftdichip.com/Drivers/D2XX.htm This device in fact is a true random generantor by comsci: http://comscire.com/Products/R2000KU/ So the following patch should add support for this device if I am correct. Not tested as I do not own this device (I would like support in the kernel so that my entropybroker application (which distributes entrop data (random values) between servers and clients)). From: Folkert van Heusden <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-07-12USB: ftdi_sio - product ID's for CCS PIC programmersJan Capek1-0/+3
The product ID's for the following devices have been added: - LOAD-n-GO - ICD-U64 - PRIME-8 Signed-off-by: Jan Capek <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-07-12headers: smp_lock.h reduxAlexey Dobriyan1-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 <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2009-07-10tty: Fix USB kref leakAlan Cox1-1/+1
The sysrq code acquired a kref leak. Fix it by passing the tty separately from the caller (thus effectively using the callers kref which all the callers hold anyway) Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2009-06-15USB: usb-serial: replace shutdown with disconnect, releaseAlan Stern1-14/+0
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-06-15USB: serial: ftd_sio: implement sysrq handling on breakJason Wessel1-2/+6
Change driver to make use of the new functions in include/linux/usb/serial.h so as to allow the driver to handle the sysrq Signed-off-by: Jason Wessel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>