]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
USB: Add usb_endpoint_xfer_control to usb.h
authorSarah Bailey <saharabeara@gmail.com>
Sun, 24 Dec 2006 07:14:58 +0000 (23:14 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 7 Feb 2007 23:44:34 +0000 (15:44 -0800)
Added a function to check if an endpoint is a control endpoint.
There were similar functions for bulk, interrupt, and isoc,
but not for control endpoints.

Signed-off-by: Sarah Bailey <saharabeara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/linux/usb.h

index 3cb9285df2d1e2874ffde417a9a33a0c768fd196..1c56386de70981960a09ef4ff389ab47eda2de7d 100644 (file)
@@ -556,6 +556,18 @@ static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *e
                USB_ENDPOINT_XFER_BULK);
 }
 
+/**
+ * usb_endpoint_xfer_control - check if the endpoint has control transfer type
+ * @epd: endpoint to be checked
+ *
+ * Returns true if the endpoint is of type control, otherwise it returns false.
+ */
+static inline int usb_endpoint_xfer_control(const struct usb_endpoint_descriptor *epd)
+{
+       return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+               USB_ENDPOINT_XFER_CONTROL);
+}
+
 /**
  * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
  * @epd: endpoint to be checked