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 #include <pcmcia/cs_types.h>
10 #include <pcmcia/cistpl.h>
11 #include <pcmcia/ds.h>
12 #include <linux/kfifo.h>
13 #include <linux/firmware.h>
15 #define release_firmware compat_release_firmware
16 #define request_firmware compat_request_firmware
17 #define request_firmware_nowait compat_request_firmware_nowait
19 #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
20 int compat_request_firmware(const struct firmware **fw, const char *name,
21 struct device *device);
22 int compat_request_firmware_nowait(
23 struct module *module, int uevent,
24 const char *name, struct device *device, gfp_t gfp, void *context,
25 void (*cont)(const struct firmware *fw, void *context));
27 void compat_release_firmware(const struct firmware *fw);
29 static inline int compat_request_firmware(const struct firmware **fw,
31 struct device *device)
35 static inline int request_firmware_nowait(
36 struct module *module, int uevent,
37 const char *name, struct device *device, gfp_t gfp, void *context,
38 void (*cont)(const struct firmware *fw, void *context))
43 static inline void compat_release_firmware(const struct firmware *fw)
48 #define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
49 /* source: include/linux/if.h */
51 #define kparam_block_sysfs_write(a)
52 #define kparam_unblock_sysfs_write(a)
54 /* this will never happen on older kernels */
55 #define NETDEV_POST_INIT 0xffff
57 static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
60 struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
62 if (NET_IP_ALIGN && skb)
63 skb_reserve(skb, NET_IP_ALIGN);
67 #if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)
69 #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
71 #define pcmcia_request_window(a, b, c) pcmcia_request_window(&a, b, c)
73 #define pcmcia_map_mem_page(a, b, c) pcmcia_map_mem_page(b, c)
75 /* loop over CIS entries */
76 int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
77 int (*loop_tuple) (struct pcmcia_device *p_dev,
82 #endif /* CONFIG_PCMCIA */
84 /* loop over CIS entries */
85 int pccard_loop_tuple(struct pcmcia_socket *s, unsigned int function,
86 cisdata_t code, cisparse_t *parse, void *priv_data,
87 int (*loop_tuple) (tuple_t *tuple,
91 #endif /* CONFIG_PCCARD */
94 * kfifo_alloc and kfifo_free must be backported manually
96 #define kfifo_in(a, b, c) __kfifo_put(*a, b, c)
97 #define kfifo_out(a, b, c) __kfifo_get(*a, b, c)
98 #define kfifo_len(a) __kfifo_len(*a)
100 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
102 #endif /* LINUX_26_33_COMPAT_H */