From saharabeara@gmail.com Wed Jan 3 16:38:24 2007 Date: Sat, 23 Dec 2006 23:14:58 -0800 From: Sarah Bailey To: greg@kroah.com Cc: linux-usb-devel@lists.sourceforge.net Subject: USB: Add usb_endpoint_xfer_control to usb.h Message-ID: <20061224071458.GA1228@localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Signed-off-by: Greg Kroah-Hartman --- include/linux/usb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- gregkh-2.6.orig/include/linux/usb.h +++ gregkh-2.6/include/linux/usb.h @@ -557,6 +557,18 @@ static inline int 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 *