diff options
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_module.c')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_module.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c index 256207b71dc9..4f8c3ef70819 100644 --- a/net/ieee80211/softmac/ieee80211softmac_module.c +++ b/net/ieee80211/softmac/ieee80211softmac_module.c | |||
@@ -32,19 +32,19 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv) | |||
32 | { | 32 | { |
33 | struct ieee80211softmac_device *softmac; | 33 | struct ieee80211softmac_device *softmac; |
34 | struct net_device *dev; | 34 | struct net_device *dev; |
35 | 35 | ||
36 | dev = alloc_ieee80211(sizeof(struct ieee80211softmac_device) + sizeof_priv); | 36 | dev = alloc_ieee80211(sizeof(struct ieee80211softmac_device) + sizeof_priv); |
37 | softmac = ieee80211_priv(dev); | 37 | softmac = ieee80211_priv(dev); |
38 | softmac->dev = dev; | 38 | softmac->dev = dev; |
39 | softmac->ieee = netdev_priv(dev); | 39 | softmac->ieee = netdev_priv(dev); |
40 | spin_lock_init(&softmac->lock); | 40 | spin_lock_init(&softmac->lock); |
41 | 41 | ||
42 | softmac->ieee->handle_auth = ieee80211softmac_auth_resp; | 42 | softmac->ieee->handle_auth = ieee80211softmac_auth_resp; |
43 | softmac->ieee->handle_deauth = ieee80211softmac_deauth_resp; | 43 | softmac->ieee->handle_deauth = ieee80211softmac_deauth_resp; |
44 | softmac->ieee->handle_assoc_response = ieee80211softmac_handle_assoc_response; | 44 | softmac->ieee->handle_assoc_response = ieee80211softmac_handle_assoc_response; |
45 | softmac->ieee->handle_reassoc_request = ieee80211softmac_handle_reassoc_req; | 45 | softmac->ieee->handle_reassoc_request = ieee80211softmac_handle_reassoc_req; |
46 | softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc; | 46 | softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc; |
47 | softmac->ieee->handle_beacon = ieee80211softmac_handle_beacon; | 47 | softmac->ieee->handle_beacon = ieee80211softmac_handle_beacon; |
48 | softmac->scaninfo = NULL; | 48 | softmac->scaninfo = NULL; |
49 | 49 | ||
50 | softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT; | 50 | softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT; |
@@ -66,37 +66,37 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv) | |||
66 | 66 | ||
67 | /* to start with, we can't send anything ... */ | 67 | /* to start with, we can't send anything ... */ |
68 | netif_carrier_off(dev); | 68 | netif_carrier_off(dev); |
69 | 69 | ||
70 | return dev; | 70 | return dev; |
71 | } | 71 | } |
72 | EXPORT_SYMBOL_GPL(alloc_ieee80211softmac); | 72 | EXPORT_SYMBOL_GPL(alloc_ieee80211softmac); |
73 | 73 | ||
74 | /* Clears the pending work queue items, stops all scans, etc. */ | 74 | /* Clears the pending work queue items, stops all scans, etc. */ |
75 | void | 75 | void |
76 | ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm) | 76 | ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm) |
77 | { | 77 | { |
78 | unsigned long flags; | 78 | unsigned long flags; |
79 | struct ieee80211softmac_event *eventptr, *eventtmp; | 79 | struct ieee80211softmac_event *eventptr, *eventtmp; |
80 | struct ieee80211softmac_auth_queue_item *authptr, *authtmp; | 80 | struct ieee80211softmac_auth_queue_item *authptr, *authtmp; |
81 | struct ieee80211softmac_network *netptr, *nettmp; | 81 | struct ieee80211softmac_network *netptr, *nettmp; |
82 | 82 | ||
83 | ieee80211softmac_stop_scan(sm); | 83 | ieee80211softmac_stop_scan(sm); |
84 | ieee80211softmac_wait_for_scan(sm); | 84 | ieee80211softmac_wait_for_scan(sm); |
85 | 85 | ||
86 | spin_lock_irqsave(&sm->lock, flags); | 86 | spin_lock_irqsave(&sm->lock, flags); |
87 | sm->running = 0; | 87 | sm->running = 0; |
88 | 88 | ||
89 | /* Free all pending assoc work items */ | 89 | /* Free all pending assoc work items */ |
90 | cancel_delayed_work(&sm->associnfo.work); | 90 | cancel_delayed_work(&sm->associnfo.work); |
91 | 91 | ||
92 | /* Free all pending scan work items */ | 92 | /* Free all pending scan work items */ |
93 | if(sm->scaninfo != NULL) | 93 | if(sm->scaninfo != NULL) |
94 | cancel_delayed_work(&sm->scaninfo->softmac_scan); | 94 | cancel_delayed_work(&sm->scaninfo->softmac_scan); |
95 | 95 | ||
96 | /* Free all pending auth work items */ | 96 | /* Free all pending auth work items */ |
97 | list_for_each_entry(authptr, &sm->auth_queue, list) | 97 | list_for_each_entry(authptr, &sm->auth_queue, list) |
98 | cancel_delayed_work(&authptr->work); | 98 | cancel_delayed_work(&authptr->work); |
99 | 99 | ||
100 | /* delete all pending event calls and work items */ | 100 | /* delete all pending event calls and work items */ |
101 | list_for_each_entry_safe(eventptr, eventtmp, &sm->events, list) | 101 | list_for_each_entry_safe(eventptr, eventtmp, &sm->events, list) |
102 | cancel_delayed_work(&eventptr->work); | 102 | cancel_delayed_work(&eventptr->work); |
@@ -111,13 +111,13 @@ ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm) | |||
111 | list_del(&authptr->list); | 111 | list_del(&authptr->list); |
112 | kfree(authptr); | 112 | kfree(authptr); |
113 | } | 113 | } |
114 | 114 | ||
115 | /* delete all pending event calls and work items */ | 115 | /* delete all pending event calls and work items */ |
116 | list_for_each_entry_safe(eventptr, eventtmp, &sm->events, list) { | 116 | list_for_each_entry_safe(eventptr, eventtmp, &sm->events, list) { |
117 | list_del(&eventptr->list); | 117 | list_del(&eventptr->list); |
118 | kfree(eventptr); | 118 | kfree(eventptr); |
119 | } | 119 | } |
120 | 120 | ||
121 | /* Free all networks */ | 121 | /* Free all networks */ |
122 | list_for_each_entry_safe(netptr, nettmp, &sm->network_list, list) { | 122 | list_for_each_entry_safe(netptr, nettmp, &sm->network_list, list) { |
123 | ieee80211softmac_del_network_locked(sm, netptr); | 123 | ieee80211softmac_del_network_locked(sm, netptr); |
@@ -133,7 +133,7 @@ EXPORT_SYMBOL_GPL(ieee80211softmac_clear_pending_work); | |||
133 | void free_ieee80211softmac(struct net_device *dev) | 133 | void free_ieee80211softmac(struct net_device *dev) |
134 | { | 134 | { |
135 | struct ieee80211softmac_device *sm = ieee80211_priv(dev); | 135 | struct ieee80211softmac_device *sm = ieee80211_priv(dev); |
136 | ieee80211softmac_clear_pending_work(sm); | 136 | ieee80211softmac_clear_pending_work(sm); |
137 | kfree(sm->scaninfo); | 137 | kfree(sm->scaninfo); |
138 | kfree(sm->wpa.IE); | 138 | kfree(sm->wpa.IE); |
139 | free_ieee80211(dev); | 139 | free_ieee80211(dev); |
@@ -208,9 +208,9 @@ EXPORT_SYMBOL_GPL(ieee80211softmac_highest_supported_rate); | |||
208 | void ieee80211softmac_process_erp(struct ieee80211softmac_device *mac, | 208 | void ieee80211softmac_process_erp(struct ieee80211softmac_device *mac, |
209 | u8 erp_value) | 209 | u8 erp_value) |
210 | { | 210 | { |
211 | int use_protection; | 211 | int use_protection; |
212 | int short_preamble; | 212 | int short_preamble; |
213 | u32 changes = 0; | 213 | u32 changes = 0; |
214 | 214 | ||
215 | /* Barker preamble mode */ | 215 | /* Barker preamble mode */ |
216 | short_preamble = ((erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0 | 216 | short_preamble = ((erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0 |
@@ -269,7 +269,7 @@ void ieee80211softmac_init_bss(struct ieee80211softmac_device *mac) | |||
269 | rates, so 801.11g devices start off at 11M for now. People | 269 | rates, so 801.11g devices start off at 11M for now. People |
270 | can manually change it if they really need to, but 11M is | 270 | can manually change it if they really need to, but 11M is |
271 | more reliable. Note similar logic in | 271 | more reliable. Note similar logic in |
272 | ieee80211softmac_wx_set_rate() */ | 272 | ieee80211softmac_wx_set_rate() */ |
273 | if (ieee->modulation & IEEE80211_CCK_MODULATION) { | 273 | if (ieee->modulation & IEEE80211_CCK_MODULATION) { |
274 | txrates->user_rate = IEEE80211_CCK_RATE_11MB; | 274 | txrates->user_rate = IEEE80211_CCK_RATE_11MB; |
275 | } else if (ieee->modulation & IEEE80211_OFDM_MODULATION) { | 275 | } else if (ieee->modulation & IEEE80211_OFDM_MODULATION) { |
@@ -332,7 +332,7 @@ void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates) | |||
332 | { | 332 | { |
333 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); | 333 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); |
334 | unsigned long flags; | 334 | unsigned long flags; |
335 | 335 | ||
336 | spin_lock_irqsave(&mac->lock, flags); | 336 | spin_lock_irqsave(&mac->lock, flags); |
337 | memcpy(mac->ratesinfo.rates, rates, count); | 337 | memcpy(mac->ratesinfo.rates, rates, count); |
338 | mac->ratesinfo.count = count; | 338 | mac->ratesinfo.count = count; |
@@ -344,7 +344,7 @@ static u8 raise_rate(struct ieee80211softmac_device *mac, u8 rate) | |||
344 | { | 344 | { |
345 | int i; | 345 | int i; |
346 | struct ieee80211softmac_ratesinfo *ri = &mac->ratesinfo; | 346 | struct ieee80211softmac_ratesinfo *ri = &mac->ratesinfo; |
347 | 347 | ||
348 | for (i=0; i<ri->count-1; i++) { | 348 | for (i=0; i<ri->count-1; i++) { |
349 | if (ri->rates[i] == rate) | 349 | if (ri->rates[i] == rate) |
350 | return ri->rates[i+1]; | 350 | return ri->rates[i+1]; |
@@ -357,7 +357,7 @@ u8 ieee80211softmac_lower_rate_delta(struct ieee80211softmac_device *mac, u8 rat | |||
357 | { | 357 | { |
358 | int i; | 358 | int i; |
359 | struct ieee80211softmac_ratesinfo *ri = &mac->ratesinfo; | 359 | struct ieee80211softmac_ratesinfo *ri = &mac->ratesinfo; |
360 | 360 | ||
361 | for (i=delta; i<ri->count; i++) { | 361 | for (i=delta; i<ri->count; i++) { |
362 | if (ri->rates[i] == rate) | 362 | if (ri->rates[i] == rate) |
363 | return ri->rates[i-delta]; | 363 | return ri->rates[i-delta]; |
@@ -438,7 +438,7 @@ ieee80211softmac_create_network(struct ieee80211softmac_device *mac, | |||
438 | softnet->channel = net->channel; | 438 | softnet->channel = net->channel; |
439 | softnet->essid.len = net->ssid_len; | 439 | softnet->essid.len = net->ssid_len; |
440 | memcpy(softnet->essid.data, net->ssid, softnet->essid.len); | 440 | memcpy(softnet->essid.data, net->ssid, softnet->essid.len); |
441 | 441 | ||
442 | /* copy rates over */ | 442 | /* copy rates over */ |
443 | softnet->supported_rates.count = net->rates_len; | 443 | softnet->supported_rates.count = net->rates_len; |
444 | memcpy(&softnet->supported_rates.rates[0], net->rates, net->rates_len); | 444 | memcpy(&softnet->supported_rates.rates[0], net->rates, net->rates_len); |
@@ -529,7 +529,7 @@ ieee80211softmac_get_network_by_bssid(struct ieee80211softmac_device *mac, | |||
529 | { | 529 | { |
530 | unsigned long flags; | 530 | unsigned long flags; |
531 | struct ieee80211softmac_network *softmac_net; | 531 | struct ieee80211softmac_network *softmac_net; |
532 | 532 | ||
533 | spin_lock_irqsave(&mac->lock, flags); | 533 | spin_lock_irqsave(&mac->lock, flags); |
534 | softmac_net = ieee80211softmac_get_network_by_bssid_locked(mac, bssid); | 534 | softmac_net = ieee80211softmac_get_network_by_bssid_locked(mac, bssid); |
535 | spin_unlock_irqrestore(&mac->lock, flags); | 535 | spin_unlock_irqrestore(&mac->lock, flags); |
@@ -556,13 +556,13 @@ ieee80211softmac_get_network_by_essid_locked(struct ieee80211softmac_device *mac | |||
556 | /* Get a network from the list by ESSID with locking */ | 556 | /* Get a network from the list by ESSID with locking */ |
557 | struct ieee80211softmac_network * | 557 | struct ieee80211softmac_network * |
558 | ieee80211softmac_get_network_by_essid(struct ieee80211softmac_device *mac, | 558 | ieee80211softmac_get_network_by_essid(struct ieee80211softmac_device *mac, |
559 | struct ieee80211softmac_essid *essid) | 559 | struct ieee80211softmac_essid *essid) |
560 | { | 560 | { |
561 | unsigned long flags; | 561 | unsigned long flags; |
562 | struct ieee80211softmac_network *softmac_net = NULL; | 562 | struct ieee80211softmac_network *softmac_net = NULL; |
563 | 563 | ||
564 | spin_lock_irqsave(&mac->lock, flags); | 564 | spin_lock_irqsave(&mac->lock, flags); |
565 | softmac_net = ieee80211softmac_get_network_by_essid_locked(mac, essid); | 565 | softmac_net = ieee80211softmac_get_network_by_essid_locked(mac, essid); |
566 | spin_unlock_irqrestore(&mac->lock, flags); | 566 | spin_unlock_irqrestore(&mac->lock, flags); |
567 | return softmac_net; | 567 | return softmac_net; |
568 | } | 568 | } |