summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/b43/main.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index d2661aaff50f..4a5cac600916 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -320,6 +320,10 @@ static void b43_wireless_core_exit(struct b43_wldev *dev);
320static int b43_wireless_core_init(struct b43_wldev *dev); 320static int b43_wireless_core_init(struct b43_wldev *dev);
321static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev); 321static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev);
322static int b43_wireless_core_start(struct b43_wldev *dev); 322static int b43_wireless_core_start(struct b43_wldev *dev);
323static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
324 struct ieee80211_vif *vif,
325 struct ieee80211_bss_conf *conf,
326 u32 changed);
323 327
324static int b43_ratelimit(struct b43_wl *wl) 328static int b43_ratelimit(struct b43_wl *wl)
325{ 329{
@@ -3778,14 +3782,24 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
3778 struct ieee80211_conf *conf = &hw->conf; 3782 struct ieee80211_conf *conf = &hw->conf;
3779 int antenna; 3783 int antenna;
3780 int err = 0; 3784 int err = 0;
3785 bool reload_bss = false;
3781 3786
3782 mutex_lock(&wl->mutex); 3787 mutex_lock(&wl->mutex);
3783 3788
3789 dev = wl->current_dev;
3790
3784 /* Switch the band (if necessary). This might change the active core. */ 3791 /* Switch the band (if necessary). This might change the active core. */
3785 err = b43_switch_band(wl, conf->channel); 3792 err = b43_switch_band(wl, conf->channel);
3786 if (err) 3793 if (err)
3787 goto out_unlock_mutex; 3794 goto out_unlock_mutex;
3788 dev = wl->current_dev; 3795
3796 /* Need to reload all settings if the core changed */
3797 if (dev != wl->current_dev) {
3798 dev = wl->current_dev;
3799 changed = ~0;
3800 reload_bss = true;
3801 }
3802
3789 phy = &dev->phy; 3803 phy = &dev->phy;
3790 3804
3791 if (conf_is_ht(conf)) 3805 if (conf_is_ht(conf))
@@ -3846,6 +3860,9 @@ out_mac_enable:
3846out_unlock_mutex: 3860out_unlock_mutex:
3847 mutex_unlock(&wl->mutex); 3861 mutex_unlock(&wl->mutex);
3848 3862
3863 if (wl->vif && reload_bss)
3864 b43_op_bss_info_changed(hw, wl->vif, &wl->vif->bss_conf, ~0);
3865
3849 return err; 3866 return err;
3850} 3867}
3851 3868
@@ -3934,7 +3951,8 @@ static void b43_op_bss_info_changed(struct ieee80211_hw *hw,
3934 if (changed & BSS_CHANGED_BEACON_INT && 3951 if (changed & BSS_CHANGED_BEACON_INT &&
3935 (b43_is_mode(wl, NL80211_IFTYPE_AP) || 3952 (b43_is_mode(wl, NL80211_IFTYPE_AP) ||
3936 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) || 3953 b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) ||
3937 b43_is_mode(wl, NL80211_IFTYPE_ADHOC))) 3954 b43_is_mode(wl, NL80211_IFTYPE_ADHOC)) &&
3955 conf->beacon_int)
3938 b43_set_beacon_int(dev, conf->beacon_int); 3956 b43_set_beacon_int(dev, conf->beacon_int);
3939 3957
3940 if (changed & BSS_CHANGED_BASIC_RATES) 3958 if (changed & BSS_CHANGED_BASIC_RATES)
@@ -4702,6 +4720,9 @@ static int b43_op_add_interface(struct ieee80211_hw *hw,
4702 out_mutex_unlock: 4720 out_mutex_unlock:
4703 mutex_unlock(&wl->mutex); 4721 mutex_unlock(&wl->mutex);
4704 4722
4723 if (err == 0)
4724 b43_op_bss_info_changed(hw, vif, &vif->bss_conf, ~0);
4725
4705 return err; 4726 return err;
4706} 4727}
4707 4728
@@ -4772,6 +4793,9 @@ static int b43_op_start(struct ieee80211_hw *hw)
4772 out_mutex_unlock: 4793 out_mutex_unlock:
4773 mutex_unlock(&wl->mutex); 4794 mutex_unlock(&wl->mutex);
4774 4795
4796 /* reload configuration */
4797 b43_op_config(hw, ~0);
4798
4775 return err; 4799 return err;
4776} 4800}
4777 4801
@@ -4928,10 +4952,18 @@ out:
4928 if (err) 4952 if (err)
4929 wl->current_dev = NULL; /* Failed to init the dev. */ 4953 wl->current_dev = NULL; /* Failed to init the dev. */
4930 mutex_unlock(&wl->mutex); 4954 mutex_unlock(&wl->mutex);
4931 if (err) 4955
4956 if (err) {
4932 b43err(wl, "Controller restart FAILED\n"); 4957 b43err(wl, "Controller restart FAILED\n");
4933 else 4958 return;
4934 b43info(wl, "Controller restarted\n"); 4959 }
4960
4961 /* reload configuration */
4962 b43_op_config(wl->hw, ~0);
4963 if (wl->vif)
4964 b43_op_bss_info_changed(wl->hw, wl->vif, &wl->vif->bss_conf, ~0);
4965
4966 b43info(wl, "Controller restarted\n");
4935} 4967}
4936 4968
4937static int b43_setup_bands(struct b43_wldev *dev, 4969static int b43_setup_bands(struct b43_wldev *dev,