1 #ifndef LINUX_26_35_COMPAT_H
2 #define LINUX_26_35_COMPAT_H
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
7 #include <linux/etherdevice.h>
9 #include <linux/types.h>
10 #include <linux/usb.h>
12 /* added on linux/kernel.h */
13 #define USHRT_MAX ((u16)(~0U))
14 #define SHRT_MAX ((s16)(USHRT_MAX>>1))
15 #define SHRT_MIN ((s16)(-SHRT_MAX - 1))
17 #define SDIO_BUS_ECSI 0x20 /* Enable continuous SPI interrupt */
18 #define SDIO_BUS_SCSI 0x40 /* Support continuous SPI interrupt */
20 static inline wait_queue_head_t *sk_sleep(struct sock *sk)
25 #define sdio_writeb_readb(func, write_byte, addr, err_ret) sdio_readb(func, addr, err_ret)
27 /* mask hex_to_bin as RHEL6 backports this */
28 #define hex_to_bin(a) compat_hex_to_bin(a)
30 int hex_to_bin(char ch);
32 extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
34 #define pm_qos_request(_qos) pm_qos_requirement(_qos)
36 static inline struct usb_host_endpoint *
37 usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe)
39 struct usb_host_endpoint **eps;
40 eps = usb_pipein(pipe) ? dev->ep_in : dev->ep_out;
41 return eps[usb_pipeendpoint(pipe)];
44 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */
46 #endif /* LINUX_26_35_COMPAT_H */