summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/urb.c
Commit message (Collapse)AuthorAgeFilesLines
* USB: remove err() macro from usb core codeGreg Kroah-Hartman2008-10-171-2/+2
| | | | | | | | | USB should not be having it's own printk macros, so remove err() and use the system-wide standard of dev_err() wherever possible. In the few places that will not work out, use a basic printk(). Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: anchor API changes needed for btusbOliver Neukum2008-10-171-0/+70
| | | | | | | | | This extends the anchor API as btusb needs for autosuspend. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: extend poisoning to anchorsOliver Neukum2008-10-171-9/+48
| | | | | | | | | this extends the poisoning concept to anchors. This way poisoning will work with fire and forget drivers. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: kill URBs permanentlyOliver Neukum2008-10-171-6/+50
| | | | | | | | | | | | looking at usb_kill_urb() it seems to me that it is unnecessarily lenient. In the use case of disconnect() you never want to use the URB again (for the same device) But leaving urb->reject elevated will make it easier to avoid races between read/write and disconnect. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: fix bug in usb_unlink_anchored_urbs()Oliver Neukum2008-08-211-2/+7
| | | | | | | | | Irqs must not accidentally be reenabled. Signed-off-by: Oliver Neukum <oneukum@suse.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-251-1/+1
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: add extension of anchor API, usb_unlink_anchored_urbsOliver Neukum2008-04-251-0/+24
| | | | | | | | | | 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>
* USB: fix codingstyle issues in drivers/usb/core/*.cGreg Kroah-Hartman2008-02-011-10/+12
| | | | | | | Fixes a number of coding style issues in the remaining .c files in drivers/usb/core/ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: mark USB drivers as being GPL onlyGreg Kroah-Hartman2008-02-011-8/+7Star
| | | | | | | | | | | | Over two years ago, the Linux USB developers stated that they believed there was no way to create a USB kernel driver that was not under the GPL. This patch moves the USB apis to enforce that decision. There are no known closed source USB drivers in the wild, so this patch should cause no problems. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: add URB_FREE_BUFFER to permissible flagsOliver Neukum2007-10-251-1/+1
| | | | | | | | | | | | | URB_FREE_BUFFER needs to be allowed in the sanity checks to use drivers that use that flag. Signed-off-by: Oliver Neukum <oneukum@suse.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: flush outstanding URBs when suspendingAlan Stern2007-10-121-3/+0Star
| | | | | | | | | | | | | | | | | | | | This patch (as989) makes usbcore flush all outstanding URBs for each device as the device is suspended. This will be true even when CONFIG_USB_SUSPEND is not enabled. In addition, an extra can_submit flag is added to the usb_device structure. That flag will be turned off whenever a suspend request has been received for the device, even if the device isn't actually suspended because CONFIG_USB_SUSPEND isn't set. It's no longer necessary to check for the device state being equal to USB_STATE_SUSPENDED during URB submission; that check can be replaced by a check of the can_submit flag. This also permits us to remove some questionable references to the deprecated power.power_state field. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: get rid of urb->lockAlan Stern2007-10-121-5/+6
| | | | | | | | | | | Now that urb->status isn't used, urb->lock doesn't protect anything. This patch (as980) removes it and replaces it with a private mutex in the one remaining place it was still used: usb_kill_urb. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: cleanup for previous patchesAlan Stern2007-10-121-6/+7
| | | | | | | | | | | | | | | This patch (as951) cleans up a few loose ends from earlier patches. Redundant checks for non-NULL urb->dev are removed, as are checks of urb->dev->bus (which can never be NULL). Conversely, a check for non-NULL urb->ep is added to the unlink paths. A homegrown round-down-to-power-of-2 loop is simplified by using the ilog2 routine. The comparison in usb_urb_dir_in() is made more transparent. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: address-0 handling during device initializationAlan Stern2007-10-121-3/+1Star
| | | | | | | | | | | | This patch (as947) changes the device initialization and enumeration code in hub.c; now udev->devnum will be set to 0 while the device is being accessed at address 0. Until now this wasn't needed because the address value was passed as part of urb->pipe; without that field the device address must be stored elsewhere. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: add direction bit to urb->transfer_flagsAlan Stern2007-10-121-2/+16
| | | | | | | | | | | | | | | | | | This patch (as945) adds a bit to urb->transfer_flags for recording the direction of the URB. The bit is set/cleared automatically in usb_submit_urb() so drivers don't have to worry about it (although as a result, it isn't valid until the URB has been submitted). Inline routines are added for easily checking an URB's direction. They replace calls to usb_pipein in the DMA-mapping parts of hcd.c. For non-control endpoints, the direction is determined directly from the endpoint descriptor. However control endpoints are bi-directional; for them the direction is determined from the bRequestType byte and the wLength value in the setup packet. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: add urb->epAlan Stern2007-10-121-30/+35
| | | | | | | | | | | | | | | | | | | This patch (as943) prepares the way for eliminating urb->pipe by introducing an endpoint pointer into struct urb. For now urb->ep is set by usb_submit_urb() from the pipe value; eventually drivers will set it themselves and we will remove urb->pipe completely. The patch also adds new inline routines to retrieve an endpoint descriptor's number and transfer type, essentially as replacements for usb_pipeendpoint and usb_pipetype. usb_submit_urb(), usb_hcd_submit_urb(), and usb_hcd_unlink_urb() are converted to use the new field and new routines. Other parts of usbcore will be converted in later patches. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: documentation update for usb_unlink_urbAlan Stern2007-07-201-43/+45
| | | | | | | | | | This patch (as936) updates the kerneldoc for usb_unlink_urb. The explanation of how endpoint queues are meant to work is now clearer and in better agreement with reality. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Add URB_FREE_BUFFER flag and the logic behind itMarcel Holtmann2007-07-131-0/+3
| | | | | | | | | | | | | | USB: Add URB_FREE_BUFFER flag for freeing the transfer buffer In some cases it is not needed that the driver keeps track of the transfer buffer of an URB. It can be simply freed along with the URB itself when the reference count goes down to zero. The new flag URB_FREE_BUFFER enables this behavior. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: introduce usb_anchorOliver Neukum2007-07-131-3/+99
| | | | | | | | - introduction of usb_anchor and its methods Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usbcore: trivial whitespace fixesOliver Neukum2007-02-081-10/+10
| | | | | | | | | | | This patch (as844) makes some trivial whitespace fixes to a few files in usbcore. Oliver did most of the work and Alan added some tidying up. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usbcore: remove unused bandwith-related codeAlan Stern2007-02-081-1/+0Star
| | | | | | | | | | | | | | This patch (as841) removes from usbcore a couple of support routines meant to help with bandwidth allocation. With the changes to uhci-hcd in the previous patch, these routines are no longer used anywhere. Also removed is the CONFIG_USB_BANDWIDTH option; it no longer does anything and is no longer needed since the HCDs now handle bandwidth issues correctly. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Remove unneeded void * casts in core filesTobias Klauser2006-09-271-1/+1
| | | | | | | | | | | | | | The patch removes unneeded casts for the following (void *) pointers: - struct file: private - struct urb: context - struct usb_bus: hcpriv - return value of kmalloc() The patch also contains some whitespace cleanup in the relevant areas. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: remove struct usb_operationsAlan Stern2006-09-271-8/+5Star
| | | | | | | | | | | | | | | All of the currently-supported USB host controller drivers use the HCD bus-glue framework. As part of the program for flattening out the glue layer, this patch (as769) removes the usb_operations structure. All function calls now go directly to the HCD routines (slightly renamed to remain within the "usb_" namespace). The patch also removes usb_alloc_bus(), because it's not useful in the HCD framework and it wasn't referenced anywhere. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Remove obsolete #include <linux/config.h>Jörn Engel2006-06-301-1/+0Star
| | | | | Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
* [PATCH] USB: add might_sleep() to usb_unlink_urb() to warn developersGreg Kroah-Hartman2006-02-011-0/+1
| | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] USB: move CONFIG_USB_DEBUG checks into the MakefileGreg Kroah-Hartman2005-11-171-6/+0Star
| | | | | | | | | This lets us remove a lot of code in the drivers that were all checking the same thing. It also found some bugs in a few of the drivers, which has been fixed up. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] updates for "controller suspended" handlingDavid Brownell2005-10-291-1/+2
| | | | | | | | | | | | | | Reject URBs to _all_ devices when their host controllers are suspended; even root hub registers will be unavailable. Also, don't reject urbs to root hubs in other cases; the only upstream link is through that controller (on PCI or whatever SOC bus is in use). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/usb/core/hcd.c | 28 ++++++++++++---------------- drivers/usb/core/urb.c | 3 ++- 2 files changed, 14 insertions(+), 17 deletions(-)
* [PATCH] gfp_t: drivers/usbAl Viro2005-10-281-2/+2
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] USB: URB_ASYNC_UNLINK flag removed from the kernelAlan Stern2005-09-091-22/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 29 July 2005, Cambridge, MA: This afternoon Alan Stern submitted a patch to remove the URB_ASYNC_UNLINK flag from the Linux kernel. Mr. Stern explained, "This flag is a relic from an earlier, less-well-designed system. For over a year it hasn't been used for anything other than printing warning messages." An anonymous spokesman for the Linux kernel development community commented, "This is exactly the sort of thing we see happening all the time. As the kernel evolves, support for old techniques and old code can be jettisoned and replaced by newer, better approaches. Proprietary operating systems do not have the freedom or flexibility to change so quickly." Mr. Stern, a staff member at Harvard University's Rowland Institute who works on Linux only as a hobby, noted that the patch (labelled as548) did not update two files, keyspan.c and option.c, in the USB drivers' "serial" subdirectory. "Those files need more extensive changes," he remarked. "They examine the status field of several URBs at times when they're not supposed to. That will need to be fixed before the URB_ASYNC_UNLINK flag is removed." Greg Kroah-Hartman, the kernel maintainer responsible for overseeing all of Linux's USB drivers, did not respond to our inquiries or return our calls. His only comment was "Applied, thanks." Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] USB: Fix kmalloc's flags type in USBOlav Kongas2005-07-121-2/+2
| | | | | | | | | | | | | Greg, This patch fixes the kmalloc() flags argument type in USB subsystem; hopefully all of its occurences. The patch was made against patch-2.6.12-git2 from Jun 20. Cleanup of flags for kmalloc() in USB subsystem. Signed-off-by: Olav Kongas <ok@artecdesign.ee> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] USB: Spelling fixes for drivers/usb.Steven Cole2005-05-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here are some spelling corrections for drivers/usb. cancelation -> cancellation succesful -> successful cancelation -> cancellation decriptor -> descriptor Initalize -> Initialize wierd -> weird Protocoll -> Protocol occured -> occurred successfull -> successful Procesing -> Processing devide -> divide Isochronuous -> Isochronous noticable -> noticeable Basicly -> Basically transfering -> transferring intialize -> initialize Incomming -> Incoming additionnal -> additional asume -> assume Unfortunatly -> Unfortunately retreive -> retrieve tranceiver -> transceiver Compatiblity -> Compatibility Incorprated -> Incorporated existance -> existence Ununsual -> Unusual Signed-off-by: Steven Cole <elenstev@mesatop.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] USB: USB API documentation modificationAlan Stern2005-04-191-6/+10
| | | | | | | | | | | | In response to complaints about excessive latency in the uhci-hcd driver I'm planning to convert it to a top-half/bottom-half design. It turns out that to do this, the USB API has to be modified slightly since the driver will not be able to meet one of the guarantees in the current API. This patch changes some kerneldoc, specifying the weaker guarantee. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Linux-2.6.12-rc2Linus Torvalds2005-04-171-0/+511
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!