summaryrefslogtreecommitdiffstats
path: root/drivers/usb
Commit message (Collapse)AuthorAgeFilesLines
* usb: Netlogic: Use CPU_XLR in place of NLM_XLRJayachandran C2011-11-182-2/+2
| | | | | | | | Use CONFIG_CPU_XLR instead of CONFIG_NLM_XLR, the NLM_XLR config option is redundant and is being removed. Signed-off-by: Jayachandran C <jayachandranc@netlogicmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: make the usbfs memory limit configurableAlan Stern2011-11-181-4/+22
| | | | | | | | | | | | | | | The 16-MB global limit on memory used by usbfs isn't suitable for all people. It's a reasonable default, but there are applications (especially for SuperSpeed devices) that need a lot more. This patch (as1498) creates a writable module parameter for usbcore to control the global limit. The default is still 16 MB, but users can change it at runtime, even after usbcore has been loaded. As a special case, setting the value to 0 is treated the same as the hard limit of 2047 MB. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: change the memory limits in usbfs URB submissionAlan Stern2011-11-181-19/+57
| | | | | | | | | | | | | | | | | | | | | | | | For a long time people have complained about the limitations imposed by usbfs. URBs coming from userspace are not allowed to have transfer buffers larger than a more-or-less arbitrary maximum. While it is generally a good idea to avoid large transfer buffers (because the data has to be bounced to/from a contiguous kernel-space buffer), it's not the kernel's job to enforce such limits. Programs should be allowed to submit URBs as large as they like; if there isn't sufficient contiguous memory available then the submission will fail with a simple ENOMEM error. On the other hand, we would like to prevent programs from submitting a lot of small URBs and using up all the DMA-able kernel memory. To that end, this patch (as1497) replaces the old limits on individual transfer buffers with a single global limit on the total amount of memory in use by usbfs. The global limit is set to 16 MB as a nice compromise value: not too big, but large enough to hold about 300 ms of data for high-speed transfers. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: unify some error pathways in usbfsAlan Stern2011-11-181-46/+50
| | | | | | | | | This patch (as1496) unifies the error-return pathways of several functions in the usbfs driver. This is not a very important change by itself; it merely prepares the way for the next patch in this series. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: remove homegrown UTF conversion routine for gadgetsAlan Stern2011-11-182-69/+5
| | | | | | | | | | | | | | This patch (as1502) removes the UTF8-to-UTF16 conversion routine in the USB gadget library and replaces it with a call to the equivalent function in the NLS library. The only downside worth noting is that the NLS library routine requires the output buffer to be 16-bit aligned. This is always true in the gadget code, because the output buffer is always a usb_request buffer being used to send a string descriptor. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* OHCI: remove uses of hcd->stateAlan Stern2011-11-1814-49/+45
| | | | | | | | | This patch (as1500) removes all uses of the objectionable hcd->state variable from the ohci-hcd family of drivers. It is replaced by a private ohci->rh_state field, just as in uhci-hcd and ehci-hcd. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: do not forward USB specific errors in writeJohan Hovold2011-11-151-0/+2
| | | | | | | | | | | | | Use usb_translate_errors() to map USB-specific errors to errors appropriate for user space (ENOMEM, ENODEV and EIO) in write. Currently almost all serial drivers simply forward error codes from the stack (e.g. from usb_submit_urb()), but these codes often have different meanings in user-space. Doing the mapping in usb-serial core simplifies driver code and allows for more consistent error reporting. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: fix whitespace issuesJohan Hovold2011-11-151-8/+9
| | | | | | | Minor whitespace clean ups. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: oti6858: forward USB errors to USB serial coreJohan Hovold2011-11-151-1/+1
| | | | | | | Forward errors from usb_submit_urb in open. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: oti6858: remove dead codeJohan Hovold2011-11-151-12/+0
| | | | | | | | Remove code that was apparently copied from pl2303, disabled and then never used. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: iuu_phoenix: forward USB errors to USB serial coreJohan Hovold2011-11-151-2/+1
| | | | | | | Forward errors from usb_submit_urb in open. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: cp210x: forward USB errors to USB serial coreJohan Hovold2011-11-151-6/+13
| | | | | | | Make sure we forward all error codes (e.g. ENOMEM) to USB serial core. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ch341: forward USB errors to USB serial coreJohan Hovold2011-11-151-1/+1
| | | | | | | | All error messages from stack in open are being forwarded except for one call to usb_submit_urb. Change this for consistency. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: do not forward USB specific errors in openJohan Hovold2011-11-151-0/+4
| | | | | | | | | | | | | Use usb_translate_errors() to map USB-specific errors to errors appropriate for user space (ENOMEM, ENODEV and EIO) in open. Currently almost all serial drivers simply forward error codes from the stack (e.g. from usb_submit_urb()), but these codes often have different meanings in user-space. Doing the mapping in usb-serial core simplifies driver code and allows for more consistent error reporting. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: move usb_translate_errors to linux/usb.hJohan Hovold2011-11-151-14/+0
| | | | | | | | Move usb_translate_errors from usb core to linux/usb.h as it is meant to be accessed from drivers. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: add support for multiple read urbsJohan Hovold2011-11-152-40/+93
| | | | | | | | | | Add support for multiple read urbs to generic read implementation. Use a static array of two read urbs for now which is enough to get a 50% throughput increase in one test setup. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: pl2303: use usb_serial_generic_openJohan Hovold2011-11-151-1/+1
| | | | | | | | Use generic open rather than calling usb_serial_submit_read_urb directly. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: pl2302: clean up error handling in openJohan Hovold2011-11-151-8/+7
| | | | | | | | Reorder urb submission and simply kill interrupt urb should read-urb submission fail (rather than calling close). Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: pl2303: return errors from usb_submit_urb in openJohan Hovold2011-11-151-2/+2
| | | | | | | Return errors from usb_submit_urb rather than EPROTO on errors in open. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usb_debug: use process_read_urbJohan Hovold2011-11-151-4/+3
| | | | | | | | Use process_read_urb rather than read_bulk_callback for break processing. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usb_debug: fix indentationJohan Hovold2011-11-151-3/+3
| | | | | | | Use tabs for indentation. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: reuse generic write urb and bulk-out bufferJohan Hovold2011-11-151-19/+4
| | | | | | | | | Reuse first write urb and bulk-out buffer of the generic write implementation for drivers that rely on port->write_urb rather than allocating them separately. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: remove unnecessary bulk-urb re-fillsJohan Hovold2011-11-154-40/+3
| | | | | | | | | | | Remove unnecessary re-fills of bulk urbs whose fields have not changed since port probe. Compile-only tested. Cc: Matthias Bruestle and Harald Welte <support@reiner-sct.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: remove unnecessary reinitialisations of urb fieldsJohan Hovold2011-11-152-7/+0
| | | | | | | | | | Remove unnecessary reinitialisations of completion and context fields of urbs. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: remove unnecessary reinitialisations of urb->devJohan Hovold2011-11-1520-107/+8
| | | | | | | | | | | | | | | | Remove unnecessary reinitialisations of urb->dev before each submission, which were based on the (no longer valid) assumption that serial->dev will be set to NULL on close. Compile-only tested. Cc: Matthias Bruestle and Harald Welte <support@reiner-sct.com> Cc: Lonnie Mendez <dignome@gmail.com> Cc: Peter Berger <pberger@brimson.com> Cc: Al Borchers <alborchers@steinerpoint.com> Cc: Support Department <support@connecttech.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mos7720: remove unused codeJohan Hovold2011-11-151-3/+0
| | | | | | | Remove variable port0 from open as it is not used. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mos7720: remove incorrect read-urb checkJohan Hovold2011-11-151-10/+0
| | | | | | | | | | Remove incorrect and unnecessary check for port->read_urb which is not set to NULL, contrary to what seems to be assumed, when urb is killed. Compile only-tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: keyspan_pda: clean up write-urb busy handlingJohan Hovold2011-11-151-5/+5
| | | | | | | | | | Use port write_urbs_free mask rather than write_urb_busy field in struct serial_port. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: cyberjack: clean up write-urb busy handlingJohan Hovold2011-11-151-8/+4
| | | | | | | | | | | Use port write_urbs_free mask rather than write_urb_busy field in struct serial_port. Compile-only tested. Cc: Matthias Bruestle and Harald Welte <support@reiner-sct.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: omninet: clean up write-urb busy handlingJohan Hovold2011-11-151-10/+4
| | | | | | | | | | Use port write_urbs_free mask rather than write_urb_busy field in struct serial_port. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: omninet: fix write_roomJohan Hovold2011-11-151-1/+1
| | | | | | | | | | | Fix regression introduced by commit 507ca9bc047666 ([PATCH] USB: add ability for usb-serial drivers to determine if their write urb is currently being used.) which inverted the logic in write_room so that it returns zero when the write urb is actually free. Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: remove changelogs and old todo entriesJohan Hovold2011-11-1513-1340/+0
| | | | | | | | | | Remove remaining changelogs from file headers (can still be retrieved through git). Remove even older changelog entries stored in Changelog.history. Remove outdated todo entries from belkin_sa. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: OHCI/EHCI-XLS: Use resource_size v3Thomas Meyer2011-11-152-2/+2
| | | | | | | | | | | Use resource_size function on resource object instead of explicit computation. The semantic patch that makes this change is available in scripts/coccinelle/api/resource_size.cocci. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Realtek cr: Use kmemdup rather than duplicating its implementationThomas Meyer2011-11-151-2/+1
| | | | | | | | | | Use kmemdup rather than duplicating its implementation The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: shuttle_usbat: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/shuttle_usbat.c:173:22: warning: | symbol 'usbat_usb_ids' was not declared. Should | it be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: sddr55: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/sddr55.c:51:22: warning: symbol | 'sddr55_usb_ids' was not declared. Should it | be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: sddr09: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/sddr09.c:74:22: warning: symbol | 'sddr09_usb_ids' was not declared. Should it | be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storagE: realtek_cr: fix sparse warningsFelipe Balbi2011-11-151-6/+5
| | | | | | | | | | | | | | | | | | Fix the following sparse warnings: | drivers/usb/storage/realtek_cr.c:821:6: warning: symbol | 'rts51x_invoke_transport' was not declared. Should | it be static? | | drivers/usb/storage/realtek_cr.c:980:5: warning: symbol | 'realtek_cr_suspend' was not declared. Should it | be static? | | drivers/usb/storage/realtek_cr.c:518:23: warning: cast | truncates bits from constant value (fe47 becomes 47) Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: onetouch: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/onetouch.c:72:22: warning: symbol | 'onetouch_usb_ids' was not declared. Should it | be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: karma: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/karma.c:62:22: warning: symbol | 'karma_usb_ids' was not declared. Should it | be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: jumpshot: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/jumpshot.c:74:22: warning: symbol | 'jumpshot_usb_ids' was not declared. Should it | be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: isd200: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/freecom.c:122:22: warning: symbol | 'freecom_usb_ids' was not declared. Should it | be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: freecom: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/freecom.c:122:22: warning: symbol | 'freecom_usb_ids' was not declared. Should it | be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: ene_ub6250: fix sparse warningsFelipe Balbi2011-11-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Fix the following sparse warnings: | drivers/usb/storage/ene_ub6250.c:45:22: warning: symbol | 'ene_ub6250_usb_ids' was not declared. Should it | be static? | | drivers/usb/storage/ene_ub6250.c:780:5: warning: symbol | 'ms_lib_alloc_logicalmap' was not declared. Should it | be static? | | drivers/usb/storage/ene_ub6250.c:2251:5: warning: symbol | 'ms_scsi_irp' was not declared. Should it be static? | | drivers/usb/storage/ene_ub6250.c:638:29: warning: right shift by bigger | than source value | | drivers/usb/storage/ene_ub6250.c:639:29: warning: right shift by bigger | than source value Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: datafab: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/datafab.c:91:22: warning: symbol | 'datafab_usb_ids' was not declared. Should it | be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: cypress: fix sparse warningFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following sparse warning: | drivers/usb/storage/cypress_atacb.c:46:22: warning: | symbol 'cypress_usb_ids' was not declared. Should | it be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usb: storage: alauda: fix sparse warningsFelipe Balbi2011-11-151-1/+1
| | | | | | | | | | | Fix the following warning: | drivers/usb/storage/alauda.c:142:22: warning: symbol | 'alauda_usb_ids' was not declared. Should it | be static? Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Add optional match for interface class to dynamic ID facilityJosua Dietze2011-11-151-1/+7
| | | | | | | | | | | | | | | | When adding the ID of a composite device dynamically to a driver, all hitherto unbound interfaces are bound to this driver regardless of their class, which may not be intended. The patch adds the option to tell the targeted interface class to a driver via the "new_id" attribute, in addition to the device ID. Also, it appends the ABI documentation accordingly. Example: $ echo "1234 2a2a ff" >/sys/bus/usb-serial/drivers/option1/new_id will bind only vendor-specific interfaces to the 3G driver. Signed-off-by: Josua Dietze <digidietze@draisberghof.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ehci: report Data Buffer Error in debug modeVikram Pandita2011-11-141-0/+11
| | | | | | | | | | | | | | | | | | | | Data Buffer Error as per spec section 4.15.1.1.2 results when there is Underrun or Overrun condition. This error is considered non-fatal and never gets reported. Its a very good indication on things going wrong at system level, like running memory at much slower speed. This is a good error to flag allowing system level corrections. An issue was found with OMAP4460 board where DDR had to be run at full speed and this logging helped. Signed-off-by: Vikram Pandita <vikram.pandita@ti.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Vikram Pandita <vikram.pandita@ti.com> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: cp210x.c: add mark/space parityRoland Koebler2011-11-141-17/+22
| | | | | | | Add mark and space parity support. Signed-off-by: Roland Koebler <r.koebler@yahoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud