From: kuninori.morimoto.gx@renesas.com Date: Mon, 25 Jul 2011 07:39:30 +0000 (-0700) Subject: usb: add usb_endpoint_maxp() macro X-Git-Tag: next-20110823~5^2~11 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=939f325f4a0f;p=karo-tx-linux.git usb: add usb_endpoint_maxp() macro Signed-off-by: Kuninori Morimoto Signed-off-by: Greg Kroah-Hartman --- 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 @@ #define __LINUX_USB_CH9_H #include /* __u8 etc */ +#include /* le16_to_cpu */ /*-------------------------------------------------------------------------*/ @@ -570,6 +571,17 @@ static inline int usb_endpoint_is_isoc_out( return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); } +/** + * usb_endpoint_maxp - get endpoint's max packet size + * @epd: endpoint to be checked + * + * Returns @epd's max packet + */ +static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd) +{ + return le16_to_cpu(epd->wMaxPacketSize); +} + /*-------------------------------------------------------------------------*/ /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */