summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/endpoint.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: convert endpoint devices to bus-less childs of the usb interfaceKay Sievers2009-06-151-152/+8
| | | | | | | | | | | | | The endpoint devices look like simple attribute groups now, and no longer like devices with a specific subsystem. They will also no longer emit uevents. It also removes the device node requests for endpoint devices, which are not implemented for now. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: drivers: use USB API functions rather than constantsJulia Lawall2009-03-241-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This set of patches introduces calls to the following set of functions: usb_endpoint_dir_in(epd) usb_endpoint_dir_out(epd) usb_endpoint_is_bulk_in(epd) usb_endpoint_is_bulk_out(epd) usb_endpoint_is_int_in(epd) usb_endpoint_is_int_out(epd) usb_endpoint_num(epd) usb_endpoint_type(epd) usb_endpoint_xfer_bulk(epd) usb_endpoint_xfer_control(epd) usb_endpoint_xfer_int(epd) usb_endpoint_xfer_isoc(epd) In some cases, introducing one of these functions is not possible, and it just replaces an explicit integer value by one of the following constants: USB_ENDPOINT_XFER_BULK USB_ENDPOINT_XFER_CONTROL USB_ENDPOINT_XFER_INT USB_ENDPOINT_XFER_ISOC An extract of the semantic patch that makes these changes is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r1@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) == - \(USB_ENDPOINT_XFER_CONTROL\|0\)) + usb_endpoint_xfer_control(epd) @r5@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) == - \(USB_DIR_IN\|0x80\)) + usb_endpoint_dir_in(epd) @inc@ @@ #include <linux/usb.h> @depends on !inc && (r1||r5)@ @@ + #include <linux/usb.h> #include <linux/usb/...> // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: utilize the bus notifiersAlan Stern2009-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | This patch (as1185) makes usbcore take advantage of the bus notifications sent out by the driver core. Now we can create all our device and interface attribute files before the device or interface uevent is broadcast. A side effect is that we no longer create the endpoint "pseudo" devices at the same time as a device or interface is registered -- it seems like a bad idea to try registering an endpoint before the registration of its parent is complete. So the routines for creating and removing endpoint devices have been split out and renamed, and they are called explicitly when needed. A new bitflag is used for keeping track of whether or not the interface's endpoint devices have been created, since (just as with the interface attributes) they vary with the altsetting and hence can be changed at random times. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: remove err() macro from usb core codeGreg Kroah-Hartman2008-10-171-1/+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: usb dev_set_name() instead of dev->bus_idKay Sievers2008-07-211-1/+1
| | | | | | | | | The bus_id field is going away, use the dev_set_name() function to set it properly. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: usb dev_name() instead of dev->bus_idKay Sievers2008-07-211-1/+1
| | | | | | | | The bus_id field is going away, use the dev_name() function instead. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: create attributes before sending ueventAlan Stern2008-05-141-6/+5
| | | | | | | | | | | | | | | | | This patch (as1087d) fixes a long-standing problem in usbcore: Device, interface, and endpoint attributes aren't added until _after_ the creation uevent has already been broadcast. Unfortunately there are a few attributes which cannot be created that early. The "descriptors" attribute is binary and so must be created separately. The power-management attributes can't be created until the dev/power/ group exists. And the interface string can vary from one altsetting to another, so it has to be created dynamically. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Add missing newlines to some uses of dev_<level> messagesJoe Perches2007-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found these while looking at printk uses. Add missing newlines to dev_<level> uses Add missing KERN_<level> prefixes to multiline dev_<level>s Fixed a wierd->weird spelling typo Added a newline to a printk Signed-off-by: Joe Perches <joe@perches.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Roland Dreier <rolandd@cisco.com> Cc: Tilman Schmidt <tilman@imap.cc> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jeff Garzik <jeff@garzik.org> Cc: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Greg KH <greg@kroah.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Cc: James Smart <James.Smart@Emulex.Com> Cc: Andrew Vasquez <andrew.vasquez@qlogic.com> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Jaroslav Kysela <perex@suse.cz> Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* USB: Get rid of annoying endpoint-release messageAlan Stern2007-10-121-1/+0
| | | | | | | | | This patch (as990) removes an annoying debugging message. Nobody really cares when endpoint pseudo-devices are released. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: In init_endpoint_class, use PTR_ERR to obtain an errno value, not IS_ERRJosh Triplett2007-02-161-1/+1
| | | | | | | | | | init_endpoint_class calls class_create, and checks the result for an error with IS_ERR; however, if true, it then returns the result of IS_ERR (a boolean) rather than PTR_ERR (the actual errno). Signed-off-by: Josh Triplett <josh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: Fixed bug in endpoint release function.Sarah Bailey2007-01-051-1/+1
| | | | | | | | | Error handling in usb_create_ep_files() is not correct unless the minor number is freed in ep_device_release(). Signed-off-by: Sarah Bailey <saharabeara@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: added dynamic major number for USB endpointsSarah Bailey2006-12-011-13/+85
| | | | | | | | | | | | | This patch is an update for Greg K-H's proposed usbfs2: http://sourceforge.net/mailarchive/message.php?msg_id=19295229 It creates a dynamic major for USB endpoints and fixes the endpoint minor calculation. Signed-off-by: Sarah Bailey <saharabeara@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usbcore: fix endpoint device creationAlan Stern2006-10-171-10/+8
| | | | | | | | | This patch (as800) straightens out the USB endpoint class device creation routine, fixing a refcount bug in the process. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* usbcore: fix refcount bug in endpoint removalAlan Stern2006-10-171-3/+1
| | | | | | | | This patch (as799) fixes a nasty refcount error in the USB endpoint class. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* USB: fix __must_check warnings in drivers/usb/core/Greg Kroah-Hartman2006-09-271-8/+22
| | | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] USB: make endpoints real struct devicesGreg Kroah-Hartman2006-06-211-88/+150
| | | | | | | | This will allow for us to give endpoints a major/minor to create a "usbfs2-like" way to access endpoints directly from userspace in an easier manner than the current usbfs provides us. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] USB: make usb_create_ep_files take a struct deviceGreg Kroah-Hartman2006-06-211-2/+2
| | | | | | | Instead of a kobject, will make things easier in the future (don't know what I was thinking when I did this originally...) Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] USB: move the endpoint specific sysfs code to it's own fileGreg Kroah-Hartman2006-06-211-0/+213
This makes it easier to modify in the future without touching anything else. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud