diff options
Diffstat (limited to 'include/linux/usb/ch9.h')
-rw-r--r-- | include/linux/usb/ch9.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 0fd3fbdd8283..f32a64e57f97 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #define __LINUX_USB_CH9_H | 34 | #define __LINUX_USB_CH9_H |
35 | 35 | ||
36 | #include <linux/types.h> /* __u8 etc */ | 36 | #include <linux/types.h> /* __u8 etc */ |
37 | #include <asm/byteorder.h> /* le16_to_cpu */ | ||
37 | 38 | ||
38 | /*-------------------------------------------------------------------------*/ | 39 | /*-------------------------------------------------------------------------*/ |
39 | 40 | ||
@@ -143,6 +144,11 @@ | |||
143 | #define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */ | 144 | #define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */ |
144 | 145 | ||
145 | #define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00 | 146 | #define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00 |
147 | /* | ||
148 | * Suspend Options, Table 9-7 USB 3.0 spec | ||
149 | */ | ||
150 | #define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0)) | ||
151 | #define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1)) | ||
146 | 152 | ||
147 | #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ | 153 | #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ |
148 | 154 | ||
@@ -570,6 +576,17 @@ static inline int usb_endpoint_is_isoc_out( | |||
570 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); | 576 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); |
571 | } | 577 | } |
572 | 578 | ||
579 | /** | ||
580 | * usb_endpoint_maxp - get endpoint's max packet size | ||
581 | * @epd: endpoint to be checked | ||
582 | * | ||
583 | * Returns @epd's max packet | ||
584 | */ | ||
585 | static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd) | ||
586 | { | ||
587 | return le16_to_cpu(epd->wMaxPacketSize); | ||
588 | } | ||
589 | |||
573 | /*-------------------------------------------------------------------------*/ | 590 | /*-------------------------------------------------------------------------*/ |
574 | 591 | ||
575 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ | 592 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ |
@@ -851,6 +868,18 @@ enum usb_device_speed { | |||
851 | USB_SPEED_SUPER, /* usb 3.0 */ | 868 | USB_SPEED_SUPER, /* usb 3.0 */ |
852 | }; | 869 | }; |
853 | 870 | ||
871 | #ifdef __KERNEL__ | ||
872 | |||
873 | /** | ||
874 | * usb_speed_string() - Returns human readable-name of the speed. | ||
875 | * @speed: The speed to return human-readable name for. If it's not | ||
876 | * any of the speeds defined in usb_device_speed enum, string for | ||
877 | * USB_SPEED_UNKNOWN will be returned. | ||
878 | */ | ||
879 | extern const char *usb_speed_string(enum usb_device_speed speed); | ||
880 | |||
881 | #endif | ||
882 | |||
854 | enum usb_device_state { | 883 | enum usb_device_state { |
855 | /* NOTATTACHED isn't in the USB spec, and this state acts | 884 | /* NOTATTACHED isn't in the USB spec, and this state acts |
856 | * the same as ATTACHED ... but it's clearer this way. | 885 | * the same as ATTACHED ... but it's clearer this way. |