aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* USB: uhci: rm repeatedly evaluation for urbp->qhBob Liu2009-09-231-1/+0
| | | | | | | Signed-off-by: Bob Liu <yjfpb04@gmail.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbtmc: fix printk format warningsRandy Dunlap2009-09-231-1/+1
| | | | | | | | | | Fix printk format warnings: drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 4 has type 'u32' drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 5 has type 'int' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbtmc: sanity checks for DEV_DEP_MSG_IN urbsGuus Sliepen2009-09-231-4/+18
| | | | | | | | | | | | | | | | | According to the specifications, an instrument should not return more data in a DEV_DEP_MSG_IN urb than requested. However, some instruments can send more than requested. This could cause the kernel to write the extra data past the end of the buffer provided by read(). Fix this by checking that the value of the TranserSize field is not larger than the urb itself and not larger than the size of the userspace buffer. Also correctly decrement the remaining size of the buffer when userspace read()s more than USBTMC_SIZE_IOBUFFER. Signed-off-by: Guus Sliepen <guus@sliepen.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: NXP ISP1362 USB host driverLothar Wassmann2009-09-236-0/+4044
| | | | | | | | | Signed-off-by: Lothar Wassmann <LW@KARO-electronics.de> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: dummy-hcd: accept mismatch between wLength and transfer lengthAlan Stern2009-09-231-5/+0
| | | | | | | | | | | | | | | | | This patch (as1269) fixes a bug in the way dummy_hcd handles control URBs. Currently it returns a -EOVERFLOW error if the wLength value in the setup packet is different from the URB's transfer_buffer_length. Other host controller drivers don't do this. There's no reason the two length values have to be equal, and in fact they sometimes aren't -- a driver might set the transfer length to the maxpacket value in order to handle buggy devices that don't respect wLength. This patch simply removes the unnecessary check and error return. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: don't lose mode switch events on suspended devicesAlan Stern2009-09-231-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1268) changes the way usbcore handles child devices that undergo a disconnection and reconnection while the parent hub is suspended. Currently, if the child isn't enabled for remote wakeup we leave it alone, figuring that it will go through a reset-resume when somebody tries to use it. However this isn't a good approach if the reason for the disconnection is that the child decided to switch modes or in some other way alter its descriptors. In that case we want to re-enumerate it as soon as possible, not wait until somebody forces a reset-resume. To resolve the issue, this patch treats reconnected suspended child devices as though they had requested a remote wakeup, even if they weren't enabled for it. The mode switch or descriptor change will be detected during the reset part of the reset-resume, and the device will be re-enumerated immediately. The disadvantage of this change is that it will cause autosuspended devices to be resumed when the computer wakes up from a system sleep during which the root hub was reset or lost power. This shouldn't matter much; some people would even argue that autosuspended devices should _always_ be resumed when the system wakes up! Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: "Yang Fei-AFY095" <fei.yang@motorola.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: check for hub driver not bound to root hub deviceAlan Stern2009-09-231-3/+7
| | | | | | | | | | | | | | | | | | | | This patch (as1267) changes usb_kick_khubd() and hdev_to_hub() to make them more resilient against situations where a hub device isn't bound to the hub driver. The code assumes that if a root hub was successfully registered then it must be bound to the hub driver. But this assumption can fail if the user manually unbinds the hub driver, or more importantly, if the host controller dies causing usb_set_configuration to fail. To protect against these possibilities, make hdev_to_hub() check that the hub device is configured before dereferencing the active configuration, and make usb_kick_khubd() check that the pointer to the hub's private data structure isn't NULL. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: fix wrong order of events in usb serial suspensionOliver Neukum2009-09-231-3/+7
| | | | | | | | | | if a subdriver has an additional suspend method, it must be called first to allow the subdriver to return -EBUSY, because the second half cannot be easily undone. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: au1xxx: add dev_pm_opsManuel Lauss2009-09-232-29/+27
| | | | | | | | | | move both ohci-au1xxx and ehci-au1xxx over to dev_pm_ops. Tested on Au1200. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: storage: Drop an unneeded a NULL testJulia Lawall2009-09-232-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In each case, the NULL test is not necessary because the function is static and at the only places where it is called, the us argument has already been dereferenced. The semantic patch that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ type T; expression E,E1; identifier i,fld; statement S; @@ - T i = E->fld; + T i; ... when != E=E1 when != i if (E == NULL||...) S + i = E->fld; // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: Spelling correction in Motorola USB Phone driverMaxin John2009-09-231-1/+1
| | | | | | | | | | | Spelling correction in Motorola USB Phone driver Changed: * Mororola should be using the CDC ACM USB spec, but instead To: * Motorola should be using the CDC ACM USB spec, but instead Signed-off-by: Maxin B. John <maxinbjohn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: isp1760: allow platform devices to customize devflagsMichael Hennerich2009-09-234-1/+44
| | | | | | | | | | | | | Platform device support was merged earlier, but support for boards to customize the devflags aspect of the controller was not. We want this on Blackfin systems to control the bus width, but might as well expose all of the fields while we're at it. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: Add Intel Moorestown EHCI controller HOSTPCx extensions and ↵Alek Du2009-09-234-6/+78
| | | | | | | | | | | | | | | | support phy low power mode The Intel Moorestown EHCI controller supports non-standard HOSTPCx register extension. This register controls the LPM behaviour and controls the behaviour of each USB port. Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com> Signed-off-by: Alek Du <alek.du@intel.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: split ehci_qh into hw and sw partsAlek Du2009-09-236-81/+127
| | | | | | | | | | | | | | | | | The ehci_qh structure merged hw and sw together which is not good: 1. More and more items are being added into ehci_qh, the ehci_qh software part are unnecessary to be allocated in DMA qh_pool. 2. If HCD has local SRAM, the sw part will consume it too, and it won't bring any benefit. 3. For non-cache-coherence system, the entire ehci_qh is uncachable, actually we only need the hw part to be uncacheable. Spliting them will let the sw part to be cacheable. Signed-off-by: Alek Du <alek.du@intel.com> Cc: David Brownell <dbrownell@users.sourceforge.net> CC: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: EHCI: add need_io_watchdog flag to ehci_hcdAlek Du2009-09-233-0/+10
| | | | | | | | | | | | Basically the io watchdog is only useful for those quirk HCDs. For most good ones, it only brings unnecessary wakeups. At least, I know the Intel EHCI HCDs should turn off the flag. Signed-off-by: Alek Du <alek.du@intel.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: full autosuspend and power management support for usbsevsegOliver Neukum2009-09-231-6/+63
| | | | | | | | | | | | This patch adds to the usbsevseg driver: - suspend/resume support - reset_resume support - autosuspend using the display's power state to determine idleness Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Harrison Metzger <harrisonmetz@gmail.com>
* USB: full power management support for the idmouse driverOliver Neukum2009-09-231-0/+21
| | | | | | | | | | | | | usb: full runtime PM support for idmouse driver - add suspend/resume support - add reset_resume support - add support for autosuspend Signed-off-by: Oliver Neukum <oliver@neukum.org> Tested-by: Andreas Deresch <aderesch@fs.tum.de>
* USB: gadget: s3c-hsotg: missing parenthesesRoel Kluin2009-09-231-3/+3
| | | | | | | | | | | Add missing parentheses Signed-off-by: Roel Kluin <roel.kluin@gmail.com> CC: Ben Dooks <ben@simtec.co.uk> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: Drop NULL test on list_entry resultJulia Lawall2009-09-231-31/+25
| | | | | | | | | | | | | | | | | | | | | | | | | list_entry, which is an alias for container_of, cannot return NULL, as there is no way to add a NULL value to a doubly linked list. A simplified version of the semantic match that findds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r@ expression x,E; statement S1,S2; position p,p1; @@ *x = list_entry@p(...) ... when != x = E *if@p1 (x == NULL) S1 else S2 // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ldusb should signal an error in poll if the device is disconnectedOliver Neukum2009-09-231-0/+6
| | | | | | | | poll() should test for a disconnection of the device. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: legousbtower: make poll notice disconnectOliver Neukum2009-09-231-0/+6
| | | | | | | | | | poll needs to return an error if a device is disconnected - make poll check for device's presence - wake all waiters in disconnect Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: suspend/resume support for usbtmcOliver Neukum2009-09-231-1/+14
| | | | | | | | | a class driver should have suspend/resume. This makes sure we don't see a virtual disconnect unnecessarily. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbtmc can do IO to device after disconnectOliver Neukum2009-09-231-0/+19
| | | | | | | | | | usbtmc will happily complete read/write requests even after disconnect has returned. The fix is to introduce a flag. Signed-off-by: Oliver Neukum <oliver@neukum.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usb-serial, remove unused variablesJiri Slaby2009-09-231-6/+0
| | | | | | | | There are some unused variables in serial_do_down. Remove them. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: serial: full autosuspend support for the option driverOliver Neukum2009-09-231-18/+116
| | | | | | | | | | | | | | this adds autosupport usable even in an always online mode. - enables remote wakeup on open - autoresume for sending - timeout based autosuspend if nothing is sent or recieved - autosuspend without remote wakeup support on open/close Signed-off-by: Oliver Neukum <oliver@neukum.org> Tested-off-by: Zhao Ming <zhao.ming9@zte.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: gadget: pxa25x: basic transceiver supportPhilipp Zabel2009-09-232-4/+46
| | | | | | | | | | | | | | | This adds very basic otg_transceiver support, with vbus_session and vbus_draw callbacks. Now VBUS sensing can be handled by an external driver which registers the otg_transceiver interface. It also allows gadget drivers to configure the current drawn from VBUS. The UDC driver just passes their requests along to the transceiver driver. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: make the "usbfs_snoop" log more pertinentAlan Stern2009-09-231-69/+62
| | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1261) reduces the amount of detailed URB information logged by usbfs when the usbfs_snoop parameter is enabled. Currently we don't display the final status value for a completed URB. But we do display the entire data buffer twice: both before submission and after completion. The after-completion display doesn't limit itself to the actual_length value. But since usbmon is readily available in virtually all distributions, there's no reason for usbfs to print out any buffer contents at all! So this patch restricts the information to: userspace buffer pointer, endpoint number, type, and direction, length or actual_length, and timeout value or status. Now everything fits neatly into a single line. Along with those changes, the patch also fixes the snoop output for the REAPURBNDELAY and REAPURBNDELAY32 ioctls. The current version omits the 'N' from the names. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: make intf.pm_usage an atomic_tAlan Stern2009-09-233-21/+28
| | | | | | | | | | | | | This patch (as1260) changes the pm_usage_cnt field in struct usb_interface from an int to an atomic_t. This is so that drivers can invoke the usb_autopm_get_interface_async() and usb_autopm_put_interface_async() routines without locking and without fear of corrupting the pm_usage_cnt value. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: add API for userspace drivers to "claim" portsAlan Stern2009-09-236-6/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1258) implements a feature that users have been asking for: It gives programs the ability to "claim" a port on a hub, via a new usbfs ioctl. A device plugged into a "claimed" port will not be touched by the kernel beyond the immediate necessities of initialization and enumeration. In particular, when a device is plugged into a "claimed" port, the kernel will not select and install a configuration. And when a config is installed by usbfs or sysfs, the kernel will not probe any drivers for any of the interfaces. (However the kernel will fetch various string descriptors during enumeration. One could argue that this isn't really necessary, but the strings are exported in sysfs.) The patch does not guarantee exclusive access to these devices; it is still possible for more than one program to open the device file concurrently. Programs are responsible for coordinating access among themselves. A demonstration program showing how to use the new interface can be found in an attachment to http://marc.info/?l=linux-usb&m=124345857431452&w=2 The patch also makes a small simplification to the hub driver, replacing a bunch of more-or-less useless variants of "out of memory" with a single message. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: whci-hcd: make endpoint_reset method asyncDavid Vrabel2009-09-235-6/+31
| | | | | | | | | | | | usb_hcd_endpoint_reset() may be called in atomic context and must not sleep. So make whci-hcd's endpoint_reset() asynchronous. URBs submitted while the reset is in progress will be queued (on the std list) and transfers will resume once the reset is complete. Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Add nuvoton Ehci driver for w90p910 platformWan ZongShun2009-09-234-0/+194
| | | | | | | | | Add ehci support for w90p910 platform. Signed-off-by: Wan ZongShun <mcuos.com@gmail.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB audio gadget: Un-inline generic_[gs]et_cmdLaurent Pinchart2009-09-232-12/+15
| | | | | | | | Those functions are used only used to fill the set/get members of usb_audio_control. It doesn't make much sense to inline them. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB audio gadget: Prefix all macro definitions with UAC_ in linux/usb/audio.hLaurent Pinchart2009-09-234-182/+188
| | | | | | | | | | linux/usb/audio.h is a public header file that includes definitions exported to userspace. To avoid namespace clashes, prefix all macro definitions with UAC_. Existing macros and structures prefixed with USB_AC_ and USB_AS_ are renamed for consistency. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Move vendor subclass definition from usb/audio.h to usb/ch9.hLaurent Pinchart2009-09-232-1/+2
| | | | | | | | USB_SUBCLASS_VENDOR_SPEC is common to several USB classes and as such belongs to usb/ch9.h. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Move endpoint sync type definitions from usb/audio.h to usb/ch9.hLaurent Pinchart2009-09-233-11/+7
| | | | | | | | And use the new definitions in the USB Audio Class gadget driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Let usb_sg_init to set transfer_buffer more oftenPete Zaitcev2009-09-231-22/+10
| | | | | | | | | | | | | | This fix permits the "new" usbmon to access usb-storage's data buffer without DMA remapping tricks. It should be compatible with PIO controllers and not add any new crashes. Note that from now on PIO controllers and usbmon are uniform in their access pattern and if one crashes then the other will too. Hopefuly neither does. As a side effect, we get rid for #ifdefs, which were a little ugly. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbmon: end ugly tricks with DMA peekingPete Zaitcev2009-09-237-142/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes crashes when usbmon attempts to access GART aperture. The old code attempted to take a bus address and convert it into a virtual address, which clearly was impossible on systems with actual IOMMUs. Let us not persist in this foolishness, and use transfer_buffer in all cases instead. I think downsides are negligible. The ones I see are: - A driver may pass an address of one buffer down as transfer_buffer, and entirely different entity mapped for DMA, resulting in misleading output of usbmon. Note, however, that PIO based controllers would do transfer the same data that usbmon sees here. - Out of tree drivers may crash usbmon if they store garbage in transfer_buffer. I inspected the in-tree drivers, and clarified the documentation in comments. - Drivers that use get_user_pages will not be possible to monitor. I only found one driver with this problem (drivers/staging/rspiusb). - Same happens with with usb_storage transferring from highmem, but it works fine on 64-bit systems, so I think it's not a concern. At least we don't crash anymore. Why didn't we do this in 2.6.10? That's because back in those days it was popular not to fill in transfer_buffer, so almost all traffic would be invisible (e.g. all of HID was like that). But now, the tree is almost 100% PIO friendly, so we can do the right thing at last. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbmon: touch up the documentationPete Zaitcev2009-09-231-1/+1
| | | | | | | | | I think this sentence was confusing regarding the possible size of the data area. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usbmon: drop Kconfig defaultsPete Zaitcev2009-09-231-3/+1
| | | | | | | | | | | | These statements seem to be unnecessary. No idea why, but I built all possible configurations and everything gets built just as before. It's an old patch that popped from discussion with Paul in November 2008. Obviously not a very high priority but better late than never. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: sisusbvga: drop usb_buffer_allocPete Zaitcev2009-09-232-42/+13
| | | | | | | | | | | | | | | | This patch falls out of my work to fix usbmon so it uses virtual addresses. It is not necessary, the "new" usbmon should work just fine with sisusbvga. However, it seems ridiculous that anyone would use uncached memory to transfer bulk data. Dropping the unnecessary use of usb_buffer_alloc should be beneficial here, in case anyone ever uses the dongle on anything beyond x86. I had no success in raising the author of the driver by e-mail, so the patch is not actually tested. Signed-off-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: ehci-dbg.c: no need for checking it before call vfreeFigo.zhang2009-09-231-2/+1
| | | | | | | | | vfree() does it's own NULL checking,so no need for check before calling it. Signed-off-by: Figo.zhang <figo1802@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Fix SS endpoint companion descriptor parsing.Sarah Sharp2009-09-231-1/+1
| | | | | | | | | | | | When there's a descriptor after the SuperSpeed endpoint companion descriptor, the previous code would have skipped over twice the length it was supposed to. This code fixes crashes seen with UASP devices (which have a UASP descriptor after the SS endpoint companion descriptor). Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: xhci: Support interrupt transfers.Sarah Sharp2009-09-233-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | Interrupt transfers are submitted to the xHCI hardware using the same TRB type as bulk transfers. Re-use the bulk transfer enqueueing code to enqueue interrupt transfers. Interrupt transfers are a bit different than bulk transfers. When the interrupt endpoint is to be serviced, the xHC will consume (at most) one TD. A TD (comprised of sg list entries) can take several service intervals to transmit. The important thing for device drivers to note is that if they use the scatter gather interface to submit interrupt requests, they will not get data sent from two different scatter gather lists in the same service interval. For now, the xHCI driver will use the service interval from the endpoint's descriptor (bInterval). Drivers will need a hook to poll at a more frequent interval. Set urb->interval to the interval that the xHCI hardware will use. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: xhci: Set -EREMOTEIO when xHC gives bad transfer length.Sarah Sharp2009-09-231-0/+9
| | | | | | | | | | | | The xHCI hardware reports the number of bytes untransferred for a given transfer buffer. If the hardware reports a bytes untransferred value greater than the submitted buffer size, we want to play it safe and say no data was transferred. If the driver considers a short packet to be an error, remember to set -EREMOTEIO. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: xhci: Check URB_SHORT_NOT_OK before setting short packet status.Sarah Sharp2009-09-231-2/+8
| | | | | | | | | Make sure that the driver that submitted the URB considers a short packet an error before setting -EREMOTEIO during a short control transfer. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: xhci: Check URB's actual transfer buffer size.Sarah Sharp2009-09-231-1/+16
| | | | | | | | | | | | | | Make sure that the amount of data the xHC says was transmitted is less than or equal to the size of the requested transfer buffer. Before, if the host controller erroneously reported that the number of bytes untransferred was bigger than the buffer in the URB, urb->actual_length could be set to a very large size. Make sure urb->actual_length <= urb->transfer_buffer_length. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: xhci: Don't touch xhci_td after it's freed.Sarah Sharp2009-09-231-1/+1
| | | | | | | | | | | On a successful transfer, urb->td is freed before the URB is ready to be given back to the driver. Don't touch urb->td after it's freed. This bug would have only shown up when xHCI debugging was turned on, and the freed memory was quickly reused for something else. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: xhci: Handle babbling endpoints correctly.Sarah Sharp2009-09-231-2/+14
| | | | | | | | | | | | | | | | | | | | The 0.95 xHCI spec says that non-control endpoints will be halted if a babble is detected on a transfer. The 0.96 xHCI spec says all types of endpoints will be halted when a babble is detected. Some hardware that claims to be 0.95 compliant halts the control endpoint anyway. When a babble is detected on a control endpoint, check the hardware's output endpoint context to see if the endpoint is marked as halted. If the control endpoint is halted, a reset endpoint command must be issued and the transfer ring dequeue pointer needs to be moved past the stopped transfer. Basically, we treat it as if the control endpoint had stalled. Handle bulk babbling endpoints as if we got a completion event with a stall completion code. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: xhci: Make TRB completion code comparison readable.Sarah Sharp2009-09-231-7/+9
| | | | | | | | | Use trb_comp_code instead of getting the completion code from the transfer event every time. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: xhci: Add quirk for Fresco Logic xHCI hardware.Sarah Sharp2009-09-234-23/+148
| | | | | | | | | | | | | | | | | | | | | | | This Fresco Logic xHCI host controller chip revision puts bad data into the output endpoint context after a Reset Endpoint command. It needs a Configure Endpoint command (instead of a Set TR Dequeue Pointer command) after the reset endpoint command. Set up the input context before issuing the Reset Endpoint command so we don't copy bad data from the output endpoint context. The HW also can't handle two commands queued at once, so submit the TRB for the Configure Endpoint command in the event handler for the Reset Endpoint command. Devices that stall on control endpoints before a configuration is selected will not work under this Fresco Logic xHCI host controller revision. This patch is for prototype hardware that will be given to other companies for evaluation purposes only, and should not reach consumer hands. Fresco Logic's next chip rev should have this bug fixed. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>