wl1251: reduce eeprom read wait time
[pandora-wifi.git] / include / linux / compat-2.6.33.h
1 #ifndef LINUX_26_33_COMPAT_H
2 #define LINUX_26_33_COMPAT_H
3
4 #include <linux/version.h>
5
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
7
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>
14 #endif
15 #endif
16 #include <linux/kfifo.h>
17 #include <linux/firmware.h>
18
19 #define release_firmware compat_release_firmware
20 #define request_firmware compat_request_firmware
21 #define request_firmware_nowait compat_request_firmware_nowait
22
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));
30
31 void compat_release_firmware(const struct firmware *fw);
32 #else
33 static inline int compat_request_firmware(const struct firmware **fw,
34                                    const char *name,
35                                    struct device *device)
36 {
37         return -EINVAL;
38 }
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))
43 {
44         return -EINVAL;
45 }
46
47 static inline void compat_release_firmware(const struct firmware *fw)
48 {
49 }
50 #endif
51
52 #define KEY_RFKILL              247     /* Key that controls all radios */
53
54 #define IFF_DONT_BRIDGE 0x800           /* disallow bridging this ether dev */
55 /* source: include/linux/if.h */
56
57 #define kparam_block_sysfs_write(a)
58 #define kparam_unblock_sysfs_write(a)
59
60 /* this will never happen on older kernels */
61 #define NETDEV_POST_INIT 0xffff
62
63 static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
64                 unsigned int length)
65 {
66         struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
67
68         if (NET_IP_ALIGN && skb)
69                 skb_reserve(skb, NET_IP_ALIGN);
70         return skb;
71 }
72
73 #if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)
74
75 #if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
76
77 #define pcmcia_request_window(a, b, c) pcmcia_request_window(&a, b, c)
78
79 #define pcmcia_map_mem_page(a, b, c) pcmcia_map_mem_page(b, c)
80
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,
84                                          tuple_t *tuple,
85                                          void *priv_data),
86                       void *priv_data);
87
88 #endif /* CONFIG_PCMCIA */
89
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,
94                                          cisparse_t *parse,
95                                          void *priv_data));
96
97 #endif /* CONFIG_PCCARD */
98
99 /* Backport for kfifo
100  * kfifo_alloc and kfifo_free must be backported manually 
101  */
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)
105
106 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
107
108 #endif /* LINUX_26_33_COMPAT_H */