aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
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/b43
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/b43')
-rw-r--r--drivers/net/wireless/b43/main.c64
1 files changed, 26 insertions, 38 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 3c693e6ec904..2615aaf7df6a 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3543,12 +3543,38 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
3543{ 3543{
3544 struct b43_wl *wl = hw_to_b43_wl(hw); 3544 struct b43_wl *wl = hw_to_b43_wl(hw);
3545 struct b43_wldev *dev; 3545 struct b43_wldev *dev;
3546 unsigned long flags;
3546 3547
3547 mutex_lock(&wl->mutex); 3548 mutex_lock(&wl->mutex);
3548 3549
3549 dev = wl->current_dev; 3550 dev = wl->current_dev;
3550 if (!dev || b43_status(dev) < B43_STAT_STARTED) 3551 if (!dev || b43_status(dev) < B43_STAT_STARTED)
3551 goto out_unlock_mutex; 3552 goto out_unlock_mutex;
3553
3554 B43_WARN_ON(wl->vif != vif);
3555
3556 if (changed & BSS_CHANGED_BSSID) {
3557 spin_lock_irqsave(&wl->irq_lock, flags);
3558 if (conf->bssid)
3559 memcpy(wl->bssid, conf->bssid, ETH_ALEN);
3560 else
3561 memset(wl->bssid, 0, ETH_ALEN);
3562
3563 if (b43_status(dev) >= B43_STAT_INITIALIZED) {
3564 if (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
3565 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT)) {
3566 B43_WARN_ON(vif->type != wl->if_type);
3567 if (changed & BSS_CHANGED_BEACON)
3568 b43_update_templates(wl);
3569 } else if (b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) {
3570 if (changed & BSS_CHANGED_BEACON)
3571 b43_update_templates(wl);
3572 }
3573 b43_write_mac_bssid_templates(dev);
3574 }
3575 spin_unlock_irqrestore(&wl->irq_lock, flags);
3576 }
3577
3552 b43_mac_suspend(dev); 3578 b43_mac_suspend(dev);
3553 3579
3554 /* Update templates for AP/mesh mode. */ 3580 /* Update templates for AP/mesh mode. */
@@ -3571,8 +3597,6 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
3571 b43_mac_enable(dev); 3597 b43_mac_enable(dev);
3572out_unlock_mutex: 3598out_unlock_mutex:
3573 mutex_unlock(&wl->mutex); 3599 mutex_unlock(&wl->mutex);
3574
3575 return;
3576} 3600}
3577 3601
3578static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, 3602static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
@@ -3730,41 +3754,6 @@ static void b43_op_configure_filter(struct ieee80211_hw *hw,
3730 spin_unlock_irqrestore(&wl->irq_lock, flags); 3754 spin_unlock_irqrestore(&wl->irq_lock, flags);
3731} 3755}
3732 3756
3733static int b43_op_config_interface(struct ieee80211_hw *hw,
3734 struct ieee80211_vif *vif,
3735 struct ieee80211_if_conf *conf)
3736{
3737 struct b43_wl *wl = hw_to_b43_wl(hw);
3738 struct b43_wldev *dev = wl->current_dev;
3739 unsigned long flags;
3740
3741 if (!dev)
3742 return -ENODEV;
3743 mutex_lock(&wl->mutex);
3744 spin_lock_irqsave(&wl->irq_lock, flags);
3745 B43_WARN_ON(wl->vif != vif);
3746 if (conf->bssid)
3747 memcpy(wl->bssid, conf->bssid, ETH_ALEN);
3748 else
3749 memset(wl->bssid, 0, ETH_ALEN);
3750 if (b43_status(dev) >= B43_STAT_INITIALIZED) {
3751 if (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
3752 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT)) {
3753 B43_WARN_ON(vif->type != wl->if_type);
3754 if (conf->changed & IEEE80211_IFCC_BEACON)
3755 b43_update_templates(wl);
3756 } else if (b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) {
3757 if (conf->changed & IEEE80211_IFCC_BEACON)
3758 b43_update_templates(wl);
3759 }
3760 b43_write_mac_bssid_templates(dev);
3761 }
3762 spin_unlock_irqrestore(&wl->irq_lock, flags);
3763 mutex_unlock(&wl->mutex);
3764
3765 return 0;
3766}
3767
3768/* Locking: wl->mutex */ 3757/* Locking: wl->mutex */
3769static void b43_wireless_core_stop(struct b43_wldev *dev) 3758static void b43_wireless_core_stop(struct b43_wldev *dev)
3770{ 3759{
@@ -4434,7 +4423,6 @@ static const struct ieee80211_ops b43_hw_ops = {
4434 .remove_interface = b43_op_remove_interface, 4423 .remove_interface = b43_op_remove_interface,
4435 .config = b43_op_config, 4424 .config = b43_op_config,
4436 .bss_info_changed = b43_op_bss_info_changed, 4425 .bss_info_changed = b43_op_bss_info_changed,
4437 .config_interface = b43_op_config_interface,
4438 .configure_filter = b43_op_configure_filter, 4426 .configure_filter = b43_op_configure_filter,
4439 .set_key = b43_op_set_key, 4427 .set_key = b43_op_set_key,
4440 .get_stats = b43_op_get_stats, 4428 .get_stats = b43_op_get_stats,