diff options
author | Sarah Bailey | 2006-12-23 23:14:58 -0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2007-02-07 15:44:34 -0800 |
commit | a8ef36bc0a5fe973bddaa54a5a07cda29e04a602 (patch) | |
tree | 0d17cf51d7b78f14fc066108c7704a7cd6b00479 /include | |
parent | 7ca46b862f0e30fe0dcc4a4aef5b32f6b6a3fda5 (diff) |
USB: Add usb_endpoint_xfer_control to usb.h
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/usb.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 3cb9285df2d1..1c56386de709 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -557,6 +557,18 @@ static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *e } /** + * 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 * |