33 #include <linux/compiler.h>
34 #include <linux/errno.h>
35 #include <linux/if_arp.h>
36 #include <linux/in6.h>
39 #include <linux/kernel.h>
40 #include <linux/module.h>
41 #include <linux/netdevice.h>
44 #include <linux/slab.h>
45 #include <linux/tcp.h>
46 #include <linux/types.h>
47 #include <linux/wireless.h>
49 #include <asm/uaccess.h>
55 #define DRV_DESCRIPTION "802.11 data/management/control stack"
56 #define DRV_NAME "libipw"
57 #define DRV_PROCNAME "ieee80211"
58 #define DRV_VERSION LIBIPW_VERSION
67 static void *libipw_wiphy_privid = &libipw_wiphy_privid;
69 static int libipw_networks_allocate(
struct libipw_device *ieee)
78 for (j = 0; j <
i; j++)
98 static inline void libipw_networks_free(
struct libipw_device *ieee)
110 unsigned long age_secs)
120 spin_unlock_irqrestore(&ieee->
lock, flags);
124 static void libipw_networks_initialize(
struct libipw_device *ieee)
152 dev = alloc_etherdev(
sizeof(
struct libipw_device) + sizeof_priv);
156 ieee = netdev_priv(dev);
162 if (!ieee->
wdev.wiphy) {
164 goto failed_free_netdev;
167 ieee->
dev->ieee80211_ptr = &ieee->
wdev;
173 ieee->
wdev.wiphy->privid = libipw_wiphy_privid;
175 ieee->
wdev.wiphy->max_scan_ssids = 1;
176 ieee->
wdev.wiphy->max_scan_ie_len = 0;
181 err = libipw_networks_allocate(ieee);
183 LIBIPW_ERROR(
"Unable to allocate beacon storage: %d\n", err);
184 goto failed_free_wiphy;
186 libipw_networks_initialize(ieee);
233 libipw_networks_free(ieee);
243 #ifdef CONFIG_LIBIPW_DEBUG
245 static int debug = 0;
246 u32 libipw_debug_level = 0;
250 static int debug_level_proc_show(
struct seq_file *
m,
void *
v)
252 seq_printf(m,
"0x%08X\n", libipw_debug_level);
264 char buf[] =
"0x00000000\n";
265 size_t len =
min(
sizeof(buf) - 1, count);
271 if (
sscanf(buf,
"%li", &val) != 1)
273 ": %s is not in hex or decimal form.\n", buf);
275 libipw_debug_level =
val;
282 .open = debug_level_proc_open,
286 .write = debug_level_proc_write,
290 static int __init libipw_init(
void)
292 #ifdef CONFIG_LIBIPW_DEBUG
295 libipw_debug_level =
debug;
297 if (libipw_proc ==
NULL) {
299 " proc directory\n");
303 &debug_level_proc_fops);
317 static void __exit libipw_exit(
void)
319 #ifdef CONFIG_LIBIPW_DEBUG
328 #ifdef CONFIG_LIBIPW_DEBUG