aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2008-04-24USB: don't explicitly reenable root-hub status interruptsAlan Stern
This patch (as1069b) changes the way OHCI root-hub status-change interrupts are enabled. Currently a special HCD method, hub_irq_enable(), is called when the hub driver is finished using a root hub. This approach turns out to be subject to races, resulting in unnecessary polling. The patch does away with the method entirely. Instead, the driver automatically enables the RHSC interrupt when no more status changes are present. This scheme is safe with controllers using level-triggered semantics for their interrupt flags. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: OHCI: turn off RD when remote wakeup is disabledAlan Stern
This patch (as1068b) disables the RD interrupt flag when an OHCI root hub is suspended with remote wakeup disabled. Although the spec clearly states that this flag permits the controller to issue an interrupt when a resume request from downstream is detected and not when a local status change occurs, some controllers mistakenly use it for both types of event. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: HCDs use the do_remote_wakeup flagAlan Stern
When a USB device is suspended, whether or not it is enabled for remote wakeup depends on the device_may_wakeup() setting. The setting is then saved in the do_remote_wakeup flag. Later on, however, the device_may_wakeup() value can change because of user activity. So when testing whether a suspended device is or should be enabled for remote wakeup, we should always test do_remote_wakeup instead of device_may_wakeup(). This patch (as1076) makes that change for root hubs in several places. The patch also adjusts uhci-hcd so that when an autostopped controller is suspended, the remote wakeup setting agrees with the value recorded in the root hub's do_remote_wakeup flag. And the patch adjusts ehci-hcd so that wakeup events on selectively suspended ports (i.e., the bus itself isn't suspended) don't turn on the PME# wakeup signal. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: g_file_storage: ignore bulk-out data after invalid CBWAlan Stern
This patch (as1061) makes g_file_storage more compliant with the Bulk-Only Transport specification. After an invalid CBW is received, the gadget must ignore any further bulk-OUT data until it is reset. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: serial: remove endpoints setting checks from core and headerGreg Kroah-Hartman
Remove the unused check for num_interrupt and friends as well as remove them from the header file because no usb-serial drivers no longer reference them. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: serial: remove unneeded number endpoints settingsGreg Kroah-Hartman
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>
2008-04-24USB: option.c: correct DTR behaviourChris Collins
Setting DTR et al. should work for all interfaces if you actually pass the interface number. :-P This should help with devices that have important pseudo-serial ports that aren't on the first interface in the device. Signed-off-by: Chris Collins <chris@ursys.com.au> Signed-off-by: Matthias Urlichs <matthias@urlichs.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: ehci: qh/qtd cleanup commentsDavid Brownell
Provide better comments about qh_completions() and QTD handling. That code can be *VERY* confusing, since it's evolved over a few years to cope with both hardware races and silicon quirks. Remove two unlikely() annotations that match the GCC defaults (and are thus pointless); add an "else" to highlight code flow. This patch doesn't change driver behavior. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: log an error message when USB enumeration failsAlan Stern
This patch (as1077) logs an error message whenever the kernel is unable to enumerate a new USB device. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Remove superfluous "depends on USB_SERIAL" from Kconfig.Robert P. J. Day
Given that most of drivers/usb/serial/Kconfig is wrapped inside: if USB_SERIAL ... endif # USB_SERIAL remove the consequently redundant dependencies on USB_SERIAL. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: add extension of anchor API, usb_unlink_anchored_urbsOliver Neukum
This adds the ability to trigger asynchronous unlinks of anchored URBs. This is needed for error handling in the comntext of completion handlers, which cannot sleep. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: r8a66597-hcd: Add support for SH7366 USB hostYoshihiro Shimoda
R8A66597 is similar to SH7366 USB 2.0 Host/Function module. It can support SH7366 USB host by changing several R8A66597 code. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: r8a66597-hcd: fix usb device connection timingYoshihiro Shimoda
Fix the problem that enumeration of a USB device was slow. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: r8a66597-hcd: fix interrupt transfer intervalYoshihiro Shimoda
This driver ignored the value of bInterval and revised the problem that performed interrupt transfer. ASIX USB Ethernet adapter comes to work with this host controller by applying this patch. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: oti6858: fix TCFLSH ioctl handlingPaulius Zaleckas
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>
2008-04-24USB: ehci shutdown refactoredSarah Sharp
This patch refactors some shutdown code so it can be shared between ehci_stop() and ehci_shutdown(). This also fixes a couple potential bugs: - ehci_shutdown() was not locking ehci->lock before halting the HC. - ehci_shutdown() didn't disable the watchdog and IAA timers. - ehci_stop() was resetting the host controller when it may have been running, which the EHCI spec says "may result in undefined behavior". ehci_stop() was calling port_power() to turn off the ports, which waited 20ms after applying the port change. The msleep was for the case where the HC might take 20ms to turn the ports on; since we're shutting them off, we can avoid the msleep and just use ehci_turn_off_ports(). ehci_stop() doesn't need to clear the intr_enable register or revert ownership of the companion controllers to the BIOS, because the host controller reset should have done that. There might be a buggy host controller that doesn't follow the reset rules, but for now we assume it's redundant code and remove it. [ A subsequent patch will cancel the timers later ... this version carries forward existing bugs where timers could get re-armed after they're canceled. ] Signed-off-by: Sarah Sharp <sarah.a.sharp@intel.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: at91_udc can prefetch dataDavid Brownell
The at91sam9 chip are ARMv5 so they support preload instructions. Use preloading to load the FIFO a bit faster. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: dummy-hcd: use dynamic allocation for platform_devicesAlan Stern
This patch (as1075) changes dummy-hcd to dynamically allocate its platform_device structures, using the core platform_device_alloc() interface. This is what it should have done all along, because the dynamically-allocated structures have a release method in the driver core and are therefore immune to being released after the module has been unloaded. Thanks to Richard Purdie for pointing out the need for this change. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: gadget section fixesDavid Brownell
Restore some section annotations: they were switched to "__devinit" while they should have been "__init", because of bogus warnings. The warnings are now fixed, so the runtime footprint of various drivers can now shrink a bit. On ARMv5, it's about 600 bytes except for the Ethernet gadget, where it can save a bit more. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: rework sysfs removal of interface filesAlan Stern
Removing an interface's sysfs files before unregistering the interface doesn't work properly, because usb_unbind_interface() will reinstall altsetting 0 and thereby create new sysfs files. This patch (as1074) removes the files after the unregistration is finished. It's not quite as clean, but at least it works. Also, there's no need to check if an interface has been registered before removing its sysfs files. If it hasn't been registered then the files won't have been created, so usb_remove_sysfs_intf_files() will simply do nothing. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24usb: replace remaining __PRETTY_FUNCTION__ occurrencesHarvey Harrison
The kernel is written in C, not C++, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: OHCI: host-controller resumes leave root hub suspendedAlan Stern
Drivers in the ohci-hcd family should perform certain tasks whenever their controller device is resumed. These include checking for loss of power during suspend, turning on port power, and enabling interrupt requests. Until now these jobs have been carried out when the root hub is resumed, not when the controller is. Many drivers work around the resulting awkwardness by automatically resuming their root hub whenever the controller is resumed. But this is wasteful and unnecessary. To simplify the situation, this patch (as1066) adds a new core routine, ohci_finish_controller_resume(), which can be used by all the OHCI-variant drivers. They can call the new routine instead of resuming their root hubs. And ohci-pci.c can call it instead of using its own special-purpose handler. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: clarify usage of hcd->suspend/resume methodsAlan Stern
The .suspend and .resume method pointers in struct usb_hcd have not been fully understood by host-controller driver writers. They are meant for use with PCI controllers; other platform-specific drivers generally should not refer to them. To try and clarify matters, this patch (as1065) renames those methods to .pci_suspend and .pci_resume. It eliminates corresponding dead code and bogus references in the ohci-ssb and u132-hcd drivers. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: root hubs don't lie about their number of TTsAlan Stern
Currently EHCI root hubs enumerate with a bDeviceProtocol code indicating that they possess a Transaction Translator. However the vast majority of controllers do not; they rely on a companion controller to handle full- and low-speed communications. This patch (as1064) changes the root-hub device descriptor to match the actual situation. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: OHCI: fix bug in controller resumeAlan Stern
This patch (as1063) fixes a bug in the way ohci-hcd resumes its controllers. It leaves the Master Interrupt Enable bit turned off. If the root hub is resumed immediately this won't matter. But if the root hub is suspended (say because no devices are plugged in), it won't ever wake up by itself. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: David Brownell <david-b@pacbell.net> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: gadget: dummy_hcd.c: fix nested switch statementsIngo van Lil
Fix a messed up combination of two nested switch statements in drivers/usb/gadget/dummy_hcd.c. According to the USB spec (section 5.8.3) the maximum packet size for bulk endpoints can be 512 for high-speed devices and 8, 16, 32 or 64 for full-speed devices. Low-speed devices must not have bulk endpoints. Signed-off-by: Ingo van Lil <inguin@gmx.de> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: mem leak fixes for AMD 5536 UDC high/full speed USB device controller ↵Jesper Juhl
driver In drivers/usb/gadget/amd5536udc.c::udc_pci_probe(), sizeof(struct udc) storage is allocated for 'dev'. There are many exit points from the function where 'dev' is not free'd but has also not yet been used for anything. The following patch free's 'dev' at the return points where it has not yet been used. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: usb-storage: use adaptive DMA maskAlan Stern
This patch (as1060) makes usb-storage set the DMA alignment mask for SCSI slaves to match the maxpacket size of the bulk-IN endpoint, rather than always setting it to 511. For full-speed devices that mask is too restrictive, and wireless USB devices can have maxpacket sizes larger than 512. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: g_printer bugfixesCraig W. Nadler
G_PRINTER: Bug fix for blocking reads and a fix for a memory leak. This fixes bugs in blocking IO calls. When the poll() entry point is called receive transfers will be setup if they have not already been. Another bug fix is that the poll() entry point now checks the current receive buffer for data when reporting if any data had been received. A memory leak was fixed that could have occurred when a USB reset happened. Signed-off-by: Craig W. Nadler <craig@nadler.us> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: test for NULL return from platform_get_resource() in ↵Jesper Juhl
ohci_hcd_sm501_drv_remove() platform_get_resource() may return null, so although it seems it will never do so here unless there's a bug elsewhere, it does no harm to be defensive and test. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Magnus Damm <magnus.damm@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: fix comments of 2 functions in hcd.cMing Lei
Remove useless @type note for rh_string() and @r note for usb_hcd_irq() since this two parameters were removed. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24usb: u132-hcd driver: semaphore to mutexDaniel Walker
Signed-off-by: Daniel Walker <dwalker@mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24usb: u132-hcd driver style clean upDaniel Walker
I was converting a semaphore in this file to a mutex when I noticed that this file has some fairly rampant style problems. Practically every line has spaces instead of tabs .. Once I cleared that up, checkpatch.pl showed a number of other problem.. I think this file might be a good one to review for new style checks that could be added.. Below are the only two remaining which I didn't remove. #5083: FILE: drivers/usb/host/u132-hcd.c:2907: + error: WARNING: labels should not be indented #5087: FILE: drivers/usb/host/u132-hcd.c:2911: + stall: These labels are actually inside a switch statement, and they are right under "default:". "default:" appears to be exempt and these other label should be too, or default shouldn't be exempt. I also deleted a few lines due to single statements inside { } , if (is_error()) { return; } becomes, if (is_error()) return; with one line deleted. Signed-off-by: Daniel Walker <dwalker@mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: add usb-serial spcp8x5 driverGreg Kroah-Hartman
Original version of the driver done by Linxb, changes by Harald, and lots of cleanups by me in order to get it into a mergable state. Cc: Linxb <xubin.lin@worldplus.com.cn> Cc: Harald Klein <hari@vt100.at> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24usb/usb-serial-sierra-add-new-dev-groupKevin Lloyd
This patch is for the sierra driver and adds support for a new group of devices that have a new USB configuration. This targets kernel 2.6.25-rc7 Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Serial: Sierra: C597 fixKevin Lloyd
This patch is for the sierra driver and fixes a Compass 597 bug that allows users to access the SD-Card. This targets kernel 2.6.25-rc7 Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Serial: Sierra: Clean upKevin Lloyd
This patch cleans up some of the sierra driver code. Please package this with the other patches in this group as I would like the driver version to reflect their changes as well. Signed-off-by: Kevin Lloyd <klloyd@sierrawireless.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: increase cdc-acm write throughputDavid Engraf
the following patch uses 16 write urbs and a writsize of wMaxPacketSize * 20. With this patch I get the maximum througput from my linux system with 20MB/sec read and 15 MB/sec write (full speed 1 MB/sec both) I also deleted the flag URB_NO_FSBR for the writeurbs, because this makes my full speed devices significant slower. Signed-off-by: David Engraf <david.engraf@netcom.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: cdc-acm tell tty layer not to split things up.David Engraf
It ensures that the tty level do not split the send buffer into 2KB blocks. Signed-off-by: David Engraf <david.engraf@netcom.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24usbmon: restore mmapPete Zaitcev
Paolo asked to enable the mmap. I kept it off because I'm do not entirely understand how it workse these days after ->nopage etc. But it seems like working somewhat at least. Signed-Off-By: Pete Zaitcev <zaitcev@gmail.com> Cc: Paolo Abeni <paolo.abeni@email.it> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Fix "cut and paste" booboo in usbmon Makefile.Robert P. J. Day
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Remove EXPERIMENTAL designation from USB_EHCI_ROOT_HUB_TT.Robert P. J. Day
According to David Brownell, this feature doesn't require an experimental designation any longer. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Remove EXPERIMENTAL from dynamic USB minor allocation.Robert P. J. Day
Since this USB feature seems non-experimental, remove that dependency. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Remove EXPERIMENTAL designation from USB MDC800 support.Robert P. J. Day
Since support for the USB Mustek MDC800 Digital Camera has apparently been around since the beginning of the git repository, it's safe to assume it's no longer experimental. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Remove EXPERIMENTAL designation from USB serial/ Kconfig entriesRobert P. J. Day
Since nothing under the USB serial/ directory seems to be obviously experimental, remove the EXPERIMENTAL dependency from all of those Kconfig entries. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Remove EXPERIMENTAL designation from USB misc/ Kconfig entriesRobert P. J. Day
Since nothing under the USB misc/ seems to be obviously experimental, remove the EXPERIMENTAL dependency from those Kconfig entries. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: Remove EXPERIMENTAL tags from some USB gadget Kconfig entries.Robert P. J. Day
Based on a recent discussion on the Linux USB mailing list, remove the designation of EXPERIMENTAL from some USB gadget entries, and tag some of them as DEVELOPMENT. just for fun, i added a bit of help for gadgetfs, explaining the race condition. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
2008-04-24USB: Remove EXPERIMENTAL designation from USB storage Kconfig entries.Robert P. J. Day
Since there seems to be little reason to mark the current USB storage features as "EXPERIMENTAL," remove that dependency. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24USB: mass storage: emulation of sat scsi_pass_thru with ATACBmatthieu castet
I have got a cypress usb-ide bridge and I would like to tune or monitor my disk with tools like hdparm, hddtemp or smartctl. My controller support a way to send raw ATA command to the disk with something call atacb (see http://download.cypress.com.edgesuite.net/design_resources/datasheets/contents/cy7c68300c_8.pdf). Atacb support can be added for each application, but there is some disadvantages : - all application need to be patched - A race is possible if there other accesses, because the emulation can be split in 2 atacb scsi transactions. One for sending the command, one for reading the register (if ck_cond is set). I have implemented the emulation in usb-storage with a special proto_handler, and an unsual entry. Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr> Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-24drivers/usb/core/devio.c: suppress warning with 64k PAGE_SIZEAndrew Morton
drivers/usb/core/devio.c: In function 'proc_control': drivers/usb/core/devio.c:657: warning: comparison is always false due to limited range of data type Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Pete Zaitcev <zaitcev@redhat.com> Cc: Oliver Neukum <oliver@neukum.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>