aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00mac.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-23 10:13:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:36 -0400
commit2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (patch)
tree9bf3cdfcbbefcb34f5984e6d797f488ebe358196 /drivers/net/wireless/rt2x00/rt2x00mac.c
parent57c4d7b4c4986037be51476b8e3025d5ba18d8b8 (diff)
mac80211: unify config_interface and bss_info_changed
The config_interface method is a little strange, it contains the BSSID and beacon updates, while bss_info_changed contains most other BSS information for each interface. This patch removes config_interface and rolls all the information it previously passed to drivers into bss_info_changed. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c88
1 files changed, 38 insertions, 50 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index c41a0b9e473d..c4c06b4e1f08 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -390,56 +390,6 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed)
390} 390}
391EXPORT_SYMBOL_GPL(rt2x00mac_config); 391EXPORT_SYMBOL_GPL(rt2x00mac_config);
392 392
393int rt2x00mac_config_interface(struct ieee80211_hw *hw,
394 struct ieee80211_vif *vif,
395 struct ieee80211_if_conf *conf)
396{
397 struct rt2x00_dev *rt2x00dev = hw->priv;
398 struct rt2x00_intf *intf = vif_to_intf(vif);
399 int update_bssid = 0;
400 int status = 0;
401
402 /*
403 * Mac80211 might be calling this function while we are trying
404 * to remove the device or perhaps suspending it.
405 */
406 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
407 return 0;
408
409 spin_lock(&intf->lock);
410
411 /*
412 * conf->bssid can be NULL if coming from the internal
413 * beacon update routine.
414 */
415 if (conf->changed & IEEE80211_IFCC_BSSID && conf->bssid) {
416 update_bssid = 1;
417 memcpy(&intf->bssid, conf->bssid, ETH_ALEN);
418 }
419
420 spin_unlock(&intf->lock);
421
422 /*
423 * Call rt2x00_config_intf() outside of the spinlock context since
424 * the call will sleep for USB drivers. By using the ieee80211_if_conf
425 * values as arguments we make keep access to rt2x00_intf thread safe
426 * even without the lock.
427 */
428 rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL,
429 update_bssid ? conf->bssid : NULL);
430
431 /*
432 * Update the beacon.
433 */
434 if (conf->changed & (IEEE80211_IFCC_BEACON |
435 IEEE80211_IFCC_BEACON_ENABLED))
436 status = rt2x00queue_update_beacon(rt2x00dev, vif,
437 conf->enable_beacon);
438
439 return status;
440}
441EXPORT_SYMBOL_GPL(rt2x00mac_config_interface);
442
443void rt2x00mac_configure_filter(struct ieee80211_hw *hw, 393void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
444 unsigned int changed_flags, 394 unsigned int changed_flags,
445 unsigned int *total_flags, 395 unsigned int *total_flags,
@@ -623,6 +573,44 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
623 struct rt2x00_dev *rt2x00dev = hw->priv; 573 struct rt2x00_dev *rt2x00dev = hw->priv;
624 struct rt2x00_intf *intf = vif_to_intf(vif); 574 struct rt2x00_intf *intf = vif_to_intf(vif);
625 unsigned int delayed = 0; 575 unsigned int delayed = 0;
576 int update_bssid = 0;
577
578 /*
579 * Mac80211 might be calling this function while we are trying
580 * to remove the device or perhaps suspending it.
581 */
582 if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
583 return;
584
585 spin_lock(&intf->lock);
586
587 /*
588 * conf->bssid can be NULL if coming from the internal
589 * beacon update routine.
590 */
591 if (changes & BSS_CHANGED_BSSID) {
592 update_bssid = 1;
593 memcpy(&intf->bssid, bss_conf->bssid, ETH_ALEN);
594 }
595
596 spin_unlock(&intf->lock);
597
598 /*
599 * Call rt2x00_config_intf() outside of the spinlock context since
600 * the call will sleep for USB drivers. By using the ieee80211_if_conf
601 * values as arguments we make keep access to rt2x00_intf thread safe
602 * even without the lock.
603 */
604 if (changes & BSS_CHANGED_BSSID)
605 rt2x00lib_config_intf(rt2x00dev, intf, vif->type, NULL,
606 update_bssid ? bss_conf->bssid : NULL);
607
608 /*
609 * Update the beacon.
610 */
611 if (changes & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_ENABLED))
612 rt2x00queue_update_beacon(rt2x00dev, vif,
613 bss_conf->enable_beacon);
626 614
627 /* 615 /*
628 * When the association status has changed we must reset the link 616 * When the association status has changed we must reset the link