]> git.openfabrics.org - ~emulex/for-vlad/compat.git/commitdiff
compat: backport usb_pipe_endpoint()
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 21 Feb 2011 22:32:22 +0000 (14:32 -0800)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 22 Feb 2011 20:53:26 +0000 (12:53 -0800)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
include/linux/compat-2.6.35.h

index c4de169366009169bfea05e097e657ac82a77286..857a5217eddfd91881d03ac6d9d81f090b645d5a 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/etherdevice.h>
 #include <net/sock.h>
 #include <linux/types.h>
+#include <linux/usb.h>
 
 /* added on linux/kernel.h */
 #define USHRT_MAX      ((u16)(~0U))
@@ -31,6 +32,14 @@ extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
 
 #define pm_qos_request(_qos) pm_qos_requirement(_qos)
 
+static inline struct usb_host_endpoint *
+usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe)
+{
+       struct usb_host_endpoint **eps;
+       eps = usb_pipein(pipe) ? dev->ep_in : dev->ep_out;
+       return eps[usb_pipeendpoint(pipe)];
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */
 
 #endif /* LINUX_26_35_COMPAT_H */