Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sarah Bailey and committed by
Greg Kroah-Hartman
a8ef36bc 7ca46b86

+12
+12
include/linux/usb.h
··· 557 557 } 558 558 559 559 /** 560 + * usb_endpoint_xfer_control - check if the endpoint has control transfer type 561 + * @epd: endpoint to be checked 562 + * 563 + * Returns true if the endpoint is of type control, otherwise it returns false. 564 + */ 565 + static inline int usb_endpoint_xfer_control(const struct usb_endpoint_descriptor *epd) 566 + { 567 + return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == 568 + USB_ENDPOINT_XFER_CONTROL); 569 + } 570 + 571 + /** 560 572 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type 561 573 * @epd: endpoint to be checked 562 574 *