diff options
author | kuninori.morimoto.gx@renesas.com <kuninori.morimoto.gx@renesas.com> | 2011-07-25 03:39:30 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-22 18:54:38 -0400 |
commit | 939f325f4a0fb7eb189268a4593e427d3a075514 (patch) | |
tree | 73b3f857401af0339979f8260bcafa667726ca4c /include/linux/usb | |
parent | 23106343db66171c94ae486d2035478ec575b228 (diff) |
usb: add usb_endpoint_maxp() macro
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/ch9.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index 0fd3fbdd8283..e809deabf503 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 | ||
@@ -570,6 +571,17 @@ static inline int usb_endpoint_is_isoc_out( | |||
570 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); | 571 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); |
571 | } | 572 | } |
572 | 573 | ||
574 | /** | ||
575 | * usb_endpoint_maxp - get endpoint's max packet size | ||
576 | * @epd: endpoint to be checked | ||
577 | * | ||
578 | * Returns @epd's max packet | ||
579 | */ | ||
580 | static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd) | ||
581 | { | ||
582 | return le16_to_cpu(epd->wMaxPacketSize); | ||
583 | } | ||
584 | |||
573 | /*-------------------------------------------------------------------------*/ | 585 | /*-------------------------------------------------------------------------*/ |
574 | 586 | ||
575 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ | 587 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ |