Commit 33f08bd8 authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: deleted unused array of bss configurations in softmac

List always had one element. Converted the array to a scalar.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b65e0fdb
...@@ -342,15 +342,6 @@ static u16 frametype(u32 rspec, u8 mimoframe) ...@@ -342,15 +342,6 @@ static u16 frametype(u32 rspec, u8 mimoframe)
/* Starting corerev for the fifo size table */ /* Starting corerev for the fifo size table */
#define XMTFIFOTBL_STARTREV 20 #define XMTFIFOTBL_STARTREV 20
/* iterate through all valid bsscfg entries */
#define FOREACH_BSS(wlc, idx, cfg) \
for (idx = 0; (int) idx < BRCMS_MAXBSSCFG; idx++) { \
cfg = (wlc)->bsscfg[idx]; \
if (!cfg) \
continue;
/* close marker for iterator code block */
#define END_FOREACH_BSS() }
/* currently the best mechanism for determining SIFS is the band in use */ /* currently the best mechanism for determining SIFS is the band in use */
static u16 get_sifs(struct brcms_band *band) static u16 get_sifs(struct brcms_band *band)
{ {
...@@ -3278,8 +3269,7 @@ static void brcms_b_antsel_set(struct brcms_hardware *wlc_hw, u32 antsel_avail) ...@@ -3278,8 +3269,7 @@ static void brcms_b_antsel_set(struct brcms_hardware *wlc_hw, u32 antsel_avail)
*/ */
bool brcms_c_ps_allowed(struct brcms_c_info *wlc) bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
{ {
int idx; struct brcms_bss_cfg *cfg = wlc->bsscfg;
struct brcms_bss_cfg *cfg;
/* disallow PS when one of the following global conditions meets */ /* disallow PS when one of the following global conditions meets */
if (!wlc->pub->associated) if (!wlc->pub->associated)
...@@ -3289,19 +3279,16 @@ bool brcms_c_ps_allowed(struct brcms_c_info *wlc) ...@@ -3289,19 +3279,16 @@ bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
if (wlc->monitor) if (wlc->monitor)
return false; return false;
for (idx = 0; idx < BRCMS_MAXBSSCFG; idx++) { if (cfg->associated) {
cfg = wlc->bsscfg[idx]; /*
if (cfg && cfg->associated) { * disallow PS when one of the following
/* * bsscfg specific conditions meets
* disallow PS when one of the following */
* bsscfg specific conditions meets if (!cfg->BSS)
*/ return false;
if (!cfg->BSS)
return false;
if (!cfg->dtim_programmed) if (!cfg->dtim_programmed)
return false; return false;
}
} }
return true; return true;
...@@ -3779,8 +3766,6 @@ void brcms_c_init(struct brcms_c_info *wlc) ...@@ -3779,8 +3766,6 @@ void brcms_c_init(struct brcms_c_info *wlc)
{ {
struct d11regs *regs; struct d11regs *regs;
u16 chanspec; u16 chanspec;
int i;
struct brcms_bss_cfg *bsscfg;
bool mute = false; bool mute = false;
BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);
...@@ -3806,32 +3791,24 @@ void brcms_c_init(struct brcms_c_info *wlc) ...@@ -3806,32 +3791,24 @@ void brcms_c_init(struct brcms_c_info *wlc)
brcms_c_reprate_init(wlc); brcms_c_reprate_init(wlc);
/* write ethernet address to core */ /* write ethernet address to core */
FOREACH_BSS(wlc, i, bsscfg) brcms_c_set_mac(wlc->bsscfg);
brcms_c_set_mac(bsscfg); brcms_c_set_bssid(wlc->bsscfg);
brcms_c_set_bssid(bsscfg);
END_FOREACH_BSS()
/* Update tsf_cfprep if associated and up */ /* Update tsf_cfprep if associated and up */
if (wlc->pub->associated) { if (wlc->pub->associated && wlc->bsscfg->up) {
FOREACH_BSS(wlc, i, bsscfg) u32 bi;
if (bsscfg->up) {
u32 bi;
/* get beacon period and convert to uS */ /* get beacon period and convert to uS */
bi = bsscfg->current_bss->beacon_period << 10; bi = wlc->bsscfg->current_bss->beacon_period << 10;
/* /*
* update since init path would reset * update since init path would reset
* to default value * to default value
*/ */
W_REG(&regs->tsf_cfprep, W_REG(&regs->tsf_cfprep,
(bi << CFPREP_CBI_SHIFT)); (bi << CFPREP_CBI_SHIFT));
/* Update maccontrol PM related bits */
brcms_c_set_ps_ctrl(wlc);
break; /* Update maccontrol PM related bits */
} brcms_c_set_ps_ctrl(wlc);
END_FOREACH_BSS()
} }
brcms_c_bandinit_ordered(wlc, chanspec); brcms_c_bandinit_ordered(wlc, chanspec);
...@@ -4021,26 +3998,13 @@ void brcms_c_switch_shortslot(struct brcms_c_info *wlc, bool shortslot) ...@@ -4021,26 +3998,13 @@ void brcms_c_switch_shortslot(struct brcms_c_info *wlc, bool shortslot)
brcms_b_set_shortslot(wlc->hw, shortslot); brcms_b_set_shortslot(wlc->hw, shortslot);
} }
/*
* propagate home chanspec to all bsscfgs in
* case bsscfg->current_bss->chanspec is referenced
*/
void brcms_c_set_home_chanspec(struct brcms_c_info *wlc, u16 chanspec) void brcms_c_set_home_chanspec(struct brcms_c_info *wlc, u16 chanspec)
{ {
if (wlc->home_chanspec != chanspec) { if (wlc->home_chanspec != chanspec) {
int idx;
struct brcms_bss_cfg *cfg;
wlc->home_chanspec = chanspec; wlc->home_chanspec = chanspec;
FOREACH_BSS(wlc, idx, cfg) if (wlc->bsscfg->associated)
if (!cfg->associated) wlc->bsscfg->current_bss->chanspec = chanspec;
continue;
cfg->current_bss->chanspec = chanspec;
END_FOREACH_BSS()
} }
} }
...@@ -4092,8 +4056,7 @@ brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, u16 chanspec, ...@@ -4092,8 +4056,7 @@ brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, u16 chanspec,
static void brcms_c_setband(struct brcms_c_info *wlc, static void brcms_c_setband(struct brcms_c_info *wlc,
uint bandunit) uint bandunit)
{ {
int idx; struct brcms_bss_cfg *cfg = wlc->bsscfg;
struct brcms_bss_cfg *cfg;
wlc->band = wlc->bandstate[bandunit]; wlc->band = wlc->bandstate[bandunit];
...@@ -4101,11 +4064,9 @@ static void brcms_c_setband(struct brcms_c_info *wlc, ...@@ -4101,11 +4064,9 @@ static void brcms_c_setband(struct brcms_c_info *wlc,
return; return;
/* wait for at least one beacon before entering sleeping state */ /* wait for at least one beacon before entering sleeping state */
for (idx = 0; idx < BRCMS_MAXBSSCFG; idx++) { if (cfg->associated)
cfg = wlc->bsscfg[idx]; cfg->PMawakebcn = true;
if (cfg && cfg->associated)
cfg->PMawakebcn = true;
}
brcms_c_set_ps_ctrl(wlc); brcms_c_set_ps_ctrl(wlc);
/* band-specific initializations */ /* band-specific initializations */
...@@ -5427,7 +5388,7 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit, ...@@ -5427,7 +5388,7 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
goto fail; goto fail;
} }
wlc->bsscfg[0] = wlc->cfg; wlc->bsscfg = wlc->cfg;
wlc->cfg->_idx = 0; wlc->cfg->_idx = 0;
wlc->cfg->wlc = wlc; wlc->cfg->wlc = wlc;
...@@ -5840,19 +5801,15 @@ int brcms_c_up(struct brcms_c_info *wlc) ...@@ -5840,19 +5801,15 @@ int brcms_c_up(struct brcms_c_info *wlc)
if (status == -ENOMEDIUM) { if (status == -ENOMEDIUM) {
if (!mboolisset if (!mboolisset
(wlc->pub->radio_disabled, WL_RADIO_HW_DISABLE)) { (wlc->pub->radio_disabled, WL_RADIO_HW_DISABLE)) {
int idx; struct brcms_bss_cfg *bsscfg = wlc->bsscfg;
struct brcms_bss_cfg *bsscfg;
mboolset(wlc->pub->radio_disabled, mboolset(wlc->pub->radio_disabled,
WL_RADIO_HW_DISABLE); WL_RADIO_HW_DISABLE);
FOREACH_BSS(wlc, idx, bsscfg) if (bsscfg->enable && bsscfg->BSS)
if (!bsscfg->enable || !bsscfg->BSS) wiphy_err(wlc->wiphy, "wl%d: up"
continue;
wiphy_err(wlc->wiphy, "wl%d.%d: up"
": rfdisable -> " ": rfdisable -> "
"bsscfg_disable()\n", "bsscfg_disable()\n",
wlc->pub->unit, idx); wlc->pub->unit);
END_FOREACH_BSS()
} }
} }
} }
...@@ -8993,14 +8950,10 @@ void brcms_c_bss_update_beacon(struct brcms_c_info *wlc, ...@@ -8993,14 +8950,10 @@ void brcms_c_bss_update_beacon(struct brcms_c_info *wlc,
*/ */
void brcms_c_update_beacon(struct brcms_c_info *wlc) void brcms_c_update_beacon(struct brcms_c_info *wlc)
{ {
int idx; struct brcms_bss_cfg *bsscfg = wlc->bsscfg;
struct brcms_bss_cfg *bsscfg;
/* update AP or IBSS beacons */ if (bsscfg->up && !bsscfg->BSS)
FOREACH_BSS(wlc, idx, bsscfg) brcms_c_bss_update_beacon(wlc, bsscfg);
if (bsscfg->up && !bsscfg->BSS)
brcms_c_bss_update_beacon(wlc, bsscfg);
END_FOREACH_BSS()
} }
/* Write ssid into shared memory */ /* Write ssid into shared memory */
...@@ -9020,14 +8973,11 @@ void brcms_c_shm_ssid_upd(struct brcms_c_info *wlc, struct brcms_bss_cfg *cfg) ...@@ -9020,14 +8973,11 @@ void brcms_c_shm_ssid_upd(struct brcms_c_info *wlc, struct brcms_bss_cfg *cfg)
void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend) void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend)
{ {
int idx; struct brcms_bss_cfg *bsscfg = wlc->bsscfg;
struct brcms_bss_cfg *bsscfg;
/* update AP or IBSS probe responses */ /* update AP or IBSS probe responses */
FOREACH_BSS(wlc, idx, bsscfg) if (bsscfg->up && !bsscfg->BSS)
if (bsscfg->up && !bsscfg->BSS) brcms_c_bss_update_probe_resp(wlc, bsscfg, suspend);
brcms_c_bss_update_probe_resp(wlc, bsscfg, suspend);
END_FOREACH_BSS()
} }
void void
...@@ -9105,12 +9055,7 @@ int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu, uint *fifop) ...@@ -9105,12 +9055,7 @@ int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu, uint *fifop)
/* init tx reported rate mechanism */ /* init tx reported rate mechanism */
void brcms_c_reprate_init(struct brcms_c_info *wlc) void brcms_c_reprate_init(struct brcms_c_info *wlc)
{ {
int i; brcms_c_bsscfg_reprate_init(wlc->bsscfg);
struct brcms_bss_cfg *bsscfg;
FOREACH_BSS(wlc, i, bsscfg)
brcms_c_bsscfg_reprate_init(bsscfg);
END_FOREACH_BSS()
} }
/* per bsscfg init tx reported rate mechanism */ /* per bsscfg init tx reported rate mechanism */
......
...@@ -564,7 +564,7 @@ struct brcms_c_info { ...@@ -564,7 +564,7 @@ struct brcms_c_info {
u16 tx_prec_map; u16 tx_prec_map;
u16 fifo2prec_map[NFIFO]; u16 fifo2prec_map[NFIFO];
struct brcms_bss_cfg *bsscfg[BRCMS_MAXBSSCFG]; struct brcms_bss_cfg *bsscfg;
struct brcms_bss_cfg *cfg; struct brcms_bss_cfg *cfg;
/* tx queue */ /* tx queue */
......
...@@ -244,11 +244,6 @@ ...@@ -244,11 +244,6 @@
* ******************************************************************** * ********************************************************************
*/ */
/* NetBSD also needs to keep track of this */
/* max # BSS configs */
#define BRCMS_MAXBSSCFG (1)
#define BCMMSG(dev, fmt, args...) \ #define BCMMSG(dev, fmt, args...) \
do { \ do { \
if (brcm_msg_level & LOG_TRACE_VAL) \ if (brcm_msg_level & LOG_TRACE_VAL) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment