1 #ifndef LINUX_26_33_COMPAT_H
2 #define LINUX_26_33_COMPAT_H
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
8 #include <linux/skbuff.h>
9 #if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)
10 #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
11 #include <pcmcia/cs_types.h>
12 #include <pcmcia/cistpl.h>
13 #include <pcmcia/ds.h>
16 #include <linux/kfifo.h>
17 #include <linux/firmware.h>
19 #define release_firmware compat_release_firmware
20 #define request_firmware compat_request_firmware
21 #define request_firmware_nowait compat_request_firmware_nowait
23 #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
24 int compat_request_firmware(const struct firmware **fw, const char *name,
25 struct device *device);
26 int compat_request_firmware_nowait(
27 struct module *module, int uevent,
28 const char *name, struct device *device, gfp_t gfp, void *context,
29 void (*cont)(const struct firmware *fw, void *context));
31 void compat_release_firmware(const struct firmware *fw);
33 static inline int compat_request_firmware(const struct firmware **fw,
35 struct device *device)
39 static inline int request_firmware_nowait(
40 struct module *module, int uevent,
41 const char *name, struct device *device, gfp_t gfp, void *context,
42 void (*cont)(const struct firmware *fw, void *context))
47 static inline void compat_release_firmware(const struct firmware *fw)
52 #define KEY_RFKILL 247 /* Key that controls all radios */
54 #define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
55 /* source: include/linux/if.h */
57 #define kparam_block_sysfs_write(a)
58 #define kparam_unblock_sysfs_write(a)
60 /* this will never happen on older kernels */
61 #define NETDEV_POST_INIT 0xffff
63 static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
66 struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
68 if (NET_IP_ALIGN && skb)
69 skb_reserve(skb, NET_IP_ALIGN);
73 #if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)
75 #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
77 #define pcmcia_request_window(a, b, c) pcmcia_request_window(&a, b, c)
79 #define pcmcia_map_mem_page(a, b, c) pcmcia_map_mem_page(b, c)
81 /* loop over CIS entries */
82 int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
83 int (*loop_tuple) (struct pcmcia_device *p_dev,
88 #endif /* CONFIG_PCMCIA */
90 /* loop over CIS entries */
91 int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
92 cisdata_t code, cisparse_t *parse, void *priv_data,
93 int (*loop_tuple) (tuple_t *tuple,
97 #endif /* CONFIG_PCCARD */
100 * kfifo_alloc and kfifo_free must be backported manually
102 #define kfifo_in(a, b, c) __kfifo_put(*a, b, c)
103 #define kfifo_out(a, b, c) __kfifo_get(*a, b, c)
104 #define kfifo_len(a) __kfifo_len(*a)
106 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
108 #endif /* LINUX_26_33_COMPAT_H */