[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-backports
Subject: [RFC 5/8] backports: add usb_endpoint_maxp()
From: Patrick Ziegler <patrick.ziegler () fh-kl ! de>
Date: 2013-07-30 11:50:48
Message-ID: 51F7A898.1090105 () fh-kl ! de
[Download RAW message or body]
This function is missing for kernel version < 3.2 but required by uvc_video
and cdc-wdm device drivers.
Signed-off-by: Patrick Ziegler <patrick.ziegler@fh-kl.de>
---
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 0000000..252a6f1
--- /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 <linux/usb/ch9.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+#include <linux/types.h> /* __u8 etc */
+#include <asm/byteorder.h> /* 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 */
--
1.8.1.2
--
Dipl.-Inf. (FH) Patrick Ziegler
University Of Applied Sciences
Kaiserslautern
Amerikastrasse 1
D-66482 Zweibruecken
Germany
Phone: +49 631 3724 5526
Mail: patrick.ziegler@fh-kl.de
PGP KeyID 0xB4796B8C
http://www.fh-kl.de
http://www.fh-kl.de/fachbereiche/imst/iuk-knowhow.html
--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic