aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211/softmac/ieee80211softmac_wx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_wx.c')
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_wx.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c
index fa2f7da606a9..c306d52566e0 100644
--- a/net/ieee80211/softmac/ieee80211softmac_wx.c
+++ b/net/ieee80211/softmac/ieee80211softmac_wx.c
@@ -142,14 +142,14 @@ ieee80211softmac_wx_get_essid(struct net_device *net_dev,
142 /* If all fails, return ANY (empty) */ 142 /* If all fails, return ANY (empty) */
143 data->essid.length = 0; 143 data->essid.length = 0;
144 data->essid.flags = 0; /* active */ 144 data->essid.flags = 0; /* active */
145 145
146 /* If we have a statically configured ESSID then return it */ 146 /* If we have a statically configured ESSID then return it */
147 if (sm->associnfo.static_essid) { 147 if (sm->associnfo.static_essid) {
148 data->essid.length = sm->associnfo.req_essid.len; 148 data->essid.length = sm->associnfo.req_essid.len;
149 data->essid.flags = 1; /* active */ 149 data->essid.flags = 1; /* active */
150 memcpy(extra, sm->associnfo.req_essid.data, sm->associnfo.req_essid.len); 150 memcpy(extra, sm->associnfo.req_essid.data, sm->associnfo.req_essid.len);
151 } 151 }
152 152
153 /* If we're associating/associated, return that */ 153 /* If we're associating/associated, return that */
154 if (sm->associnfo.associated || sm->associnfo.associating) { 154 if (sm->associnfo.associated || sm->associnfo.associating) {
155 data->essid.length = sm->associnfo.associate_essid.len; 155 data->essid.length = sm->associnfo.associate_essid.len;
@@ -181,7 +181,7 @@ ieee80211softmac_wx_set_rate(struct net_device *net_dev,
181 rates, so 801.11g devices start off at 11M for now. People 181 rates, so 801.11g devices start off at 11M for now. People
182 can manually change it if they really need to, but 11M is 182 can manually change it if they really need to, but 11M is
183 more reliable. Note similar logic in 183 more reliable. Note similar logic in
184 ieee80211softmac_wx_set_rate() */ 184 ieee80211softmac_wx_set_rate() */
185 if (ieee->modulation & IEEE80211_CCK_MODULATION) 185 if (ieee->modulation & IEEE80211_CCK_MODULATION)
186 in_rate = 11000000; 186 in_rate = 11000000;
187 else 187 else
@@ -247,7 +247,7 @@ ieee80211softmac_wx_set_rate(struct net_device *net_dev,
247 ieee80211softmac_recalc_txrates(mac); 247 ieee80211softmac_recalc_txrates(mac);
248 err = 0; 248 err = 0;
249 249
250out_unlock: 250out_unlock:
251 spin_unlock_irqrestore(&mac->lock, flags); 251 spin_unlock_irqrestore(&mac->lock, flags);
252out: 252out:
253 return err; 253 return err;
@@ -265,6 +265,12 @@ ieee80211softmac_wx_get_rate(struct net_device *net_dev,
265 int err = -EINVAL; 265 int err = -EINVAL;
266 266
267 spin_lock_irqsave(&mac->lock, flags); 267 spin_lock_irqsave(&mac->lock, flags);
268
269 if (unlikely(!mac->running)) {
270 err = -ENODEV;
271 goto out_unlock;
272 }
273
268 switch (mac->txrates.default_rate) { 274 switch (mac->txrates.default_rate) {
269 case IEEE80211_CCK_RATE_1MB: 275 case IEEE80211_CCK_RATE_1MB:
270 data->bitrate.value = 1000000; 276 data->bitrate.value = 1000000;
@@ -360,7 +366,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
360 } else if (is_zero_ether_addr(data->ap_addr.sa_data)) { 366 } else if (is_zero_ether_addr(data->ap_addr.sa_data)) {
361 /* the bssid we have is no longer fixed */ 367 /* the bssid we have is no longer fixed */
362 mac->associnfo.bssfixed = 0; 368 mac->associnfo.bssfixed = 0;
363 } else { 369 } else {
364 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) { 370 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) {
365 if (mac->associnfo.associating || mac->associnfo.associated) { 371 if (mac->associnfo.associating || mac->associnfo.associated) {
366 /* bssid unchanged and associated or associating - just return */ 372 /* bssid unchanged and associated or associating - just return */
@@ -374,7 +380,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
374 mac->associnfo.bssfixed = 1; 380 mac->associnfo.bssfixed = 1;
375 /* queue associate if new bssid or (old one again and not associated) */ 381 /* queue associate if new bssid or (old one again and not associated) */
376 schedule_delayed_work(&mac->associnfo.work, 0); 382 schedule_delayed_work(&mac->associnfo.work, 0);
377 } 383 }
378 384
379 out: 385 out:
380 mutex_unlock(&mac->associnfo.mutex); 386 mutex_unlock(&mac->associnfo.mutex);
@@ -431,7 +437,7 @@ ieee80211softmac_wx_set_genie(struct net_device *dev,
431 mac->wpa.IEbuflen = 0; 437 mac->wpa.IEbuflen = 0;
432 } 438 }
433 439
434 out: 440 out:
435 spin_unlock_irqrestore(&mac->lock, flags); 441 spin_unlock_irqrestore(&mac->lock, flags);
436 mutex_unlock(&mac->associnfo.mutex); 442 mutex_unlock(&mac->associnfo.mutex);
437 443
@@ -452,9 +458,9 @@ ieee80211softmac_wx_get_genie(struct net_device *dev,
452 458
453 mutex_lock(&mac->associnfo.mutex); 459 mutex_lock(&mac->associnfo.mutex);
454 spin_lock_irqsave(&mac->lock, flags); 460 spin_lock_irqsave(&mac->lock, flags);
455 461
456 wrqu->data.length = 0; 462 wrqu->data.length = 0;
457 463
458 if (mac->wpa.IE && mac->wpa.IElen) { 464 if (mac->wpa.IE && mac->wpa.IElen) {
459 wrqu->data.length = mac->wpa.IElen; 465 wrqu->data.length = mac->wpa.IElen;
460 if (mac->wpa.IElen <= space) 466 if (mac->wpa.IElen <= space)