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 IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
53 /* source: include/linux/if.h */
55 #define kparam_block_sysfs_write(a)
56 #define kparam_unblock_sysfs_write(a)
58 /* this will never happen on older kernels */
59 #define NETDEV_POST_INIT 0xffff
61 static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
64 struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
66 if (NET_IP_ALIGN && skb)
67 skb_reserve(skb, NET_IP_ALIGN);
71 #if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)
73 #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
75 #define pcmcia_request_window(a, b, c) pcmcia_request_window(&a, b, c)
77 #define pcmcia_map_mem_page(a, b, c) pcmcia_map_mem_page(b, c)
79 /* loop over CIS entries */
80 int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
81 int (*loop_tuple) (struct pcmcia_device *p_dev,
86 #endif /* CONFIG_PCMCIA */
88 /* loop over CIS entries */
89 int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
90 cisdata_t code, cisparse_t *parse, void *priv_data,
91 int (*loop_tuple) (tuple_t *tuple,
95 #endif /* CONFIG_PCCARD */
98 * kfifo_alloc and kfifo_free must be backported manually
100 #define kfifo_in(a, b, c) __kfifo_put(*a, b, c)
101 #define kfifo_out(a, b, c) __kfifo_get(*a, b, c)
102 #define kfifo_len(a) __kfifo_len(*a)
104 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
106 #endif /* LINUX_26_33_COMPAT_H */