1 #ifndef LINUX_26_38_COMPAT_H
2 #define LINUX_26_38_COMPAT_H
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38))
8 #include <linux/kernel.h>
9 #include <linux/skbuff.h>
11 /* rename member in struct mmc_host in include/linux/mmc/host.h */
12 #define max_segs max_hw_segs
15 /* Exponentially weighted moving average (EWMA) */
17 /* For more documentation see lib/average.c */
20 unsigned long internal;
25 extern void ewma_init(struct ewma *avg, unsigned long factor,
26 unsigned long weight);
28 extern struct ewma *ewma_add(struct ewma *avg, unsigned long val);
31 * ewma_read() - Get average value
32 * @avg: Average structure
34 * Returns the average value held in @avg.
36 static inline unsigned long ewma_read(const struct ewma *avg)
38 return DIV_ROUND_CLOSEST(avg->internal, avg->factor);
41 #define pr_warn pr_warning
42 #define create_freezable_workqueue create_freezeable_workqueue
44 static inline int skb_checksum_start_offset(const struct sk_buff *skb)
46 return skb->csum_start - skb_headroom(skb);
49 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) */
51 #endif /* LINUX_26_38_COMPAT_H */