1 #ifndef LINUX_3_3_COMPAT_H
2 #define LINUX_3_3_COMPAT_H
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
8 /* include to override NL80211_FEATURE_SK_TX_STATUS */
9 #include <linux/nl80211.h>
10 #include <linux/skbuff.h>
11 #include <net/sch_generic.h>
13 #if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,9) && LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,23) && LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)))
14 /* mask qdisc_cb_private_validate as RHEL6.3 backports it */
15 #define qdisc_cb_private_validate(a, b) compat_qdisc_cb_private_validate(a, b)
16 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37))
17 static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
19 BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct qdisc_skb_cb) + sz);
22 static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
29 #define __pskb_copy LINUX_BACKPORT(__pskb_copy)
30 extern struct sk_buff *__pskb_copy(struct sk_buff *skb,
31 int headroom, gfp_t gfp_mask);
33 #define NL80211_FEATURE_SK_TX_STATUS 0
35 #ifndef CONFIG_COMPAT_NETDEV_FEATURES
36 typedef u32 netdev_features_t;
37 #endif /* CONFIG_COMPAT_NETDEV_FEATURES */
40 /* source include/linux/device.h */
42 * module_driver() - Helper macro for drivers that don't do anything
43 * special in module init/exit. This eliminates a lot of boilerplate.
44 * Each module may only use this macro once, and calling it replaces
45 * module_init() and module_exit().
47 * Use this macro to construct bus specific macros for registering
48 * drivers, and do not use it on its own.
50 #define module_driver(__driver, __register, __unregister) \
51 static int __init __driver##_init(void) \
53 return __register(&(__driver)); \
55 module_init(__driver##_init); \
56 static void __exit __driver##_exit(void) \
58 __unregister(&(__driver)); \
60 module_exit(__driver##_exit);
63 /* source include/linux/usb.h */
65 * module_usb_driver() - Helper macro for registering a USB driver
66 * @__usb_driver: usb_driver struct
68 * Helper macro for USB drivers which do not do anything special in module
69 * init/exit. This eliminates a lot of boilerplate. Each module may only
70 * use this macro once, and calling it replaces module_init() and module_exit()
72 #define module_usb_driver(__usb_driver) \
73 module_driver(__usb_driver, usb_register, \
76 #define netdev_tx_sent_queue LINUX_BACKPORT(netdev_tx_sent_queue)
77 static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
82 #define netdev_tx_completed_queue LINUX_BACKPORT(netdev_tx_completed_queue)
83 static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
84 unsigned pkts, unsigned bytes)
88 #define netdev_tx_reset_queue LINUX_BACKPORT(netdev_tx_reset_queue)
89 static inline void netdev_tx_reset_queue(struct netdev_queue *q)
92 clear_bit(__QUEUE_STATE_STACK_XOFF, &q->state);
97 #define NETIF_F_LOOPBACK (1 << 31) /* Enable loopback */
99 #ifndef NETIF_F_RXCSUM
100 #define NETIF_F_RXCSUM (1 << 29)
103 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
105 #endif /* LINUX_3_3_COMPAT_H */