static void brcms_b_coreinit(struct brcms_c_info *wlc);
/* used by wlc_wakeucode_init() */
-static void wlc_write_inits(struct brcms_c_hw_info *wlc_hw,
+static void brcms_c_write_inits(struct brcms_c_hw_info *wlc_hw,
const struct d11init *inits);
-static void wlc_ucode_write(struct brcms_c_hw_info *wlc_hw, const u32 ucode[],
+static void brcms_ucode_write(struct brcms_c_hw_info *wlc_hw, const u32 ucode[],
const uint nbytes);
-static void wlc_ucode_download(struct brcms_c_hw_info *wlc);
-static void wlc_ucode_txant_set(struct brcms_c_hw_info *wlc_hw);
+static void brcms_ucode_download(struct brcms_c_hw_info *wlc);
+static void brcms_c_ucode_txant_set(struct brcms_c_hw_info *wlc_hw);
/* used by brcms_c_dpc() */
static bool brcms_b_dotxstatus(struct brcms_c_hw_info *wlc, tx_status_t *txs,
static bool brcms_b_recv(struct brcms_c_hw_info *wlc_hw, uint fifo, bool bound);
/* used by brcms_c_down() */
-static void wlc_flushqueues(struct brcms_c_info *wlc);
+static void brcms_c_flushqueues(struct brcms_c_info *wlc);
-static void wlc_write_mhf(struct brcms_c_hw_info *wlc_hw, u16 *mhfs);
-static void wlc_mctrl_reset(struct brcms_c_hw_info *wlc_hw);
+static void brcms_c_write_mhf(struct brcms_c_hw_info *wlc_hw, u16 *mhfs);
+static void brcms_c_mctrl_reset(struct brcms_c_hw_info *wlc_hw);
static void brcms_b_corerev_fifofixup(struct brcms_c_hw_info *wlc_hw);
static bool brcms_b_tx_fifo_suspended(struct brcms_c_hw_info *wlc_hw,
uint tx_fifo);
static void brcms_b_core_phy_clk(struct brcms_c_hw_info *wlc_hw, bool clk);
static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme);
static void brcms_b_detach_dmapio(struct brcms_c_hw_info *wlc_hw);
-static void wlc_ucode_bsinit(struct brcms_c_hw_info *wlc_hw);
-static bool wlc_validboardtype(struct brcms_c_hw_info *wlc);
-static bool wlc_isgoodchip(struct brcms_c_hw_info *wlc_hw);
+static void brcms_c_ucode_bsinit(struct brcms_c_hw_info *wlc_hw);
+static bool brcms_c_validboardtype(struct brcms_c_hw_info *wlc);
+static bool brcms_c_isgoodchip(struct brcms_c_hw_info *wlc_hw);
static bool brcms_b_validate_chip_access(struct brcms_c_hw_info *wlc_hw);
-static char *wlc_get_macaddr(struct brcms_c_hw_info *wlc_hw);
-static void wlc_mhfdef(struct brcms_c_info *wlc, u16 *mhfs, u16 mhf2_init);
-static void wlc_mctrl_write(struct brcms_c_hw_info *wlc_hw);
+static char *brcms_c_get_macaddr(struct brcms_c_hw_info *wlc_hw);
+static void brcms_c_mhfdef(struct brcms_c_info *wlc, u16 *mhfs, u16 mhf2_init);
+static void brcms_c_mctrl_write(struct brcms_c_hw_info *wlc_hw);
static void brcms_b_mute(struct brcms_c_hw_info *wlc_hw, bool want,
mbool flags);
-static void wlc_ucode_mute_override_set(struct brcms_c_hw_info *wlc_hw);
-static void wlc_ucode_mute_override_clear(struct brcms_c_hw_info *wlc_hw);
-static u32 wlc_wlintrsoff(struct brcms_c_info *wlc);
-static void wlc_wlintrsrestore(struct brcms_c_info *wlc, u32 macintmask);
-static void wlc_gpio_init(struct brcms_c_info *wlc);
-static void wlc_write_hw_bcntemplate0(struct brcms_c_hw_info *wlc_hw, void *bcn,
- int len);
-static void wlc_write_hw_bcntemplate1(struct brcms_c_hw_info *wlc_hw, void *bcn,
- int len);
+static void brcms_c_ucode_mute_override_set(struct brcms_c_hw_info *wlc_hw);
+static void brcms_c_ucode_mute_override_clear(struct brcms_c_hw_info *wlc_hw);
+static u32 brcms_c_wlintrsoff(struct brcms_c_info *wlc);
+static void brcms_c_wlintrsrestore(struct brcms_c_info *wlc, u32 macintmask);
+static void brcms_c_gpio_init(struct brcms_c_info *wlc);
+static void brcms_c_write_hw_bcntemplate0(struct brcms_c_hw_info *wlc_hw,
+ void *bcn, int len);
+static void brcms_c_write_hw_bcntemplate1(struct brcms_c_hw_info *wlc_hw,
+ void *bcn, int len);
static void brcms_b_bsinit(struct brcms_c_info *wlc, chanspec_t chanspec);
-static u32 wlc_setband_inact(struct brcms_c_info *wlc, uint bandunit);
+static u32 brcms_c_setband_inact(struct brcms_c_info *wlc, uint bandunit);
static void brcms_b_setband(struct brcms_c_hw_info *wlc_hw, uint bandunit,
chanspec_t chanspec);
static void brcms_b_update_slot_timing(struct brcms_c_hw_info *wlc_hw,
bool shortslot);
-static void wlc_upd_ofdm_pctl1_table(struct brcms_c_hw_info *wlc_hw);
+static void brcms_upd_ofdm_pctl1_table(struct brcms_c_hw_info *wlc_hw);
static u16 brcms_b_ofdm_ratetable_offset(struct brcms_c_hw_info *wlc_hw,
u8 rate);
}
}
-static void WLBANDINITFN(wlc_ucode_bsinit) (struct brcms_c_hw_info *wlc_hw)
+static void WLBANDINITFN(brcms_c_ucode_bsinit) (struct brcms_c_hw_info *wlc_hw)
{
struct wiphy *wiphy = wlc_hw->wlc->wiphy;
/* init microcode host flags */
- wlc_write_mhf(wlc_hw, wlc_hw->band->mhfs);
+ brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs);
/* do band-specific ucode IHR, SHM, and SCR inits */
if (D11REV_IS(wlc_hw->corerev, 23)) {
if (WLCISNPHY(wlc_hw->band)) {
- wlc_write_inits(wlc_hw, d11n0bsinitvals16);
+ brcms_c_write_inits(wlc_hw, d11n0bsinitvals16);
} else {
wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
" %d\n", __func__, wlc_hw->unit,
} else {
if (D11REV_IS(wlc_hw->corerev, 24)) {
if (WLCISLCNPHY(wlc_hw->band)) {
- wlc_write_inits(wlc_hw, d11lcn0bsinitvals24);
+ brcms_c_write_inits(wlc_hw,
+ d11lcn0bsinitvals24);
} else
wiphy_err(wiphy, "%s: wl%d: unsupported phy in"
" core rev %d\n", __func__,
}
/* switch to new band but leave it inactive */
-static u32 WLBANDINITFN(wlc_setband_inact) (struct brcms_c_info *wlc,
+static u32 WLBANDINITFN(brcms_c_setband_inact) (struct brcms_c_info *wlc,
uint bandunit)
{
struct brcms_c_hw_info *wlc_hw = wlc->hw;
}
/* initial ucode host flags */
- wlc_mhfdef(wlc, wlc_hw->band->mhfs, pio_mhf2);
+ brcms_c_mhfdef(wlc, wlc_hw->band->mhfs, pio_mhf2);
return true;
}
wlc->regs = wlc_hw->regs;
/* validate chip, chiprev and corerev */
- if (!wlc_isgoodchip(wlc_hw)) {
+ if (!brcms_c_isgoodchip(wlc_hw)) {
err = 13;
goto fail;
}
if (j == BOARDREV_PROMOTABLE)
j = BOARDREV_PROMOTED;
wlc_hw->boardrev = (u16) j;
- if (!wlc_validboardtype(wlc_hw)) {
+ if (!brcms_c_validboardtype(wlc_hw)) {
wiphy_err(wiphy, "wl%d: brcms_b_attach: Unsupported Broadcom "
"board type (0x%x)" " or revision level (0x%x)\n",
unit, wlc_hw->sih->boardtype, wlc_hw->boardrev);
ai_pci_down(wlc_hw->sih);
/* register sb interrupt callback functions */
- ai_register_intr_callback(wlc_hw->sih, (void *)wlc_wlintrsoff,
- (void *)wlc_wlintrsrestore, NULL, wlc);
+ ai_register_intr_callback(wlc_hw->sih, (void *)brcms_c_wlintrsoff,
+ (void *)brcms_c_wlintrsrestore, NULL, wlc);
/* turn off pll and xtal to match driver "down" state */
brcms_b_xtal(wlc_hw, OFF);
*/
/* init etheraddr state variables */
- macaddr = wlc_get_macaddr(wlc_hw);
+ macaddr = brcms_c_get_macaddr(wlc_hw);
if (macaddr == NULL) {
wiphy_err(wiphy, "wl%d: brcms_b_attach: macaddr not found\n",
unit);
brcms_b_corereset(wlc_hw, WLC_USE_COREFLAGS);
/* purge the dma rings */
- wlc_flushqueues(wlc_hw->wlc);
+ brcms_c_flushqueues(wlc_hw->wlc);
brcms_c_reset_bmac_done(wlc_hw->wlc);
}
wlc_phy_hw_clk_state_upd(wlc_hw->band->pi, false);
/* reclaim any posted packets */
- wlc_flushqueues(wlc_hw->wlc);
+ brcms_c_flushqueues(wlc_hw->wlc);
} else {
/* Reset and disable the core */
/* set initial host flags value */
static void
-wlc_mhfdef(struct brcms_c_info *wlc, u16 *mhfs, u16 mhf2_init)
+brcms_c_mhfdef(struct brcms_c_info *wlc, u16 *mhfs, u16 mhf2_init)
{
struct brcms_c_hw_info *wlc_hw = wlc->hw;
return band->mhfs[idx];
}
-static void wlc_write_mhf(struct brcms_c_hw_info *wlc_hw, u16 *mhfs)
+static void brcms_c_write_mhf(struct brcms_c_hw_info *wlc_hw, u16 *mhfs)
{
u8 idx;
u16 addr[] = {
/* set the maccontrol register to desired reset state and
* initialize the sw cache of the register
*/
-static void wlc_mctrl_reset(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_mctrl_reset(struct brcms_c_hw_info *wlc_hw)
{
/* IHR accesses are always enabled, PSM disabled, HPS off and WAKE on */
wlc_hw->maccontrol = 0;
wlc_hw->maccontrol = new_maccontrol;
/* write the new values with overrides applied */
- wlc_mctrl_write(wlc_hw);
+ brcms_c_mctrl_write(wlc_hw);
}
/* write the software state of maccontrol and overrides to the maccontrol register */
-static void wlc_mctrl_write(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_mctrl_write(struct brcms_c_hw_info *wlc_hw)
{
u32 maccontrol = wlc_hw->maccontrol;
W_REG(&wlc_hw->regs->maccontrol, maccontrol);
}
-void wlc_ucode_wake_override_set(struct brcms_c_hw_info *wlc_hw,
+void brcms_c_ucode_wake_override_set(struct brcms_c_hw_info *wlc_hw,
u32 override_bit)
{
if (wlc_hw->wake_override || (wlc_hw->maccontrol & MCTL_WAKE)) {
mboolset(wlc_hw->wake_override, override_bit);
- wlc_mctrl_write(wlc_hw);
+ brcms_c_mctrl_write(wlc_hw);
brcms_b_wait_for_wake(wlc_hw);
return;
}
-void wlc_ucode_wake_override_clear(struct brcms_c_hw_info *wlc_hw,
+void brcms_c_ucode_wake_override_clear(struct brcms_c_hw_info *wlc_hw,
u32 override_bit)
{
mboolclr(wlc_hw->wake_override, override_bit);
if (wlc_hw->wake_override || (wlc_hw->maccontrol & MCTL_WAKE))
return;
- wlc_mctrl_write(wlc_hw);
+ brcms_c_mctrl_write(wlc_hw);
return;
}
* STA 0 1 <--- This will ensure no beacons
* IBSS 0 0
*/
-static void wlc_ucode_mute_override_set(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_ucode_mute_override_set(struct brcms_c_hw_info *wlc_hw)
{
wlc_hw->mute_override = 1;
if ((wlc_hw->maccontrol & (MCTL_AP | MCTL_INFRA)) == MCTL_INFRA)
return;
- wlc_mctrl_write(wlc_hw);
+ brcms_c_mctrl_write(wlc_hw);
return;
}
/* Clear the override on AP and INFRA bits */
-static void wlc_ucode_mute_override_clear(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_ucode_mute_override_clear(struct brcms_c_hw_info *wlc_hw)
{
if (wlc_hw->mute_override == 0)
return;
if ((wlc_hw->maccontrol & (MCTL_AP | MCTL_INFRA)) == MCTL_INFRA)
return;
- wlc_mctrl_write(wlc_hw);
+ brcms_c_mctrl_write(wlc_hw);
}
/*
}
static void
-wlc_write_hw_bcntemplate0(struct brcms_c_hw_info *wlc_hw, void *bcn, int len)
+brcms_c_write_hw_bcntemplate0(struct brcms_c_hw_info *wlc_hw, void *bcn,
+ int len)
{
d11regs_t *regs = wlc_hw->regs;
}
static void
-wlc_write_hw_bcntemplate1(struct brcms_c_hw_info *wlc_hw, void *bcn, int len)
+brcms_c_write_hw_bcntemplate1(struct brcms_c_hw_info *wlc_hw, void *bcn,
+ int len)
{
d11regs_t *regs = wlc_hw->regs;
d11regs_t *regs = wlc_hw->regs;
if (both) {
- wlc_write_hw_bcntemplate0(wlc_hw, bcn, len);
- wlc_write_hw_bcntemplate1(wlc_hw, bcn, len);
+ brcms_c_write_hw_bcntemplate0(wlc_hw, bcn, len);
+ brcms_c_write_hw_bcntemplate1(wlc_hw, bcn, len);
} else {
/* bcn 0 */
if (!(R_REG(®s->maccommand) & MCMD_BCN0VLD))
- wlc_write_hw_bcntemplate0(wlc_hw, bcn, len);
+ brcms_c_write_hw_bcntemplate0(wlc_hw, bcn, len);
/* bcn 1 */
else if (!
(R_REG(®s->maccommand) & MCMD_BCN1VLD))
- wlc_write_hw_bcntemplate1(wlc_hw, bcn, len);
+ brcms_c_write_hw_bcntemplate1(wlc_hw, bcn, len);
}
}
BCMMSG(wlc->wiphy, "wl%d: bandunit %d\n", wlc_hw->unit,
wlc_hw->band->bandunit);
- wlc_ucode_bsinit(wlc_hw);
+ brcms_c_ucode_bsinit(wlc_hw);
wlc_phy_init(wlc_hw->band->pi, chanspec);
- wlc_ucode_txant_set(wlc_hw);
+ brcms_c_ucode_txant_set(wlc_hw);
/* cwmin is band-specific, update hardware with value for current band */
brcms_b_set_cwmin(wlc_hw, wlc_hw->band->CWmin);
brcms_b_write_shm(wlc_hw, M_PHYVER, (u16) wlc_hw->band->phyrev);
/* initialize the txphyctl1 rate table since shmem is shared between bands */
- wlc_upd_ofdm_pctl1_table(wlc_hw);
+ brcms_upd_ofdm_pctl1_table(wlc_hw);
brcms_b_upd_synthpu(wlc_hw);
}
/* Enable the d11 core before accessing it */
if (!ai_iscoreup(wlc_hw->sih)) {
ai_core_reset(wlc_hw->sih, 0, 0);
- wlc_mctrl_reset(wlc_hw);
+ brcms_c_mctrl_reset(wlc_hw);
}
- macintmask = wlc_setband_inact(wlc, bandunit);
+ macintmask = brcms_c_setband_inact(wlc, bandunit);
if (!wlc_hw->up)
return;
}
}
-static bool wlc_isgoodchip(struct brcms_c_hw_info *wlc_hw)
+static bool brcms_c_isgoodchip(struct brcms_c_hw_info *wlc_hw)
{
/* reject unsupported corerev */
return true;
}
-static bool wlc_validboardtype(struct brcms_c_hw_info *wlc_hw)
+static bool brcms_c_validboardtype(struct brcms_c_hw_info *wlc_hw)
{
bool goodboard = true;
uint boardrev = wlc_hw->boardrev;
return goodboard;
}
-static char *wlc_get_macaddr(struct brcms_c_hw_info *wlc_hw)
+static char *brcms_c_get_macaddr(struct brcms_c_hw_info *wlc_hw)
{
const char *varname = "macaddr";
char *macaddr;
(d11regs_t *) ai_setcore(wlc_hw->sih, D11_CORE_ID,
0);
ai_core_reset(wlc_hw->sih, flags, resetbits);
- wlc_mctrl_reset(wlc_hw);
+ brcms_c_mctrl_reset(wlc_hw);
}
v = ((R_REG(&wlc_hw->regs->phydebug) & PDBG_RFD) != 0);
if (wlc_hw->band && wlc_hw->band->pi)
wlc_phy_hw_clk_state_upd(wlc_hw->band->pi, true);
- wlc_mctrl_reset(wlc_hw);
+ brcms_c_mctrl_reset(wlc_hw);
if (PMUCTL_ENAB(wlc_hw->sih))
brcms_b_clkctl_clk(wlc_hw, CLK_FAST);
/* reset PSM */
brcms_b_mctrl(wlc_hw, ~0, (MCTL_IHR_EN | MCTL_PSM_JMP_0 | MCTL_WAKE));
- wlc_ucode_download(wlc_hw);
+ brcms_ucode_download(wlc_hw);
/*
* FIFOSZ fixup. driver wants to controls the fifo allocation.
*/
wiphy_err(wiphy, "wl%d: wlc_coreinit: ucode did not self-"
"suspend!\n", wlc_hw->unit);
- wlc_gpio_init(wlc);
+ brcms_c_gpio_init(wlc);
sflags = ai_core_sflags(wlc_hw->sih, 0, 0);
if (D11REV_IS(wlc_hw->corerev, 23)) {
if (WLCISNPHY(wlc_hw->band))
- wlc_write_inits(wlc_hw, d11n0initvals16);
+ brcms_c_write_inits(wlc_hw, d11n0initvals16);
else
wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
" %d\n", __func__, wlc_hw->unit,
wlc_hw->corerev);
} else if (D11REV_IS(wlc_hw->corerev, 24)) {
if (WLCISLCNPHY(wlc_hw->band)) {
- wlc_write_inits(wlc_hw, d11lcn0initvals24);
+ brcms_c_write_inits(wlc_hw, d11lcn0initvals24);
} else {
wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
" %d\n", __func__, wlc_hw->unit,
}
/* Initialize GPIOs that are controlled by D11 core */
-static void wlc_gpio_init(struct brcms_c_info *wlc)
+static void brcms_c_gpio_init(struct brcms_c_info *wlc)
{
struct brcms_c_hw_info *wlc_hw = wlc->hw;
d11regs_t *regs;
ai_gpiocontrol(wlc_hw->sih, gm, gc, GPIO_DRV_PRIORITY);
}
-static void wlc_ucode_download(struct brcms_c_hw_info *wlc_hw)
+static void brcms_ucode_download(struct brcms_c_hw_info *wlc_hw)
{
struct brcms_c_info *wlc;
wlc = wlc_hw->wlc;
if (D11REV_IS(wlc_hw->corerev, 23)) {
if (WLCISNPHY(wlc_hw->band)) {
- wlc_ucode_write(wlc_hw, bcm43xx_16_mimo,
+ brcms_ucode_write(wlc_hw, bcm43xx_16_mimo,
bcm43xx_16_mimosz);
wlc_hw->ucode_loaded = true;
} else
__func__, wlc_hw->unit, wlc_hw->corerev);
} else if (D11REV_IS(wlc_hw->corerev, 24)) {
if (WLCISLCNPHY(wlc_hw->band)) {
- wlc_ucode_write(wlc_hw, bcm43xx_24_lcn,
+ brcms_ucode_write(wlc_hw, bcm43xx_24_lcn,
bcm43xx_24_lcnsz);
wlc_hw->ucode_loaded = true;
} else {
}
}
-static void wlc_ucode_write(struct brcms_c_hw_info *wlc_hw, const u32 ucode[],
+static void brcms_ucode_write(struct brcms_c_hw_info *wlc_hw, const u32 ucode[],
const uint nbytes) {
d11regs_t *regs = wlc_hw->regs;
uint i;
W_REG(®s->objdata, ucode[i]);
}
-static void wlc_write_inits(struct brcms_c_hw_info *wlc_hw,
+static void brcms_c_write_inits(struct brcms_c_hw_info *wlc_hw,
const struct d11init *inits)
{
int i;
}
}
-static void wlc_ucode_txant_set(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_ucode_txant_set(struct brcms_c_hw_info *wlc_hw)
{
u16 phyctl;
u16 phytxant = wlc_hw->bmac_phytxant;
/* push to ucode if up */
if (!wlc_hw->up)
return;
- wlc_ucode_txant_set(wlc_hw);
+ brcms_c_ucode_txant_set(wlc_hw);
}
* but also because per-port code may require sync with valid interrupt.
*/
-static u32 wlc_wlintrsoff(struct brcms_c_info *wlc)
+static u32 brcms_c_wlintrsoff(struct brcms_c_info *wlc)
{
if (!wlc->hw->up)
return 0;
return brcms_intrsoff(wlc->wl);
}
-static void wlc_wlintrsrestore(struct brcms_c_info *wlc, u32 macintmask)
+static void brcms_c_wlintrsrestore(struct brcms_c_info *wlc, u32 macintmask)
{
if (!wlc->hw->up)
return;
wlc_phy_mute_upd(wlc_hw->band->pi, on, flags);
if (on)
- wlc_ucode_mute_override_set(wlc_hw);
+ brcms_c_ucode_mute_override_set(wlc_hw);
else
- wlc_ucode_mute_override_clear(wlc_hw);
+ brcms_c_ucode_mute_override_clear(wlc_hw);
}
int brcms_b_xmtfifo_sz_get(struct brcms_c_hw_info *wlc_hw, uint fifo,
/* force the core awake only if not already */
if (wlc_hw->suspended_fifos == 0)
- wlc_ucode_wake_override_set(wlc_hw, WLC_WAKE_OVERRIDE_TXFIFO);
+ brcms_c_ucode_wake_override_set(wlc_hw,
+ WLC_WAKE_OVERRIDE_TXFIFO);
wlc_hw->suspended_fifos |= fifo;
else {
wlc_hw->suspended_fifos &= ~(1 << tx_fifo);
if (wlc_hw->suspended_fifos == 0)
- wlc_ucode_wake_override_clear(wlc_hw,
+ brcms_c_ucode_wake_override_clear(wlc_hw,
WLC_WAKE_OVERRIDE_TXFIFO);
}
}
return;
/* force the core awake */
- wlc_ucode_wake_override_set(wlc_hw, WLC_WAKE_OVERRIDE_MACSUSPEND);
+ brcms_c_ucode_wake_override_set(wlc_hw, WLC_WAKE_OVERRIDE_MACSUSPEND);
mc = R_REG(®s->maccontrol);
mi = R_REG(®s->macintstatus);
WARN_ON(mi & MI_MACSSPNDD);
- wlc_ucode_wake_override_clear(wlc_hw, WLC_WAKE_OVERRIDE_MACSUSPEND);
+ brcms_c_ucode_wake_override_clear(wlc_hw, WLC_WAKE_OVERRIDE_MACSUSPEND);
}
-static void wlc_upd_ofdm_pctl1_table(struct brcms_c_hw_info *wlc_hw)
+static void brcms_upd_ofdm_pctl1_table(struct brcms_c_hw_info *wlc_hw)
{
u8 rate;
u8 rates[8] = {
wlc_hw->hw_stf_ss_opmode = stf_mode;
if (wlc_hw->clk)
- wlc_upd_ofdm_pctl1_table(wlc_hw);
+ brcms_upd_ofdm_pctl1_table(wlc_hw);
}
void
}
}
-static void wlc_flushqueues(struct brcms_c_info *wlc)
+static void brcms_c_flushqueues(struct brcms_c_info *wlc)
{
struct brcms_c_hw_info *wlc_hw = wlc->hw;
uint i;
#define WLC_REPLAY_CNTRS_VALUE WPA_CAP_16_REPLAY_CNTRS
/* local prototypes */
-static u16 wlc_d11hdrs_mac80211(struct brcms_c_info *wlc,
+static u16 brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc,
struct ieee80211_hw *hw,
struct sk_buff *p,
struct scb *scb, uint frag,
uint next_frag_len,
wsec_key_t *key,
ratespec_t rspec_override);
-static void wlc_bss_default_init(struct brcms_c_info *wlc);
-static void wlc_ucode_mac_upd(struct brcms_c_info *wlc);
+static void brcms_c_bss_default_init(struct brcms_c_info *wlc);
+static void brcms_c_ucode_mac_upd(struct brcms_c_info *wlc);
static ratespec_t mac80211_wlc_set_nrate(struct brcms_c_info *wlc,
struct brcms_c_band *cur_band,
u32 int_val);
-static void wlc_tx_prec_map_init(struct brcms_c_info *wlc);
-static void wlc_watchdog(void *arg);
-static void wlc_watchdog_by_timer(void *arg);
-static u16 wlc_rate_shm_offset(struct brcms_c_info *wlc, u8 rate);
-static int wlc_set_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs_arg);
-static u8 wlc_local_constraint_qdbm(struct brcms_c_info *wlc);
+static void brcms_c_tx_prec_map_init(struct brcms_c_info *wlc);
+static void brcms_c_watchdog(void *arg);
+static void brcms_c_watchdog_by_timer(void *arg);
+static u16 brcms_c_rate_shm_offset(struct brcms_c_info *wlc, u8 rate);
+static int brcms_c_set_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs_arg);
+static u8 brcms_c_local_constraint_qdbm(struct brcms_c_info *wlc);
/* send and receive */
-static struct brcms_c_txq_info *wlc_txq_alloc(struct brcms_c_info *wlc);
-static void wlc_txq_free(struct brcms_c_info *wlc,
+static struct brcms_c_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc);
+static void brcms_c_txq_free(struct brcms_c_info *wlc,
struct brcms_c_txq_info *qi);
-static void wlc_txflowcontrol_signal(struct brcms_c_info *wlc,
+static void brcms_c_txflowcontrol_signal(struct brcms_c_info *wlc,
struct brcms_c_txq_info *qi,
bool on, int prio);
-static void wlc_txflowcontrol_reset(struct brcms_c_info *wlc);
-static void wlc_compute_cck_plcp(struct brcms_c_info *wlc, ratespec_t rate,
+static void brcms_c_txflowcontrol_reset(struct brcms_c_info *wlc);
+static void brcms_c_compute_cck_plcp(struct brcms_c_info *wlc, ratespec_t rate,
uint length, u8 *plcp);
-static void wlc_compute_ofdm_plcp(ratespec_t rate, uint length, u8 *plcp);
-static void wlc_compute_mimo_plcp(ratespec_t rate, uint length, u8 *plcp);
-static u16 wlc_compute_frame_dur(struct brcms_c_info *wlc, ratespec_t rate,
+static void brcms_c_compute_ofdm_plcp(ratespec_t rate, uint length, u8 *plcp);
+static void brcms_c_compute_mimo_plcp(ratespec_t rate, uint length, u8 *plcp);
+static u16 brcms_c_compute_frame_dur(struct brcms_c_info *wlc, ratespec_t rate,
u8 preamble_type, uint next_frag_len);
-static u64 wlc_recover_tsf64(struct brcms_c_info *wlc,
+static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
struct wlc_d11rxhdr *rxh);
-static void wlc_recvctl(struct brcms_c_info *wlc,
+static void brcms_c_recvctl(struct brcms_c_info *wlc,
d11rxhdr_t *rxh, struct sk_buff *p);
-static uint wlc_calc_frame_len(struct brcms_c_info *wlc, ratespec_t rate,
+static uint brcms_c_calc_frame_len(struct brcms_c_info *wlc, ratespec_t rate,
u8 preamble_type, uint dur);
-static uint wlc_calc_ack_time(struct brcms_c_info *wlc, ratespec_t rate,
+static uint brcms_c_calc_ack_time(struct brcms_c_info *wlc, ratespec_t rate,
u8 preamble_type);
-static uint wlc_calc_cts_time(struct brcms_c_info *wlc, ratespec_t rate,
+static uint brcms_c_calc_cts_time(struct brcms_c_info *wlc, ratespec_t rate,
u8 preamble_type);
/* interrupt, up/down, band */
-static void wlc_setband(struct brcms_c_info *wlc, uint bandunit);
-static chanspec_t wlc_init_chanspec(struct brcms_c_info *wlc);
-static void wlc_bandinit_ordered(struct brcms_c_info *wlc, chanspec_t chanspec);
-static void wlc_bsinit(struct brcms_c_info *wlc);
-static int wlc_duty_cycle_set(struct brcms_c_info *wlc, int duty_cycle,
+static void brcms_c_setband(struct brcms_c_info *wlc, uint bandunit);
+static chanspec_t brcms_c_init_chanspec(struct brcms_c_info *wlc);
+static void brcms_c_bandinit_ordered(struct brcms_c_info *wlc,
+ chanspec_t chanspec);
+static void brcms_c_bsinit(struct brcms_c_info *wlc);
+static int brcms_c_duty_cycle_set(struct brcms_c_info *wlc, int duty_cycle,
bool isOFDM, bool writeToShm);
-static void wlc_radio_hwdisable_upd(struct brcms_c_info *wlc);
-static bool wlc_radio_monitor_start(struct brcms_c_info *wlc);
-static void wlc_radio_timer(void *arg);
-static void wlc_radio_enable(struct brcms_c_info *wlc);
-static void wlc_radio_upd(struct brcms_c_info *wlc);
+static void brcms_c_radio_hwdisable_upd(struct brcms_c_info *wlc);
+static bool brcms_c_radio_monitor_start(struct brcms_c_info *wlc);
+static void brcms_c_radio_timer(void *arg);
+static void brcms_c_radio_enable(struct brcms_c_info *wlc);
+static void brcms_c_radio_upd(struct brcms_c_info *wlc);
/* scan, association, BSS */
-static uint wlc_calc_ba_time(struct brcms_c_info *wlc, ratespec_t rate,
+static uint brcms_c_calc_ba_time(struct brcms_c_info *wlc, ratespec_t rate,
u8 preamble_type);
-static void wlc_update_mimo_band_bwcap(struct brcms_c_info *wlc, u8 bwcap);
-static void wlc_ht_update_sgi_rx(struct brcms_c_info *wlc, int val);
-static void wlc_ht_update_ldpc(struct brcms_c_info *wlc, s8 val);
-static void wlc_war16165(struct brcms_c_info *wlc, bool tx);
-
-static void wlc_wme_retries_write(struct brcms_c_info *wlc);
-static bool wlc_attach_stf_ant_init(struct brcms_c_info *wlc);
-static uint wlc_attach_module(struct brcms_c_info *wlc);
-static void wlc_detach_module(struct brcms_c_info *wlc);
-static void wlc_timers_deinit(struct brcms_c_info *wlc);
-static void wlc_down_led_upd(struct brcms_c_info *wlc);
-static uint wlc_down_del_timer(struct brcms_c_info *wlc);
-static void wlc_ofdm_rateset_war(struct brcms_c_info *wlc);
-static int _wlc_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
+static void brcms_c_update_mimo_band_bwcap(struct brcms_c_info *wlc, u8 bwcap);
+static void brcms_c_ht_update_sgi_rx(struct brcms_c_info *wlc, int val);
+static void brcms_c_ht_update_ldpc(struct brcms_c_info *wlc, s8 val);
+static void brcms_c_war16165(struct brcms_c_info *wlc, bool tx);
+
+static void brcms_c_wme_retries_write(struct brcms_c_info *wlc);
+static bool brcms_c_attach_stf_ant_init(struct brcms_c_info *wlc);
+static uint brcms_c_attach_module(struct brcms_c_info *wlc);
+static void brcms_c_detach_module(struct brcms_c_info *wlc);
+static void brcms_c_timers_deinit(struct brcms_c_info *wlc);
+static void brcms_c_down_led_upd(struct brcms_c_info *wlc);
+static uint brcms_c_down_del_timer(struct brcms_c_info *wlc);
+static void brcms_c_ofdm_rateset_war(struct brcms_c_info *wlc);
+static int _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
struct brcms_c_if *wlcif);
/* conditions under which the PM bit should be set in outgoing frames and STAY_AWAKE is meaningful
* if other configurations are in conflict (bandlocked, 11n mode disabled,
* invalid channel for current country, etc.)
*/
-static chanspec_t wlc_init_chanspec(struct brcms_c_info *wlc)
+static chanspec_t brcms_c_init_chanspec(struct brcms_c_info *wlc)
{
chanspec_t chanspec =
1 | WL_CHANSPEC_BW_20 | WL_CHANSPEC_CTL_SB_NONE |
struct scb global_scb;
-static void wlc_init_scb(struct brcms_c_info *wlc, struct scb *scb)
+static void brcms_c_init_scb(struct brcms_c_info *wlc, struct scb *scb)
{
int i;
scb->flags = SCB_WMECAP | SCB_HTCAP;
if (wlc->pub->associated)
chanspec = wlc->home_chanspec;
else
- chanspec = wlc_init_chanspec(wlc);
+ chanspec = brcms_c_init_chanspec(wlc);
brcms_b_init(wlc->hw, chanspec, mute);
}
}
- wlc_bandinit_ordered(wlc, chanspec);
+ brcms_c_bandinit_ordered(wlc, chanspec);
- wlc_init_scb(wlc, &global_scb);
+ brcms_c_init_scb(wlc, &global_scb);
/* init probe response timeout */
brcms_c_write_shm(wlc, M_PRS_MAXTIME, wlc->prb_resp_timeout);
_rifs ? (EDCF_AC_VO_TXOP_AP << 5) : MAXFRAMEBURST_TXOP));
/* initialize maximum allowed duty cycle */
- wlc_duty_cycle_set(wlc, wlc->tx_duty_cycle_ofdm, true, true);
- wlc_duty_cycle_set(wlc, wlc->tx_duty_cycle_cck, false, true);
+ brcms_c_duty_cycle_set(wlc, wlc->tx_duty_cycle_ofdm, true, true);
+ brcms_c_duty_cycle_set(wlc, wlc->tx_duty_cycle_cck, false, true);
/* Update some shared memory locations related to max AMPDU size allowed to received */
brcms_c_ampdu_shm_upd(wlc->ampdu);
/* band-specific inits */
- wlc_bsinit(wlc);
+ brcms_c_bsinit(wlc);
/* Enable EDCF mode (while the MAC is suspended) */
if (EDCF_ENAB(wlc->pub)) {
}
/* Init precedence maps for empty FIFOs */
- wlc_tx_prec_map_init(wlc);
+ brcms_c_tx_prec_map_init(wlc);
/* read the ucode version if we have not yet done so */
if (wlc->ucode_rev == 0) {
brcms_c_enable_mac(wlc);
/* clear tx flow control */
- wlc_txflowcontrol_reset(wlc);
+ brcms_c_txflowcontrol_reset(wlc);
/* clear tx data fifo suspends */
wlc->tx_suspended = false;
}
#ifdef SUPPORT_HWKEYS
else if (BSSCFG_STA(cfg) && cfg->BSS) {
- wlc_rcmta_add_bssid(wlc, cfg);
+ brcms_c_rcmta_add_bssid(wlc, cfg);
}
#endif
}
brcms_b_set_shortslot(wlc->hw, shortslot);
}
-static u8 wlc_local_constraint_qdbm(struct brcms_c_info *wlc)
+static u8 brcms_c_local_constraint_qdbm(struct brcms_c_info *wlc)
{
u8 local;
s16 local_max;
}
}
-static void wlc_set_phy_chanspec(struct brcms_c_info *wlc, chanspec_t chanspec)
+static void brcms_c_set_phy_chanspec(struct brcms_c_info *wlc,
+ chanspec_t chanspec)
{
/* Save our copy of the chanspec */
wlc->chanspec = chanspec;
* any 11h local tx power constraints.
*/
brcms_c_channel_set_chanspec(wlc->cmi, chanspec,
- wlc_local_constraint_qdbm(wlc));
+ brcms_c_local_constraint_qdbm(wlc));
if (wlc->stf->ss_algosel_auto)
brcms_c_stf_ss_algo_channel_get(wlc, &wlc->stf->ss_algo_channel,
/*
* should the setband call come after the
* brcms_b_chanspec() ? if the setband updates
- * (wlc_bsinit) use low level calls to inspect and
+ * (brcms_c_bsinit) use low level calls to inspect and
* set state, the state inspected may be from the wrong
* band, or the following brcms_b_set_chanspec() may
* undo the work.
*/
- wlc_setband(wlc, bandunit);
+ brcms_c_setband(wlc, bandunit);
}
}
/* sync up phy/radio chanspec */
- wlc_set_phy_chanspec(wlc, chanspec);
+ brcms_c_set_phy_chanspec(wlc, chanspec);
/* init antenna selection */
if (CHSPEC_WLC_BW(old_chanspec) != CHSPEC_WLC_BW(chanspec)) {
}
/* update some mac configuration since chanspec changed */
- wlc_ucode_mac_upd(wlc);
+ brcms_c_ucode_mac_upd(wlc);
}
ratespec_t brcms_c_lowest_basic_rspec(struct brcms_c_info *wlc,
}
-static void wlc_ht_update_sgi_rx(struct brcms_c_info *wlc, int val)
+static void brcms_c_ht_update_sgi_rx(struct brcms_c_info *wlc, int val)
{
wlc->ht_cap.cap_info &= ~(IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40);
}
}
-static void wlc_ht_update_ldpc(struct brcms_c_info *wlc, s8 val)
+static void brcms_c_ht_update_ldpc(struct brcms_c_info *wlc, s8 val)
{
wlc->stf->ldpc = val;
* ucode, hwmac update
* Channel dependent updates for ucode and hw
*/
-static void wlc_ucode_mac_upd(struct brcms_c_info *wlc)
+static void brcms_c_ucode_mac_upd(struct brcms_c_info *wlc)
{
/* enable or disable any active IBSSs depending on whether or not
* we are on the home channel
brcms_c_mac_promisc(wlc);
}
-static void wlc_bandinit_ordered(struct brcms_c_info *wlc, chanspec_t chanspec)
+static void brcms_c_bandinit_ordered(struct brcms_c_info *wlc,
+ chanspec_t chanspec)
{
wlc_rateset_t default_rateset;
uint parkband;
* figure out the right band to park on
*/
if (wlc->bandlocked || NBANDS(wlc) == 1) {
- parkband = wlc->band->bandunit; /* updated in wlc_bandlock() */
+ /* updated in brcms_c_bandlock() */
+ parkband = wlc->band->bandunit;
band_order[0] = band_order[1] = parkband;
} else {
/* park on the band of the specified chanspec */
}
/* sync up phy/radio chanspec */
- wlc_set_phy_chanspec(wlc, chanspec);
+ brcms_c_set_phy_chanspec(wlc, chanspec);
}
/* band-specific init */
-static void WLBANDINITFN(wlc_bsinit) (struct brcms_c_info *wlc)
+static void WLBANDINITFN(brcms_c_bsinit) (struct brcms_c_info *wlc)
{
BCMMSG(wlc->wiphy, "wl%d: bandunit %d\n",
wlc->pub->unit, wlc->band->bandunit);
brcms_c_set_ratetable(wlc);
/* update some band specific mac configuration */
- wlc_ucode_mac_upd(wlc);
+ brcms_c_ucode_mac_upd(wlc);
/* init antenna selection */
brcms_c_antsel_init(wlc->asi);
}
/* switch to and initialize new band */
-static void WLBANDINITFN(wlc_setband) (struct brcms_c_info *wlc, uint bandunit)
+static void WLBANDINITFN(brcms_c_setband) (struct brcms_c_info *wlc,
+ uint bandunit)
{
int idx;
struct brcms_c_bsscfg *cfg;
brcms_c_set_ps_ctrl(wlc);
/* band-specific initializations */
- wlc_bsinit(wlc);
+ brcms_c_bsinit(wlc);
}
/* Initialize a WME Parameter Info Element with default STA parameters from WMM Spec, Table 12 */
if (acp_shm.aifs < EDCF_AIFSN_MIN
|| acp_shm.aifs > EDCF_AIFSN_MAX) {
- wiphy_err(wlc->wiphy, "wl%d: wlc_edcf_setparams: bad "
+ wiphy_err(wlc->wiphy, "wl%d: edcf_setparams: bad "
"aifs %d\n", wlc->pub->unit, acp_shm.aifs);
continue;
}
bool brcms_c_timers_init(struct brcms_c_info *wlc, int unit)
{
- wlc->wdtimer = brcms_init_timer(wlc->wl, wlc_watchdog_by_timer,
+ wlc->wdtimer = brcms_init_timer(wlc->wl, brcms_c_watchdog_by_timer,
wlc, "watchdog");
if (!wlc->wdtimer) {
wiphy_err(wlc->wiphy, "wl%d: wl_init_timer for wdtimer "
goto fail;
}
- wlc->radio_timer = brcms_init_timer(wlc->wl, wlc_radio_timer,
+ wlc->radio_timer = brcms_init_timer(wlc->wl, brcms_c_radio_timer,
wlc, "radio");
if (!wlc->radio_timer) {
wiphy_err(wlc->wiphy, "wl%d: wl_init_timer for radio_timer "
wlc->mpc_delay_off = wlc->mpc_dlycnt = WLC_MPC_MIN_DELAYCNT;
}
-static bool wlc_state_bmac_sync(struct brcms_c_info *wlc)
+static bool brcms_c_state_bmac_sync(struct brcms_c_info *wlc)
{
brcms_b_state_t state_bmac;
return true;
}
-static uint wlc_attach_module(struct brcms_c_info *wlc)
+static uint brcms_c_attach_module(struct brcms_c_info *wlc)
{
uint err = 0;
uint unit;
wlc->asi = brcms_c_antsel_attach(wlc);
if (wlc->asi == NULL) {
- wiphy_err(wlc->wiphy, "wl%d: wlc_attach: antsel_attach "
+ wiphy_err(wlc->wiphy, "wl%d: attach: antsel_attach "
"failed\n", unit);
err = 44;
goto fail;
wlc->ampdu = brcms_c_ampdu_attach(wlc);
if (wlc->ampdu == NULL) {
- wiphy_err(wlc->wiphy, "wl%d: wlc_attach: brcms_c_ampdu_attach "
+ wiphy_err(wlc->wiphy, "wl%d: attach: ampdu_attach "
"failed\n", unit);
err = 50;
goto fail;
}
if ((brcms_c_stf_attach(wlc) != 0)) {
- wiphy_err(wlc->wiphy, "wl%d: wlc_attach: wlc_stf_attach "
+ wiphy_err(wlc->wiphy, "wl%d: attach: stf_attach "
"failed\n", unit);
err = 68;
goto fail;
/* for some states, due to different info pointer(e,g, wlc, wlc_hw) or master/slave split,
* HIGH driver(both monolithic and HIGH_ONLY) needs to sync states FROM BMAC portion driver
*/
- if (!wlc_state_bmac_sync(wlc)) {
+ if (!brcms_c_state_bmac_sync(wlc)) {
err = 20;
goto fail;
}
wlc->band = wlc->bandstate[j];
- if (!wlc_attach_stf_ant_init(wlc)) {
+ if (!brcms_c_attach_stf_ant_init(wlc)) {
err = 24;
goto fail;
}
brcms_c_stf_phy_txant_upd(wlc);
/* attach each modules */
- err = wlc_attach_module(wlc);
+ err = brcms_c_attach_module(wlc);
if (err != 0)
goto fail;
if (!brcms_c_timers_init(wlc, unit)) {
- wiphy_err(wl->wiphy, "wl%d: %s: wlc_init_timer failed\n", unit,
+ wiphy_err(wl->wiphy, "wl%d: %s: init_timer failed\n", unit,
__func__);
err = 32;
goto fail;
}
/* init default when all parameters are ready, i.e. ->rateset */
- wlc_bss_default_init(wlc);
+ brcms_c_bss_default_init(wlc);
/*
* Complete the wlc default state initializations..
*/
/* allocate our initial queue */
- wlc->pkt_queue = wlc_txq_alloc(wlc);
+ wlc->pkt_queue = brcms_c_txq_alloc(wlc);
if (wlc->pkt_queue == NULL) {
wiphy_err(wl->wiphy, "wl%d: %s: failed to malloc tx queue\n",
unit, __func__);
wlc->mimo_40txbw = AUTO;
wlc->ofdm_40txbw = AUTO;
wlc->cck_40txbw = AUTO;
- wlc_update_mimo_band_bwcap(wlc, WLC_N_BW_20IN2G_40IN5G);
+ brcms_c_update_mimo_band_bwcap(wlc, WLC_N_BW_20IN2G_40IN5G);
/* Set default values of SGI */
if (WLC_SGI_CAP_PHY(wlc)) {
- wlc_ht_update_sgi_rx(wlc, (WLC_N_SGI_20 | WLC_N_SGI_40));
+ brcms_c_ht_update_sgi_rx(wlc, (WLC_N_SGI_20 | WLC_N_SGI_40));
wlc->sgi_tx = AUTO;
} else if (WLCISSSLPNPHY(wlc->band)) {
- wlc_ht_update_sgi_rx(wlc, (WLC_N_SGI_20 | WLC_N_SGI_40));
+ brcms_c_ht_update_sgi_rx(wlc, (WLC_N_SGI_20 | WLC_N_SGI_40));
wlc->sgi_tx = AUTO;
} else {
- wlc_ht_update_sgi_rx(wlc, 0);
+ brcms_c_ht_update_sgi_rx(wlc, 0);
wlc->sgi_tx = OFF;
}
wlc->sgi_tx = OFF;
if (n_disabled & WLFEATURE_DISABLE_11N_SGI_RX)
- wlc_ht_update_sgi_rx(wlc, 0);
+ brcms_c_ht_update_sgi_rx(wlc, 0);
/* apply the stbc override from nvram conf */
if (n_disabled & WLFEATURE_DISABLE_11N_STBC_TX) {
return NULL;
}
-static void wlc_attach_antgain_init(struct brcms_c_info *wlc)
+static void brcms_c_attach_antgain_init(struct brcms_c_info *wlc)
{
uint unit;
unit = wlc->pub->unit;
}
}
-static bool wlc_attach_stf_ant_init(struct brcms_c_info *wlc)
+static bool brcms_c_attach_stf_ant_init(struct brcms_c_info *wlc)
{
int aa;
uint unit;
/* Compute Antenna Gain */
wlc->band->antgain =
(s8) getintvar(vars, (BAND_5G(bandtype) ? "ag1" : "ag0"));
- wlc_attach_antgain_init(wlc);
+ brcms_c_attach_antgain_init(wlc);
return true;
}
-static void wlc_timers_deinit(struct brcms_c_info *wlc)
+static void brcms_c_timers_deinit(struct brcms_c_info *wlc)
{
/* free timer state */
if (wlc->wdtimer) {
}
}
-static void wlc_detach_module(struct brcms_c_info *wlc)
+static void brcms_c_detach_module(struct brcms_c_info *wlc)
{
if (wlc->asi) {
brcms_c_antsel_detach(wlc->asi);
callbacks += brcms_b_detach(wlc);
/* delete software timers */
- if (!wlc_radio_monitor_stop(wlc))
+ if (!brcms_c_radio_monitor_stop(wlc))
callbacks++;
brcms_c_channel_mgr_detach(wlc->cmi);
- wlc_timers_deinit(wlc);
+ brcms_c_timers_deinit(wlc);
- wlc_detach_module(wlc);
+ brcms_c_detach_module(wlc);
while (wlc->tx_queues != NULL)
- wlc_txq_free(wlc, wlc->tx_queues);
+ brcms_c_txq_free(wlc, wlc->tx_queues);
brcms_c_detach_mfree(wlc);
return callbacks;
}
/* read hwdisable state and propagate to wlc flag */
-static void wlc_radio_hwdisable_upd(struct brcms_c_info *wlc)
+static void brcms_c_radio_hwdisable_upd(struct brcms_c_info *wlc)
{
if (wlc->pub->wlfeatureflag & WL_SWFL_NOHWRADIO || wlc->pub->hw_off)
return;
if (!wlc->pub->radio_disabled)
return;
mboolclr(wlc->pub->radio_disabled, WL_RADIO_MPC_DISABLE);
- wlc_radio_upd(wlc);
+ brcms_c_radio_upd(wlc);
if (!wlc->pub->radio_disabled)
- wlc_radio_monitor_stop(wlc);
+ brcms_c_radio_monitor_stop(wlc);
return;
}
wlc->mpc_delay_off = wlc->mpc_dlycnt;
else if (radio_state == OFF && mpc_radio == ON) {
mboolclr(wlc->pub->radio_disabled, WL_RADIO_MPC_DISABLE);
- wlc_radio_upd(wlc);
+ brcms_c_radio_upd(wlc);
if (wlc->mpc_offcnt < WLC_MPC_THRESHOLD) {
wlc->mpc_dlycnt = WLC_MPC_MAX_DELAYCNT;
} else
* centralized radio disable/enable function,
* invoke radio enable/disable after updating hwradio status
*/
-static void wlc_radio_upd(struct brcms_c_info *wlc)
+static void brcms_c_radio_upd(struct brcms_c_info *wlc)
{
if (wlc->pub->radio_disabled) {
brcms_c_radio_disable(wlc);
} else {
- wlc_radio_enable(wlc);
+ brcms_c_radio_enable(wlc);
}
}
/* maintain LED behavior in down state */
-static void wlc_down_led_upd(struct brcms_c_info *wlc)
+static void brcms_c_down_led_upd(struct brcms_c_info *wlc)
{
/* maintain LEDs while in down state, turn on sbclk if not available yet */
/* turn on sbclk if necessary */
/* update hwradio status and return it */
bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc)
{
- wlc_radio_hwdisable_upd(wlc);
+ brcms_c_radio_hwdisable_upd(wlc);
return mboolisset(wlc->pub->radio_disabled, WL_RADIO_HW_DISABLE) ? true : false;
}
void brcms_c_radio_disable(struct brcms_c_info *wlc)
{
if (!wlc->pub->up) {
- wlc_down_led_upd(wlc);
+ brcms_c_down_led_upd(wlc);
return;
}
- wlc_radio_monitor_start(wlc);
+ brcms_c_radio_monitor_start(wlc);
brcms_down(wlc->wl);
}
-static void wlc_radio_enable(struct brcms_c_info *wlc)
+static void brcms_c_radio_enable(struct brcms_c_info *wlc)
{
if (wlc->pub->up)
return;
}
/* periodical query hw radio button while driver is "down" */
-static void wlc_radio_timer(void *arg)
+static void brcms_c_radio_timer(void *arg)
{
struct brcms_c_info *wlc = (struct brcms_c_info *) arg;
if (wlc->mpc_offcnt < WLC_MPC_MAX_DELAYCNT)
wlc->mpc_offcnt++;
- wlc_radio_hwdisable_upd(wlc);
- wlc_radio_upd(wlc);
+ brcms_c_radio_hwdisable_upd(wlc);
+ brcms_c_radio_upd(wlc);
}
-static bool wlc_radio_monitor_start(struct brcms_c_info *wlc)
+static bool brcms_c_radio_monitor_start(struct brcms_c_info *wlc)
{
/* Don't start the timer if HWRADIO feature is disabled */
if (wlc->radio_monitor || (wlc->pub->wlfeatureflag & WL_SWFL_NOHWRADIO))
return true;
}
-bool wlc_radio_monitor_stop(struct brcms_c_info *wlc)
+bool brcms_c_radio_monitor_stop(struct brcms_c_info *wlc)
{
if (!wlc->radio_monitor)
return true;
return brcms_del_timer(wlc->wl, wlc->radio_timer);
}
-static void wlc_watchdog_by_timer(void *arg)
+static void brcms_c_watchdog_by_timer(void *arg)
{
- wlc_watchdog(arg);
+ brcms_c_watchdog(arg);
}
/* common watchdog code */
-static void wlc_watchdog(void *arg)
+static void brcms_c_watchdog(void *arg)
{
struct brcms_c_info *wlc = (struct brcms_c_info *) arg;
int i;
/* mpc sync */
brcms_c_radio_mpc_upd(wlc);
/* radio sync: sw/hw/mpc --> radio_disable/radio_enable */
- wlc_radio_hwdisable_upd(wlc);
- wlc_radio_upd(wlc);
+ brcms_c_radio_hwdisable_upd(wlc);
+ brcms_c_radio_upd(wlc);
/* if radio is disable, driver may be down, quit here */
if (wlc->pub->radio_disabled)
return;
if (!BSSCFG_STA(bsscfg)
|| !bsscfg->enable || !bsscfg->BSS)
continue;
- wiphy_err(wlc->wiphy, "wl%d.%d: wlc_up"
+ wiphy_err(wlc->wiphy, "wl%d.%d: up"
": rfdisable -> "
- "wlc_bsscfg_disable()\n",
+ "bsscfg_disable()\n",
wlc->pub->unit, idx);
}
}
}
if (wlc->pub->radio_disabled) {
- wlc_radio_monitor_start(wlc);
+ brcms_c_radio_monitor_start(wlc);
return 0;
}
- /* brcms_b_up_prep has done wlc_corereset(). so clk is on, set it */
+ /* brcms_b_up_prep has done brcms_c_corereset(). so clk is on, set it */
wlc->clk = true;
- wlc_radio_monitor_stop(wlc);
+ brcms_c_radio_monitor_stop(wlc);
/* Set EDCF hostflags */
if (EDCF_ENAB(wlc->pub)) {
/* other software states up after ISR is running */
/* start APs that were to be brought up but are not up yet */
- /* if (AP_ENAB(wlc->pub)) wlc_restart_ap(wlc->ap); */
+ /* if (AP_ENAB(wlc->pub)) brcms_c_restart_ap(wlc->ap); */
/* Program the TX wme params with the current settings */
- wlc_wme_retries_write(wlc);
+ brcms_c_wme_retries_write(wlc);
/* start one second watchdog timer */
brcms_add_timer(wlc->wl, wlc->wdtimer, TIMER_INTERVAL_WATCHDOG, true);
/* ensure antenna config is up to date */
brcms_c_stf_phy_txant_upd(wlc);
/* ensure LDPC config is in sync */
- wlc_ht_update_ldpc(wlc, wlc->stf->ldpc);
+ brcms_c_ht_update_ldpc(wlc, wlc->stf->ldpc);
return 0;
}
/* Initialize the base precedence map for dequeueing from txq based on WME settings */
-static void wlc_tx_prec_map_init(struct brcms_c_info *wlc)
+static void brcms_c_tx_prec_map_init(struct brcms_c_info *wlc)
{
wlc->tx_prec_map = WLC_PREC_BMP_ALL;
memset(wlc->fifo2prec_map, 0, NFIFO * sizeof(u16));
}
}
-static uint wlc_down_del_timer(struct brcms_c_info *wlc)
+static uint brcms_c_down_del_timer(struct brcms_c_info *wlc)
{
uint callbacks = 0;
wlc->WDarmed = false;
}
/* cancel all other timers */
- callbacks += wlc_down_del_timer(wlc);
+ callbacks += brcms_c_down_del_timer(wlc);
wlc->pub->up = false;
wlc_phy_mute_upd(wlc->band->pi, false, PHY_MUTE_ALL);
/* clear txq flow control */
- wlc_txflowcontrol_reset(wlc);
+ brcms_c_txflowcontrol_reset(wlc);
/* flush tx queues */
for (qi = wlc->tx_queues; qi != NULL; qi = qi->next) {
return ret;
}
-static int wlc_nmode_validate(struct brcms_c_info *wlc, s32 nmode)
+static int brcms_c_nmode_validate(struct brcms_c_info *wlc, s32 nmode)
{
int err = 0;
uint i;
int err;
- err = wlc_nmode_validate(wlc, nmode);
+ err = brcms_c_nmode_validate(wlc, nmode);
if (err)
return err;
return err;
}
-static int wlc_set_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs_arg)
+static int brcms_c_set_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs_arg)
{
wlc_rateset_t rs, new;
uint bandunit;
return brcms_c_ioctl(wlc, cmd, arg, sizeof(int), NULL);
}
-static void wlc_ofdm_rateset_war(struct brcms_c_info *wlc)
+static void brcms_c_ofdm_rateset_war(struct brcms_c_info *wlc)
{
u8 r;
bool war = false;
int
brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
- struct brcms_c_if *wlcif)
+ struct brcms_c_if *wlcif)
{
- return _wlc_ioctl(wlc, cmd, arg, len, wlcif);
+ return _brcms_c_ioctl(wlc, cmd, arg, len, wlcif);
}
/* common ioctl handler. return: 0=ok, -1=error, positive=particular error */
static int
-_wlc_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
- struct brcms_c_if *wlcif)
+_brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
+ struct brcms_c_if *wlcif)
{
int val, *pval;
bool bool_val;
}
wlc->default_bss->chanspec = chspec;
- /* wlc_BSSinit() will sanitize the rateset before using it.. */
+ /* brcms_c_BSSinit() will sanitize the rateset before
+ * using it.. */
if (wlc->pub->up &&
(WLC_BAND_PI_RADIO_CHANSPEC != chspec)) {
brcms_c_set_home_chanspec(wlc, chspec);
for (ac = 0; ac < AC_COUNT; ac++) {
WLC_WME_RETRY_SHORT_SET(wlc, ac, wlc->SRL);
}
- wlc_wme_retries_write(wlc);
+ brcms_c_wme_retries_write(wlc);
} else
bcmerror = -EINVAL;
break;
for (ac = 0; ac < AC_COUNT; ac++) {
WLC_WME_RETRY_LONG_SET(wlc, ac, wlc->LRL);
}
- wlc_wme_retries_write(wlc);
+ brcms_c_wme_retries_write(wlc);
} else
bcmerror = -EINVAL;
break;
MCSSET_LEN);
}
- bcmerror = wlc_set_rateset(wlc, &rs);
+ bcmerror = brcms_c_set_rateset(wlc, &rs);
if (!bcmerror)
- wlc_ofdm_rateset_war(wlc);
+ brcms_c_ofdm_rateset_war(wlc);
break;
}
}
/* Write WME tunable parameters for retransmit/max rate from wlc struct to ucode */
-static void wlc_wme_retries_write(struct brcms_c_info *wlc)
+static void brcms_c_wme_retries_write(struct brcms_c_info *wlc)
{
int ac;
"Lifetime Expiry", "Underflow"
};
-static void wlc_print_txs_status(u16 s)
+static void brcms_c_print_txs_status(u16 s)
{
printk(KERN_DEBUG "[15:12] %d frame attempts\n",
(s & TX_STATUS_FRM_RTX_MASK) >> TX_STATUS_FRM_RTX_SHIFT);
printk(KERN_DEBUG "TxStatus: %04x", s);
printk(KERN_DEBUG "\n");
- wlc_print_txs_status(s);
+ brcms_c_print_txs_status(s);
printk(KERN_DEBUG "LastTxTime: %04x ", txs->lasttxtime);
printk(KERN_DEBUG "Seq: %04x ", txs->sequence);
bool brcms_c_chipmatch(u16 vendor, u16 device)
{
if (vendor != PCI_VENDOR_ID_BROADCOM) {
- pr_err("wlc_chipmatch: unknown vendor id %04x\n", vendor);
+ pr_err("chipmatch: unknown vendor id %04x\n", vendor);
return false;
}
if ((device == BCM43236_D11N_ID) || (device == BCM43236_D11N2G_ID))
return true;
- pr_err("wlc_chipmatch: unknown device id %04x\n", device);
+ pr_err("chipmatch: unknown device id %04x\n", device);
return false;
}
}
#endif /* defined(BCMDBG) */
-static u16 wlc_rate_shm_offset(struct brcms_c_info *wlc, u8 rate)
+static u16 brcms_c_rate_shm_offset(struct brcms_c_info *wlc, u8 rate)
{
return brcms_b_rate_shm_offset(wlc->hw, rate);
}
if (!brcms_c_prec_enq(wlc, q, sdu, prec)) {
if (!EDCF_ENAB(wlc->pub)
|| (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL))
- wiphy_err(wlc->wiphy, "wl%d: wlc_txq_enq: txq overflow"
+ wiphy_err(wlc->wiphy, "wl%d: txq_enq: txq overflow"
"\n", wlc->pub->unit);
/*
fifo = prio2fifo[prio];
pkt = sdu;
if (unlikely
- (wlc_d11hdrs_mac80211(wlc, hw, pkt, scb, 0, 1, fifo, 0, NULL, 0)))
+ (brcms_c_d11hdrs_mac80211(
+ wlc, hw, pkt, scb, 0, 1, fifo, 0, NULL, 0)))
return -EINVAL;
brcms_c_txq_enq(wlc, scb, pkt, WLC_PRIO_TO_PREC(prio));
brcms_c_send_q(wlc);
}
if (WLC_WAR16165(wlc))
- wlc_war16165(wlc, true);
+ brcms_c_war16165(wlc, true);
/* Bump up pending count for if not using rpc. If rpc is used, this will be handled
BCMCFID(wlc, frameid);
if (dma_txfast(wlc->hw->di[fifo], p, commit) < 0) {
- wiphy_err(wlc->wiphy, "wlc_txfifo: fatal, toss frames !!!\n");
+ wiphy_err(wlc->wiphy, "txfifo: fatal, toss frames !!!\n");
}
}
uint length, u8 *plcp)
{
if (IS_MCS(rspec)) {
- wlc_compute_mimo_plcp(rspec, length, plcp);
+ brcms_c_compute_mimo_plcp(rspec, length, plcp);
} else if (IS_OFDM(rspec)) {
- wlc_compute_ofdm_plcp(rspec, length, plcp);
+ brcms_c_compute_ofdm_plcp(rspec, length, plcp);
} else {
- wlc_compute_cck_plcp(wlc, rspec, length, plcp);
+ brcms_c_compute_cck_plcp(wlc, rspec, length, plcp);
}
return;
}
/* Rate: 802.11 rate code, length: PSDU length in octets */
-static void wlc_compute_mimo_plcp(ratespec_t rspec, uint length, u8 *plcp)
+static void brcms_c_compute_mimo_plcp(ratespec_t rspec, uint length, u8 *plcp)
{
u8 mcs = (u8) (rspec & RSPEC_RATE_MASK);
plcp[0] = mcs;
/* Rate: 802.11 rate code, length: PSDU length in octets */
static void
-wlc_compute_ofdm_plcp(ratespec_t rspec, u32 length, u8 *plcp)
+brcms_c_compute_ofdm_plcp(ratespec_t rspec, u32 length, u8 *plcp)
{
u8 rate_signal;
u32 tmp = 0;
* Broken out for PRQ.
*/
-static void wlc_cck_plcp_set(struct brcms_c_info *wlc, int rate_500,
+static void brcms_c_cck_plcp_set(struct brcms_c_info *wlc, int rate_500,
uint length, u8 *plcp)
{
u16 usec = 0;
break;
default:
- wiphy_err(wlc->wiphy, "wlc_cck_plcp_set: unsupported rate %d"
+ wiphy_err(wlc->wiphy, "brcms_c_cck_plcp_set: unsupported rate %d"
"\n", rate_500);
rate_500 = WLC_RATE_1M;
usec = length << 3;
}
/* Rate: 802.11 rate code, length: PSDU length in octets */
-static void wlc_compute_cck_plcp(struct brcms_c_info *wlc, ratespec_t rspec,
+static void brcms_c_compute_cck_plcp(struct brcms_c_info *wlc, ratespec_t rspec,
uint length, u8 *plcp)
{
int rate = RSPEC2RATE(rspec);
- wlc_cck_plcp_set(wlc, rate, length, plcp);
+ brcms_c_cck_plcp_set(wlc, rate, length, plcp);
}
-/* wlc_compute_frame_dur()
+/* brcms_c_compute_frame_dur()
*
* Calculate the 802.11 MAC header DUR field for MPDU
* DUR for a single frame = 1 SIFS + 1 ACK
* preamble_type use short/GF or long/MM PLCP header
*/
static u16
-wlc_compute_frame_dur(struct brcms_c_info *wlc, ratespec_t rate,
+brcms_c_compute_frame_dur(struct brcms_c_info *wlc, ratespec_t rate,
u8 preamble_type, uint next_frag_len)
{
u16 dur, sifs;
sifs = SIFS(wlc->band);
dur = sifs;
- dur += (u16) wlc_calc_ack_time(wlc, rate, preamble_type);
+ dur += (u16) brcms_c_calc_ack_time(wlc, rate, preamble_type);
if (next_frag_len) {
/* Double the current DUR to get 2 SIFS + 2 ACKs */
if (!cts_only) { /* RTS/CTS */
dur = 3 * sifs;
dur +=
- (u16) wlc_calc_cts_time(wlc, rts_rate,
+ (u16) brcms_c_calc_cts_time(wlc, rts_rate,
rts_preamble_type);
} else { /* CTS-TO-SELF */
dur = 2 * sifs;
frame_len);
if (ba)
dur +=
- (u16) wlc_calc_ba_time(wlc, frame_rate,
+ (u16) brcms_c_calc_ba_time(wlc, frame_rate,
WLC_SHORT_PREAMBLE);
else
dur +=
- (u16) wlc_calc_ack_time(wlc, frame_rate,
+ (u16) brcms_c_calc_ack_time(wlc, frame_rate,
frame_preamble_type);
return dur;
}
bw = RSPEC_GET_BW(rspec);
/* 10Mhz is not supported yet */
if (bw < PHY_TXC1_BW_20MHZ) {
- wiphy_err(wlc->wiphy, "wlc_phytxctl1_calc: bw %d is "
+ wiphy_err(wlc->wiphy, "phytxctl1_calc: bw %d is "
"not supported yet, set to 20L\n", bw);
bw = PHY_TXC1_BW_20MHZ;
}
/* get the phyctl byte from rate phycfg table */
phycfg = brcms_c_rate_legacy_phyctl(RSPEC2RATE(rspec));
if (phycfg == -1) {
- wiphy_err(wlc->wiphy, "wlc_phytxctl1_calc: wrong "
+ wiphy_err(wlc->wiphy, "phytxctl1_calc: wrong "
"legacy OFDM/CCK rate\n");
phycfg = 0;
}
*
*/
static u16
-wlc_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
+brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
struct sk_buff *p, struct scb *scb, uint frag,
uint nfrags, uint queue, uint next_frag_len,
wsec_key_t *key, ratespec_t rspec_override)
if (!ieee80211_is_pspoll(h->frame_control) &&
!is_multicast_ether_addr(h->addr1) && !use_rifs) {
durid =
- wlc_compute_frame_dur(wlc, rspec[0], preamble_type[0],
+ brcms_c_compute_frame_dur(wlc, rspec[0], preamble_type[0],
next_frag_len);
h->duration_id = cpu_to_le16(durid);
} else if (use_rifs) {
else if (is_multicast_ether_addr(h->addr1) || use_rifs)
txh->FragDurFallback = 0;
else {
- durid = wlc_compute_frame_dur(wlc, rspec[1],
+ durid = brcms_c_compute_frame_dur(wlc, rspec[1],
preamble_type[1], next_frag_len);
txh->FragDurFallback = cpu_to_le16(durid);
}
if (rts) {
/* 1 RTS or CTS-to-self frame */
dur =
- wlc_calc_cts_time(wlc, rts_rspec[0],
+ brcms_c_calc_cts_time(wlc, rts_rspec[0],
rts_preamble_type[0]);
dur_fallback =
- wlc_calc_cts_time(wlc, rts_rspec[1],
+ brcms_c_calc_cts_time(wlc, rts_rspec[1],
rts_preamble_type[1]);
/* (SIFS + CTS) + SIFS + frame + SIFS + ACK */
dur += le16_to_cpu(rts->duration);
/* frame + SIFS + ACK */
dur = frag_dur;
dur +=
- wlc_compute_frame_dur(wlc, rspec[0],
+ brcms_c_compute_frame_dur(wlc, rspec[0],
preamble_type[0], 0);
dur_fallback =
preamble_type[1],
phylen);
dur_fallback +=
- wlc_compute_frame_dur(wlc, rspec[1],
+ brcms_c_compute_frame_dur(wlc, rspec[1],
preamble_type[1], 0);
}
/* NEED to set TxFesTimeNormal (hard) */
uint newfragthresh;
newfragthresh =
- wlc_calc_frame_len(wlc, rspec[0],
- preamble_type[0],
- (wlc->
- edcf_txop[ac] -
- (dur -
- frag_dur)));
+ brcms_c_calc_frame_len(wlc,
+ rspec[0], preamble_type[0],
+ (wlc->edcf_txop[ac] -
+ (dur - frag_dur)));
/* range bound the fragthreshold */
if (newfragthresh < DOT11_MIN_FRAG_LEN)
newfragthresh =
}
}
-static void wlc_war16165(struct brcms_c_info *wlc, bool tx)
+static void brcms_c_war16165(struct brcms_c_info *wlc, bool tx)
{
if (tx) {
/* the post-increment is used in STAY_AWAKE macro */
p = GETNEXTTXP(wlc, queue);
if (WLC_WAR16165(wlc))
- wlc_war16165(wlc, false);
+ brcms_c_war16165(wlc, false);
if (p == NULL)
goto fatal;
* receive call sequence after rx interrupt. Only the higher 16 bits
* are used. Finally, the tsf_h is read from the tsf register.
*/
-static u64 wlc_recover_tsf64(struct brcms_c_info *wlc, struct wlc_d11rxhdr *rxh)
+static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
+ struct wlc_d11rxhdr *rxh)
{
u32 tsf_h, tsf_l;
u16 rx_tsf_0_15, rx_tsf_16_31;
unsigned char *plcp;
/* fill in TSF and flag its presence */
- rx_status->mactime = wlc_recover_tsf64(wlc, wlc_rxh);
+ rx_status->mactime = brcms_c_recover_tsf64(wlc, wlc_rxh);
rx_status->flag |= RX_FLAG_MACTIME_MPDU;
channel = WLC_CHAN_CHANNEL(rxh->RxChan);
}
static void
-wlc_recvctl(struct brcms_c_info *wlc, d11rxhdr_t *rxh, struct sk_buff *p)
+brcms_c_recvctl(struct brcms_c_info *wlc, d11rxhdr_t *rxh, struct sk_buff *p)
{
int len_mpdu;
struct ieee80211_rx_status rx_status;
/* MAC inserts 2 pad bytes for a4 headers or QoS or A-MSDU subframes */
if (rxh->RxStatus1 & RXS_PBPRES) {
if (p->len < 2) {
- wiphy_err(wlc->wiphy, "wl%d: wlc_recv: rcvd runt of "
+ wiphy_err(wlc->wiphy, "wl%d: recv: rcvd runt of "
"len %d\n", wlc->pub->unit, p->len);
goto toss;
}
if (is_amsdu)
goto toss;
- wlc_recvctl(wlc, rxh, p);
+ brcms_c_recvctl(wlc, rxh, p);
return;
toss:
/* The opposite of brcms_c_calc_frame_time */
static uint
-wlc_calc_frame_len(struct brcms_c_info *wlc, ratespec_t ratespec,
+brcms_c_calc_frame_len(struct brcms_c_info *wlc, ratespec_t ratespec,
u8 preamble_type, uint dur)
{
uint nsyms, mac_len, Ndps, kNdps;
}
static uint
-wlc_calc_ba_time(struct brcms_c_info *wlc, ratespec_t rspec, u8 preamble_type)
+brcms_c_calc_ba_time(struct brcms_c_info *wlc, ratespec_t rspec,
+ u8 preamble_type)
{
BCMMSG(wlc->wiphy, "wl%d: rspec 0x%x, "
"preamble_type %d\n", wlc->pub->unit, rspec, preamble_type);
}
static uint
-wlc_calc_ack_time(struct brcms_c_info *wlc, ratespec_t rspec, u8 preamble_type)
+brcms_c_calc_ack_time(struct brcms_c_info *wlc, ratespec_t rspec,
+ u8 preamble_type)
{
uint dur = 0;
}
static uint
-wlc_calc_cts_time(struct brcms_c_info *wlc, ratespec_t rspec, u8 preamble_type)
+brcms_c_calc_cts_time(struct brcms_c_info *wlc, ratespec_t rspec,
+ u8 preamble_type)
{
BCMMSG(wlc->wiphy, "wl%d: ratespec 0x%x, preamble_type %d\n",
wlc->pub->unit, rspec, preamble_type);
- return wlc_calc_ack_time(wlc, rspec, preamble_type);
+ return brcms_c_calc_ack_time(wlc, rspec, preamble_type);
}
/* derive wlc->band->basic_rate[] table from 'rateset' */
}
}
-static void wlc_write_rate_shm(struct brcms_c_info *wlc, u8 rate, u8 basic_rate)
+static void brcms_c_write_rate_shm(struct brcms_c_info *wlc, u8 rate,
+ u8 basic_rate)
{
u8 phy_rate, index;
u8 basic_phy_rate, basic_index;
brcms_c_write_shm(wlc, (basic_table + index * 2), basic_ptr);
}
-static const wlc_rateset_t *wlc_rateset_get_hwrs(struct brcms_c_info *wlc)
+static const wlc_rateset_t *brcms_c_rateset_get_hwrs(struct brcms_c_info *wlc)
{
const wlc_rateset_t *rs_dflt;
u8 rate, basic_rate;
uint i;
- rs_dflt = wlc_rateset_get_hwrs(wlc);
+ rs_dflt = brcms_c_rateset_get_hwrs(wlc);
brcms_c_rateset_copy(rs_dflt, &rs);
brcms_c_rateset_mcs_upd(&rs, wlc->stf->txstreams);
basic_rate = rs.rates[0] & WLC_RATE_MASK;
}
- wlc_write_rate_shm(wlc, rate, basic_rate);
+ brcms_c_write_rate_shm(wlc, rate, basic_rate);
}
}
return true;
error:
if (verbose) {
- wiphy_err(wlc->wiphy, "wl%d: wlc_valid_rate: rate spec 0x%x "
+ wiphy_err(wlc->wiphy, "wl%d: valid_rate: rate spec 0x%x "
"not in hw_rateset\n", wlc->pub->unit, rspec);
}
return false;
}
-static void wlc_update_mimo_band_bwcap(struct brcms_c_info *wlc, u8 bwcap)
+static void brcms_c_update_mimo_band_bwcap(struct brcms_c_info *wlc, u8 bwcap)
{
uint i;
struct brcms_c_band *band;
sifs = SIFS(wlc->band);
- rs_dflt = wlc_rateset_get_hwrs(wlc);
+ rs_dflt = brcms_c_rateset_get_hwrs(wlc);
brcms_c_rateset_copy(rs_dflt, &rs);
brcms_c_rateset_mcs_upd(&rs, wlc->stf->txstreams);
for (i = 0; i < rs.count; i++) {
rate = rs.rates[i] & WLC_RATE_MASK;
- entry_ptr = wlc_rate_shm_offset(wlc, rate);
+ entry_ptr = brcms_c_rate_shm_offset(wlc, rate);
/* Calculate the Probe Response PLCP for the given rate */
brcms_c_compute_plcp(wlc, rate, frame_len, plcp);
* and included up to, but not including, the 4 byte FCS.
*/
static void
-wlc_bcn_prb_template(struct brcms_c_info *wlc, u16 type, ratespec_t bcn_rspec,
- struct brcms_c_bsscfg *cfg, u16 *buf, int *len)
+brcms_c_bcn_prb_template(struct brcms_c_info *wlc, u16 type,
+ ratespec_t bcn_rspec,
+ struct brcms_c_bsscfg *cfg, u16 *buf, int *len)
{
static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
cck_phy_hdr_t *plcp;
wlc->bcn_rspec =
brcms_c_lowest_basic_rspec(wlc, &cfg->current_bss->rateset);
/* update the template and ucode shm */
- wlc_bcn_prb_template(wlc, IEEE80211_STYPE_BEACON,
+ brcms_c_bcn_prb_template(wlc, IEEE80211_STYPE_BEACON,
wlc->bcn_rspec, cfg, bcn, &len);
brcms_c_write_hw_bcntemplates(wlc, bcn, len, false);
}
if (!MBSS_PRB_ENAB(cfg)) {
/* create the probe response template */
- wlc_bcn_prb_template(wlc, IEEE80211_STYPE_PROBE_RESP, 0, cfg,
- prb_resp, &len);
+ brcms_c_bcn_prb_template(wlc, IEEE80211_STYPE_PROBE_RESP, 0,
+ cfg, prb_resp, &len);
if (suspend)
brcms_c_suspend_mac_and_wait(wlc);
txh = (d11txh_t *) (pdu->data);
h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
- /* get the pkt queue info. This was put at wlc_sendctl or wlc_send for PDU */
+ /* get the pkt queue info. This was put at brcms_c_sendctl or
+ * brcms_c_send for PDU */
fifo = le16_to_cpu(txh->TxFrameID) & TXFID_QUEUE_MASK;
scb = NULL;
wlc->stf->txstreams);
}
-static void wlc_bss_default_init(struct brcms_c_info *wlc)
+static void brcms_c_bss_default_init(struct brcms_c_info *wlc)
{
chanspec_t chanspec;
struct brcms_c_band *band;
/* formula: IDLE_BUSY_RATIO_X_16 = (100-duty_cycle)/duty_cycle*16 */
static int
-wlc_duty_cycle_set(struct brcms_c_info *wlc, int duty_cycle, bool isOFDM,
+brcms_c_duty_cycle_set(struct brcms_c_info *wlc, int duty_cycle, bool isOFDM,
bool writeToShm)
{
int idle_busy_ratio_x_16 = 0;
return;
}
- wlc_txflowcontrol_signal(wlc, qi, on, prio);
+ brcms_c_txflowcontrol_signal(wlc, qi, on, prio);
}
void
return;
}
- wlc_txflowcontrol_signal(wlc, qi, ON, ALLPRIO);
+ brcms_c_txflowcontrol_signal(wlc, qi, ON, ALLPRIO);
} else {
mboolclr(qi->stopped, override);
/* clearing an override bit will only make a difference for
}
if (qi->stopped == 0) {
- wlc_txflowcontrol_signal(wlc, qi, OFF, ALLPRIO);
+ brcms_c_txflowcontrol_signal(wlc, qi, OFF, ALLPRIO);
} else {
int prio;
for (prio = MAXPRIO; prio >= 0; prio--) {
if (!mboolisset(qi->stopped, NBITVAL(prio)))
- wlc_txflowcontrol_signal(wlc, qi, OFF,
- prio);
+ brcms_c_txflowcontrol_signal(
+ wlc, qi, OFF, prio);
}
}
}
}
-static void wlc_txflowcontrol_reset(struct brcms_c_info *wlc)
+static void brcms_c_txflowcontrol_reset(struct brcms_c_info *wlc)
{
struct brcms_c_txq_info *qi;
for (qi = wlc->tx_queues; qi != NULL; qi = qi->next) {
if (qi->stopped) {
- wlc_txflowcontrol_signal(wlc, qi, OFF, ALLPRIO);
+ brcms_c_txflowcontrol_signal(wlc, qi, OFF, ALLPRIO);
qi->stopped = 0;
}
}
}
static void
-wlc_txflowcontrol_signal(struct brcms_c_info *wlc, struct brcms_c_txq_info *qi,
- bool on, int prio)
+brcms_c_txflowcontrol_signal(struct brcms_c_info *wlc,
+ struct brcms_c_txq_info *qi, bool on, int prio)
{
#ifdef NON_FUNCTIONAL
/* wlcif_list is never filled so this function is not functional */
#endif
}
-static struct brcms_c_txq_info *wlc_txq_alloc(struct brcms_c_info *wlc)
+static struct brcms_c_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc)
{
struct brcms_c_txq_info *qi, *p;
return qi;
}
-static void wlc_txq_free(struct brcms_c_info *wlc, struct brcms_c_txq_info *qi)
+static void brcms_c_txq_free(struct brcms_c_info *wlc,
+ struct brcms_c_txq_info *qi)
{
struct brcms_c_txq_info *p;