1 #ifndef LINUX_26_25_COMPAT_H
2 #define LINUX_26_25_COMPAT_H
4 #include <linux/autoconf.h>
5 #include <linux/version.h>
7 /* Compat work for 2.6.24 */
8 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
10 #include <linux/types.h>
12 #include <linux/hw_random.h>
13 #include <linux/leds.h>
14 #include <linux/kernel.h>
15 #include <linux/netdevice.h>
16 #include <asm-generic/bug.h>
18 #define __WARN(foo) dump_stack()
20 #define dev_emerg(dev, format, arg...) \
21 dev_printk(KERN_EMERG , dev , format , ## arg)
22 #define dev_alert(dev, format, arg...) \
23 dev_printk(KERN_ALERT , dev , format , ## arg)
24 #define dev_crit(dev, format, arg...) \
25 dev_printk(KERN_CRIT , dev , format , ## arg)
27 extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
28 extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
30 #define seq_file_net &init_net;
33 NF_INET_PRE_ROUTING = 0,
36 NF_INET_LOCAL_OUT = 3,
37 NF_INET_POST_ROUTING = 4,
42 * commit 8b5f6883683c91ad7e1af32b7ceeb604d68e2865
43 * Author: Marcin Slusarz <marcin.slusarz@gmail.com>
44 * Date: Fri Feb 8 04:20:12 2008 -0800
46 * byteorder: move le32_add_cpu & friends from OCFS2 to core
48 * moves le*_add_cpu and be*_add_cpu functions from OCFS2 to core
49 * header (1st) and converted some existing code to it. We port
50 * it here as later kernels will most likely use it.
52 static inline void le16_add_cpu(__le16 *var, u16 val)
54 *var = cpu_to_le16(le16_to_cpu(*var) + val);
57 static inline void le32_add_cpu(__le32 *var, u32 val)
59 *var = cpu_to_le32(le32_to_cpu(*var) + val);
62 static inline void le64_add_cpu(__le64 *var, u64 val)
64 *var = cpu_to_le64(le64_to_cpu(*var) + val);
67 static inline void be16_add_cpu(__be16 *var, u16 val)
69 u16 v = be16_to_cpu(*var);
70 *var = cpu_to_be16(v + val);
73 static inline void be32_add_cpu(__be32 *var, u32 val)
75 u32 v = be32_to_cpu(*var);
76 *var = cpu_to_be32(v + val);
79 static inline void be64_add_cpu(__be64 *var, u64 val)
81 u64 v = be64_to_cpu(*var);
82 *var = cpu_to_be64(v + val);
85 /* 2.6.25 changes hwrng_unregister()'s behaviour by supporting
86 * suspend of its parent device (the misc device, which is itself the
87 * hardware random number generator). It does this by passing a parameter to
88 * unregister_miscdev() which is not supported in older kernels. The suspend
89 * parameter allows us to enable access to the device's hardware
90 * number generator during suspend. As far as wireless is concerned this means
91 * if a driver goes to suspend it you won't have the HNR available in
93 static inline void __hwrng_unregister(struct hwrng *rng, bool suspended)
95 hwrng_unregister(rng);
98 static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
100 led_classdev_unregister(lcd);
104 * The following things are out of ./include/linux/kernel.h
105 * The new iwlwifi driver is using them.
107 extern int strict_strtoul(const char *, unsigned int, unsigned long *);
108 extern int strict_strtol(const char *, unsigned int, long *);
110 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) */
112 #endif /* LINUX_26_25_COMPAT_H */