#define BSSCFG_STA(cfg) (1)
#define BSSCFG_IBSS(cfg) (!(cfg)->BSS)
-/* As above for all non-NULL BSS configs */
+/* iterate through all valid bsscfg entries */
#define FOREACH_BSS(wlc, idx, cfg) \
- for (idx = 0; (int) idx < BRCMS_MAXBSSCFG; idx++) \
- if ((cfg = (wlc)->bsscfg[idx]))
+ 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() }
/* Shared memory location index for various AC params */
#define wme_shmemacindex(ac) wme_ac2fifo[ac]
brcms_c_reprate_init(wlc);
/* write ethernet address to core */
- FOREACH_BSS(wlc, i, bsscfg) {
+ FOREACH_BSS(wlc, i, bsscfg)
brcms_c_set_mac(bsscfg);
brcms_c_set_bssid(bsscfg);
- }
+ END_FOREACH_BSS()
/* Update tsf_cfprep if associated and up */
if (wlc->pub->associated) {
- FOREACH_BSS(wlc, i, bsscfg) {
+ FOREACH_BSS(wlc, i, bsscfg)
if (bsscfg->up) {
u32 bi;
break;
}
- }
+ END_FOREACH_BSS()
}
brcms_c_bandinit_ordered(wlc, chanspec);
wlc->shortslot = shortslot;
/* update the capability based on current shortslot mode */
- FOREACH_BSS(wlc, idx, cfg) {
+ FOREACH_BSS(wlc, idx, cfg)
if (!cfg->associated)
continue;
cfg->current_bss->capability &=
if (wlc->shortslot)
cfg->current_bss->capability |=
WLAN_CAPABILITY_SHORT_SLOT_TIME;
- }
+ END_FOREACH_BSS()
brcms_b_set_shortslot(wlc->hw, shortslot);
}
wlc->home_chanspec = chanspec;
- FOREACH_BSS(wlc, idx, cfg) {
+ FOREACH_BSS(wlc, idx, cfg)
if (!cfg->associated)
continue;
cfg->current_bss->chanspec = chanspec;
- }
+ END_FOREACH_BSS()
+
}
}
brcms_c_statsupd(wlc);
/* Manage TKIP countermeasures timers */
- FOREACH_BSS(wlc, i, cfg) {
+ FOREACH_BSS(wlc, i, cfg)
if (cfg->tk_cm_dt) {
cfg->tk_cm_dt--;
}
if (cfg->tk_cm_bt) {
cfg->tk_cm_bt--;
}
- }
+ END_FOREACH_BSS()
/* Call any registered watchdog handlers */
for (i = 0; i < BRCMS_MAXMODULES; i++) {
mboolset(wlc->pub->radio_disabled,
WL_RADIO_HW_DISABLE);
- FOREACH_BSS(wlc, idx, bsscfg) {
+ FOREACH_BSS(wlc, idx, bsscfg)
if (!BSSCFG_STA(bsscfg)
|| !bsscfg->enable || !bsscfg->BSS)
continue;
": rfdisable -> "
"bsscfg_disable()\n",
wlc->pub->unit, idx);
- }
+ END_FOREACH_BSS()
}
}
}
struct brcms_bss_cfg *bsscfg;
/* update AP or IBSS beacons */
- FOREACH_BSS(wlc, idx, bsscfg) {
+ FOREACH_BSS(wlc, idx, bsscfg)
if (bsscfg->up && (BSSCFG_AP(bsscfg) || !bsscfg->BSS))
brcms_c_bss_update_beacon(wlc, bsscfg);
- }
+ END_FOREACH_BSS()
}
/* Write ssid into shared memory */
struct brcms_bss_cfg *bsscfg;
/* update AP or IBSS probe responses */
- FOREACH_BSS(wlc, idx, bsscfg) {
+ FOREACH_BSS(wlc, idx, bsscfg)
if (bsscfg->up && (BSSCFG_AP(bsscfg) || !bsscfg->BSS))
brcms_c_bss_update_probe_resp(wlc, bsscfg, suspend);
- }
+ END_FOREACH_BSS()
}
void
int i;
struct brcms_bss_cfg *bsscfg;
- FOREACH_BSS(wlc, i, bsscfg) {
+ FOREACH_BSS(wlc, i, bsscfg)
brcms_c_bsscfg_reprate_init(bsscfg);
- }
+ END_FOREACH_BSS()
}
/* per bsscfg init tx reported rate mechanism */