1 #ifndef LINUX_26_29_COMPAT_H
2 #define LINUX_26_29_COMPAT_H
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
8 #include <linux/netdevice.h>
9 #include <linux/skbuff.h>
10 #include <linux/usb.h>
13 * skb_queue_is_first - check if skb is the first entry in the queue
17 * Returns true if @skb is the first buffer on the list.
19 static inline bool skb_queue_is_first(const struct sk_buff_head *list,
20 const struct sk_buff *skb)
22 return (skb->prev == (struct sk_buff *) list);
26 * skb_queue_prev - return the prev packet in the queue
28 * @skb: current buffer
30 * Return the prev packet in @list before @skb. It is only valid to
31 * call this if skb_queue_is_first() evaluates to false.
33 static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list,
34 const struct sk_buff *skb)
36 /* This BUG_ON may seem severe, but if we just return then we
37 * are going to dereference garbage.
39 BUG_ON(skb_queue_is_first(list, skb));
44 static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
46 return dev->get_stats(dev);
49 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
50 #if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
51 extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
52 #endif /* CONFIG_USB */
55 #define DIV_ROUND_CLOSEST(x, divisor)( \
57 typeof(divisor) __divisor = divisor; \
58 (((x) + ((__divisor) / 2)) / (__divisor)); \
62 extern int eth_mac_addr(struct net_device *dev, void *p);
64 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
66 #endif /* LINUX_26_29_COMPAT_H */