From d49194bd038d1d9d9f4c3c321c7736bd0cd2a107 Mon Sep 17 00:00:00 2001 From: Patrick Ziegler Date: Thu, 15 Aug 2013 14:40:26 +0200 Subject: [PATCH] backports: add usb_endpoint_maxp() This function is missing for kernel version < 3.2 but required by uvc_video and cdc-wdm device drivers. Signed-off-by: Patrick Ziegler Signed-off-by: Luis R. Rodriguez --- backport/backport-include/linux/usb/ch9.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 backport/backport-include/linux/usb/ch9.h diff --git a/backport/backport-include/linux/usb/ch9.h b/backport/backport-include/linux/usb/ch9.h new file mode 100644 index 000000000000..252a6f1f51d9 --- /dev/null +++ b/backport/backport-include/linux/usb/ch9.h @@ -0,0 +1,23 @@ +#ifndef __BACKPORT__LINUX_USB_CH9_H +#define __BACKPORT__LINUX_USB_CH9_H + +#include_next +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0) +#include /* __u8 etc */ +#include /* le16_to_cpu */ + +/** + * 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); +} +#endif /* < 3.2 */ + +#endif /* __BACKPORT__LINUX_USB_CH9_H */ -- 2.30.2