diff options
Diffstat (limited to 'net/ieee80211/ieee80211_module.c')
-rw-r--r-- | net/ieee80211/ieee80211_module.c | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c index 6059e9e37123..f66d792cd204 100644 --- a/net/ieee80211/ieee80211_module.c +++ b/net/ieee80211/ieee80211_module.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Copyright(c) 2004 Intel Corporation. All rights reserved. | 3 | Copyright(c) 2004-2005 Intel Corporation. All rights reserved. |
4 | 4 | ||
5 | Portions of this file are based on the WEP enablement code provided by the | 5 | Portions of this file are based on the WEP enablement code provided by the |
6 | Host AP project hostap-drivers v0.1.3 | 6 | Host AP project hostap-drivers v0.1.3 |
@@ -53,12 +53,15 @@ | |||
53 | 53 | ||
54 | #include <net/ieee80211.h> | 54 | #include <net/ieee80211.h> |
55 | 55 | ||
56 | MODULE_DESCRIPTION("802.11 data/management/control stack"); | 56 | #define DRV_DESCRIPTION "802.11 data/management/control stack" |
57 | MODULE_AUTHOR | 57 | #define DRV_NAME "ieee80211" |
58 | ("Copyright (C) 2004 Intel Corporation <jketreno@linux.intel.com>"); | 58 | #define DRV_VERSION IEEE80211_VERSION |
59 | MODULE_LICENSE("GPL"); | 59 | #define DRV_COPYRIGHT "Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>" |
60 | 60 | ||
61 | #define DRV_NAME "ieee80211" | 61 | MODULE_VERSION(DRV_VERSION); |
62 | MODULE_DESCRIPTION(DRV_DESCRIPTION); | ||
63 | MODULE_AUTHOR(DRV_COPYRIGHT); | ||
64 | MODULE_LICENSE("GPL"); | ||
62 | 65 | ||
63 | static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee) | 66 | static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee) |
64 | { | 67 | { |
@@ -126,26 +129,34 @@ struct net_device *alloc_ieee80211(int sizeof_priv) | |||
126 | 129 | ||
127 | /* Default fragmentation threshold is maximum payload size */ | 130 | /* Default fragmentation threshold is maximum payload size */ |
128 | ieee->fts = DEFAULT_FTS; | 131 | ieee->fts = DEFAULT_FTS; |
132 | ieee->rts = DEFAULT_FTS; | ||
129 | ieee->scan_age = DEFAULT_MAX_SCAN_AGE; | 133 | ieee->scan_age = DEFAULT_MAX_SCAN_AGE; |
130 | ieee->open_wep = 1; | 134 | ieee->open_wep = 1; |
131 | 135 | ||
132 | /* Default to enabling full open WEP with host based encrypt/decrypt */ | 136 | /* Default to enabling full open WEP with host based encrypt/decrypt */ |
133 | ieee->host_encrypt = 1; | 137 | ieee->host_encrypt = 1; |
134 | ieee->host_decrypt = 1; | 138 | ieee->host_decrypt = 1; |
139 | ieee->host_mc_decrypt = 1; | ||
140 | |||
141 | /* Host fragementation in Open mode. Default is enabled. | ||
142 | * Note: host fragmentation is always enabled if host encryption | ||
143 | * is enabled. For cards can do hardware encryption, they must do | ||
144 | * hardware fragmentation as well. So we don't need a variable | ||
145 | * like host_enc_frag. */ | ||
146 | ieee->host_open_frag = 1; | ||
135 | ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ | 147 | ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ |
136 | 148 | ||
137 | INIT_LIST_HEAD(&ieee->crypt_deinit_list); | 149 | INIT_LIST_HEAD(&ieee->crypt_deinit_list); |
138 | init_timer(&ieee->crypt_deinit_timer); | 150 | init_timer(&ieee->crypt_deinit_timer); |
139 | ieee->crypt_deinit_timer.data = (unsigned long)ieee; | 151 | ieee->crypt_deinit_timer.data = (unsigned long)ieee; |
140 | ieee->crypt_deinit_timer.function = ieee80211_crypt_deinit_handler; | 152 | ieee->crypt_deinit_timer.function = ieee80211_crypt_deinit_handler; |
153 | ieee->crypt_quiesced = 0; | ||
141 | 154 | ||
142 | spin_lock_init(&ieee->lock); | 155 | spin_lock_init(&ieee->lock); |
143 | 156 | ||
144 | ieee->wpa_enabled = 0; | 157 | ieee->wpa_enabled = 0; |
145 | ieee->tkip_countermeasures = 0; | ||
146 | ieee->drop_unencrypted = 0; | 158 | ieee->drop_unencrypted = 0; |
147 | ieee->privacy_invoked = 0; | 159 | ieee->privacy_invoked = 0; |
148 | ieee->ieee802_1x = 1; | ||
149 | 160 | ||
150 | return dev; | 161 | return dev; |
151 | 162 | ||
@@ -161,6 +172,7 @@ void free_ieee80211(struct net_device *dev) | |||
161 | 172 | ||
162 | int i; | 173 | int i; |
163 | 174 | ||
175 | ieee80211_crypt_quiescing(ieee); | ||
164 | del_timer_sync(&ieee->crypt_deinit_timer); | 176 | del_timer_sync(&ieee->crypt_deinit_timer); |
165 | ieee80211_crypt_deinit_entries(ieee, 1); | 177 | ieee80211_crypt_deinit_entries(ieee, 1); |
166 | 178 | ||
@@ -195,38 +207,26 @@ static int show_debug_level(char *page, char **start, off_t offset, | |||
195 | static int store_debug_level(struct file *file, const char __user * buffer, | 207 | static int store_debug_level(struct file *file, const char __user * buffer, |
196 | unsigned long count, void *data) | 208 | unsigned long count, void *data) |
197 | { | 209 | { |
198 | char buf[] = "0x00000000"; | 210 | char buf[] = "0x00000000\n"; |
199 | char *p = (char *)buf; | 211 | unsigned long len = min((unsigned long)sizeof(buf) - 1, count); |
200 | unsigned long val; | 212 | unsigned long val; |
201 | 213 | ||
202 | if (count > sizeof(buf) - 1) | 214 | if (copy_from_user(buf, buffer, len)) |
203 | count = sizeof(buf) - 1; | ||
204 | |||
205 | if (copy_from_user(buf, buffer, count)) | ||
206 | return count; | 215 | return count; |
207 | buf[count] = 0; | 216 | buf[len] = 0; |
208 | /* | 217 | if (sscanf(buf, "%li", &val) != 1) |
209 | * what a FPOS... What, sscanf(buf, "%i", &val) would be too | ||
210 | * scary? | ||
211 | */ | ||
212 | if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') { | ||
213 | p++; | ||
214 | if (p[0] == 'x' || p[0] == 'X') | ||
215 | p++; | ||
216 | val = simple_strtoul(p, &p, 16); | ||
217 | } else | ||
218 | val = simple_strtoul(p, &p, 10); | ||
219 | if (p == buf) | ||
220 | printk(KERN_INFO DRV_NAME | 218 | printk(KERN_INFO DRV_NAME |
221 | ": %s is not in hex or decimal form.\n", buf); | 219 | ": %s is not in hex or decimal form.\n", buf); |
222 | else | 220 | else |
223 | ieee80211_debug_level = val; | 221 | ieee80211_debug_level = val; |
224 | 222 | ||
225 | return strlen(buf); | 223 | return strnlen(buf, len); |
226 | } | 224 | } |
225 | #endif /* CONFIG_IEEE80211_DEBUG */ | ||
227 | 226 | ||
228 | static int __init ieee80211_init(void) | 227 | static int __init ieee80211_init(void) |
229 | { | 228 | { |
229 | #ifdef CONFIG_IEEE80211_DEBUG | ||
230 | struct proc_dir_entry *e; | 230 | struct proc_dir_entry *e; |
231 | 231 | ||
232 | ieee80211_debug_level = debug; | 232 | ieee80211_debug_level = debug; |
@@ -246,26 +246,33 @@ static int __init ieee80211_init(void) | |||
246 | e->read_proc = show_debug_level; | 246 | e->read_proc = show_debug_level; |
247 | e->write_proc = store_debug_level; | 247 | e->write_proc = store_debug_level; |
248 | e->data = NULL; | 248 | e->data = NULL; |
249 | #endif /* CONFIG_IEEE80211_DEBUG */ | ||
250 | |||
251 | printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n"); | ||
252 | printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n"); | ||
249 | 253 | ||
250 | return 0; | 254 | return 0; |
251 | } | 255 | } |
252 | 256 | ||
253 | static void __exit ieee80211_exit(void) | 257 | static void __exit ieee80211_exit(void) |
254 | { | 258 | { |
259 | #ifdef CONFIG_IEEE80211_DEBUG | ||
255 | if (ieee80211_proc) { | 260 | if (ieee80211_proc) { |
256 | remove_proc_entry("debug_level", ieee80211_proc); | 261 | remove_proc_entry("debug_level", ieee80211_proc); |
257 | remove_proc_entry(DRV_NAME, proc_net); | 262 | remove_proc_entry(DRV_NAME, proc_net); |
258 | ieee80211_proc = NULL; | 263 | ieee80211_proc = NULL; |
259 | } | 264 | } |
265 | #endif /* CONFIG_IEEE80211_DEBUG */ | ||
260 | } | 266 | } |
261 | 267 | ||
268 | #ifdef CONFIG_IEEE80211_DEBUG | ||
262 | #include <linux/moduleparam.h> | 269 | #include <linux/moduleparam.h> |
263 | module_param(debug, int, 0444); | 270 | module_param(debug, int, 0444); |
264 | MODULE_PARM_DESC(debug, "debug output mask"); | 271 | MODULE_PARM_DESC(debug, "debug output mask"); |
272 | #endif /* CONFIG_IEEE80211_DEBUG */ | ||
265 | 273 | ||
266 | module_exit(ieee80211_exit); | 274 | module_exit(ieee80211_exit); |
267 | module_init(ieee80211_init); | 275 | module_init(ieee80211_init); |
268 | #endif | ||
269 | 276 | ||
270 | const char *escape_essid(const char *essid, u8 essid_len) | 277 | const char *escape_essid(const char *essid, u8 essid_len) |
271 | { | 278 | { |