diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-23 10:13:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:36 -0400 |
commit | 2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (patch) | |
tree | 9bf3cdfcbbefcb34f5984e6d797f488ebe358196 /drivers/net/wireless/rt2x00 | |
parent | 57c4d7b4c4986037be51476b8e3025d5ba18d8b8 (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')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 88 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 1 |
7 files changed, 38 insertions, 58 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 411eb9cbb4e5..6f39ba662188 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1580,7 +1580,6 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = { | |||
1580 | .add_interface = rt2x00mac_add_interface, | 1580 | .add_interface = rt2x00mac_add_interface, |
1581 | .remove_interface = rt2x00mac_remove_interface, | 1581 | .remove_interface = rt2x00mac_remove_interface, |
1582 | .config = rt2x00mac_config, | 1582 | .config = rt2x00mac_config, |
1583 | .config_interface = rt2x00mac_config_interface, | ||
1584 | .configure_filter = rt2x00mac_configure_filter, | 1583 | .configure_filter = rt2x00mac_configure_filter, |
1585 | .get_stats = rt2x00mac_get_stats, | 1584 | .get_stats = rt2x00mac_get_stats, |
1586 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1585 | .bss_info_changed = rt2x00mac_bss_info_changed, |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index e1be67ca23d8..906960f67b6c 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1879,7 +1879,6 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = { | |||
1879 | .add_interface = rt2x00mac_add_interface, | 1879 | .add_interface = rt2x00mac_add_interface, |
1880 | .remove_interface = rt2x00mac_remove_interface, | 1880 | .remove_interface = rt2x00mac_remove_interface, |
1881 | .config = rt2x00mac_config, | 1881 | .config = rt2x00mac_config, |
1882 | .config_interface = rt2x00mac_config_interface, | ||
1883 | .configure_filter = rt2x00mac_configure_filter, | 1882 | .configure_filter = rt2x00mac_configure_filter, |
1884 | .get_stats = rt2x00mac_get_stats, | 1883 | .get_stats = rt2x00mac_get_stats, |
1885 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1884 | .bss_info_changed = rt2x00mac_bss_info_changed, |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 9e630e70fc97..08e88333b0ff 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1908,7 +1908,6 @@ static const struct ieee80211_ops rt2500usb_mac80211_ops = { | |||
1908 | .add_interface = rt2x00mac_add_interface, | 1908 | .add_interface = rt2x00mac_add_interface, |
1909 | .remove_interface = rt2x00mac_remove_interface, | 1909 | .remove_interface = rt2x00mac_remove_interface, |
1910 | .config = rt2x00mac_config, | 1910 | .config = rt2x00mac_config, |
1911 | .config_interface = rt2x00mac_config_interface, | ||
1912 | .configure_filter = rt2x00mac_configure_filter, | 1911 | .configure_filter = rt2x00mac_configure_filter, |
1913 | .set_key = rt2x00mac_set_key, | 1912 | .set_key = rt2x00mac_set_key, |
1914 | .get_stats = rt2x00mac_get_stats, | 1913 | .get_stats = rt2x00mac_get_stats, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index e03d69975ea4..0be395528261 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -943,9 +943,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, | |||
943 | void rt2x00mac_remove_interface(struct ieee80211_hw *hw, | 943 | void rt2x00mac_remove_interface(struct ieee80211_hw *hw, |
944 | struct ieee80211_if_init_conf *conf); | 944 | struct ieee80211_if_init_conf *conf); |
945 | int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed); | 945 | int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed); |
946 | int rt2x00mac_config_interface(struct ieee80211_hw *hw, | ||
947 | struct ieee80211_vif *vif, | ||
948 | struct ieee80211_if_conf *conf); | ||
949 | void rt2x00mac_configure_filter(struct ieee80211_hw *hw, | 946 | void rt2x00mac_configure_filter(struct ieee80211_hw *hw, |
950 | unsigned int changed_flags, | 947 | unsigned int changed_flags, |
951 | unsigned int *total_flags, | 948 | unsigned int *total_flags, |
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 | } |
391 | EXPORT_SYMBOL_GPL(rt2x00mac_config); | 391 | EXPORT_SYMBOL_GPL(rt2x00mac_config); |
392 | 392 | ||
393 | int 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 | } | ||
441 | EXPORT_SYMBOL_GPL(rt2x00mac_config_interface); | ||
442 | |||
443 | void rt2x00mac_configure_filter(struct ieee80211_hw *hw, | 393 | void 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 |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 4346cd1494bc..cb521ee7a8f0 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2735,7 +2735,6 @@ static const struct ieee80211_ops rt61pci_mac80211_ops = { | |||
2735 | .add_interface = rt2x00mac_add_interface, | 2735 | .add_interface = rt2x00mac_add_interface, |
2736 | .remove_interface = rt2x00mac_remove_interface, | 2736 | .remove_interface = rt2x00mac_remove_interface, |
2737 | .config = rt2x00mac_config, | 2737 | .config = rt2x00mac_config, |
2738 | .config_interface = rt2x00mac_config_interface, | ||
2739 | .configure_filter = rt2x00mac_configure_filter, | 2738 | .configure_filter = rt2x00mac_configure_filter, |
2740 | .set_key = rt2x00mac_set_key, | 2739 | .set_key = rt2x00mac_set_key, |
2741 | .get_stats = rt2x00mac_get_stats, | 2740 | .get_stats = rt2x00mac_get_stats, |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 853b2b279b64..6bd28a6bcef2 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2259,7 +2259,6 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = { | |||
2259 | .add_interface = rt2x00mac_add_interface, | 2259 | .add_interface = rt2x00mac_add_interface, |
2260 | .remove_interface = rt2x00mac_remove_interface, | 2260 | .remove_interface = rt2x00mac_remove_interface, |
2261 | .config = rt2x00mac_config, | 2261 | .config = rt2x00mac_config, |
2262 | .config_interface = rt2x00mac_config_interface, | ||
2263 | .configure_filter = rt2x00mac_configure_filter, | 2262 | .configure_filter = rt2x00mac_configure_filter, |
2264 | .set_key = rt2x00mac_set_key, | 2263 | .set_key = rt2x00mac_set_key, |
2265 | .get_stats = rt2x00mac_get_stats, | 2264 | .get_stats = rt2x00mac_get_stats, |