From e3d7440c2212497b33f0b12f5112f1a99e3f201c Mon Sep 17 00:00:00 2001 From: Vivek Gautam Date: Sat, 14 Sep 2013 14:02:44 +0530 Subject: usb: Move 'bmRequestType' USB device request macros from EHCI header Macros defining bmRequestType field of USB device request, given in table 9.2 USB 2.0 spec, are rather generic macros which can be further used by other Host controller stacks. So moving them to usb_defs header. Signed-off-by: Vivek Gautam Cc: Julius Werner Cc: Simon Glass Cc: Minkyu Kang Cc: Dan Murphy Cc: Marek Vasut --- include/usb_defs.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include/usb_defs.h') diff --git a/include/usb_defs.h b/include/usb_defs.h index 0cf5f2d..236a5ec 100644 --- a/include/usb_defs.h +++ b/include/usb_defs.h @@ -63,6 +63,25 @@ #define USB_DIR_OUT 0 #define USB_DIR_IN 0x80 +/* + * bmRequestType: USB Device Requests, table 9.2 USB 2.0 spec. + * (shifted) direction/type/recipient. + */ +#define DeviceRequest \ + ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8) + +#define DeviceOutRequest \ + ((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8) + +#define InterfaceRequest \ + ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8) + +#define EndpointRequest \ + ((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8) + +#define EndpointOutRequest \ + ((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8) + /* Descriptor types */ #define USB_DT_DEVICE 0x01 #define USB_DT_CONFIG 0x02 -- cgit v1.1