aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmsmac/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/main.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index e67556780a31..bb00b6528d8f 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -18,6 +18,7 @@
18 18
19#include <linux/pci_ids.h> 19#include <linux/pci_ids.h>
20#include <linux/if_ether.h> 20#include <linux/if_ether.h>
21#include <net/cfg80211.h>
21#include <net/mac80211.h> 22#include <net/mac80211.h>
22#include <brcm_hw_ids.h> 23#include <brcm_hw_ids.h>
23#include <aiutils.h> 24#include <aiutils.h>
@@ -3139,20 +3140,6 @@ void brcms_c_reset(struct brcms_c_info *wlc)
3139 brcms_b_reset(wlc->hw); 3140 brcms_b_reset(wlc->hw);
3140} 3141}
3141 3142
3142/* Return the channel the driver should initialize during brcms_c_init.
3143 * the channel may have to be changed from the currently configured channel
3144 * if other configurations are in conflict (bandlocked, 11n mode disabled,
3145 * invalid channel for current country, etc.)
3146 */
3147static u16 brcms_c_init_chanspec(struct brcms_c_info *wlc)
3148{
3149 u16 chanspec =
3150 1 | WL_CHANSPEC_BW_20 | WL_CHANSPEC_CTL_SB_NONE |
3151 WL_CHANSPEC_BAND_2G;
3152
3153 return chanspec;
3154}
3155
3156void brcms_c_init_scb(struct scb *scb) 3143void brcms_c_init_scb(struct scb *scb)
3157{ 3144{
3158 int i; 3145 int i;
@@ -5129,6 +5116,8 @@ static void brcms_c_wme_retries_write(struct brcms_c_info *wlc)
5129/* make interface operational */ 5116/* make interface operational */
5130int brcms_c_up(struct brcms_c_info *wlc) 5117int brcms_c_up(struct brcms_c_info *wlc)
5131{ 5118{
5119 struct ieee80211_channel *ch;
5120
5132 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); 5121 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);
5133 5122
5134 /* HW is turned off so don't try to access it */ 5123 /* HW is turned off so don't try to access it */
@@ -5195,8 +5184,9 @@ int brcms_c_up(struct brcms_c_info *wlc)
5195 wlc->pub->up = true; 5184 wlc->pub->up = true;
5196 5185
5197 if (wlc->bandinit_pending) { 5186 if (wlc->bandinit_pending) {
5187 ch = wlc->pub->ieee_hw->conf.channel;
5198 brcms_c_suspend_mac_and_wait(wlc); 5188 brcms_c_suspend_mac_and_wait(wlc);
5199 brcms_c_set_chanspec(wlc, wlc->default_bss->chanspec); 5189 brcms_c_set_chanspec(wlc, ch20mhz_chspec(ch->hw_value));
5200 wlc->bandinit_pending = false; 5190 wlc->bandinit_pending = false;
5201 brcms_c_enable_mac(wlc); 5191 brcms_c_enable_mac(wlc);
5202 } 5192 }
@@ -5397,11 +5387,6 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)
5397 else 5387 else
5398 return -EINVAL; 5388 return -EINVAL;
5399 5389
5400 /* Legacy or bust when no OFDM is supported by regulatory */
5401 if ((brcms_c_channel_locale_flags_in_band(wlc->cmi, band->bandunit) &
5402 BRCMS_NO_OFDM) && (gmode != GMODE_LEGACY_B))
5403 return -EINVAL;
5404
5405 /* update configuration value */ 5390 /* update configuration value */
5406 if (config) 5391 if (config)
5407 brcms_c_protection_upd(wlc, BRCMS_PROT_G_USER, gmode); 5392 brcms_c_protection_upd(wlc, BRCMS_PROT_G_USER, gmode);
@@ -8201,19 +8186,12 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
8201void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx) 8186void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx)
8202{ 8187{
8203 struct bcma_device *core = wlc->hw->d11core; 8188 struct bcma_device *core = wlc->hw->d11core;
8189 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel;
8204 u16 chanspec; 8190 u16 chanspec;
8205 8191
8206 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); 8192 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);
8207 8193
8208 /* 8194 chanspec = ch20mhz_chspec(ch->hw_value);
8209 * This will happen if a big-hammer was executed. In
8210 * that case, we want to go back to the channel that
8211 * we were on and not new channel
8212 */
8213 if (wlc->pub->associated)
8214 chanspec = wlc->home_chanspec;
8215 else
8216 chanspec = brcms_c_init_chanspec(wlc);
8217 8195
8218 brcms_b_init(wlc->hw, chanspec); 8196 brcms_b_init(wlc->hw, chanspec);
8219 8197