static void WLBANDINITFN(wlc_ucode_bsinit) (struct wlc_hw_info *wlc_hw)
{
+ struct wiphy *wiphy = wlc_hw->wlc->wiphy;
+
/* init microcode host flags */
wlc_write_mhf(wlc_hw, wlc_hw->band->mhfs);
if (WLCISNPHY(wlc_hw->band)) {
wlc_write_inits(wlc_hw, d11n0bsinitvals16);
} else {
- WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
- __func__, wlc_hw->unit, wlc_hw->corerev);
+ 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, d11lcn0bsinitvals24);
} else
- WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
- __func__, wlc_hw->unit,
- wlc_hw->corerev);
+ wiphy_err(wiphy, "%s: wl%d: unsupported phy in"
+ " core rev %d\n", __func__,
+ wlc_hw->unit, wlc_hw->corerev);
} else {
- WL_ERROR("%s: wl%d: unsupported corerev %d\n",
- __func__, wlc_hw->unit, wlc_hw->corerev);
+ wiphy_err(wiphy, "%s: wl%d: unsupported corerev %d\n",
+ __func__, wlc_hw->unit, wlc_hw->corerev);
}
}
}
struct wlc_hw_info *wlc_hw = wlc->hw;
d11regs_t *regs = wlc_hw->regs;
bool fatal = false;
+ struct wiphy *wiphy = wlc->wiphy;
if (DEVICEREMOVED(wlc)) {
- WL_ERROR("wl%d: %s: dead chip\n", wlc_hw->unit, __func__);
+ wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit,
+ __func__);
wl_down(wlc->wl);
return false;
}
if (wlc_bmac_txstatus(wlc->hw, bounded, &fatal))
wlc->macintstatus |= MI_TFS;
if (fatal) {
- WL_ERROR("MI_TFS: fatal\n");
+ wiphy_err(wiphy, "MI_TFS: fatal\n");
goto fatal;
}
}
/* TX FIFO suspend/flush completion */
if (macintstatus & MI_TXSTOP) {
if (wlc_bmac_tx_fifo_suspended(wlc_hw, TX_DATA_FIFO)) {
- /* WL_ERROR("dpc: fifo_suspend_comlete\n"); */
+ /* wiphy_err(wiphy, "dpc: fifo_suspend_comlete\n"); */
}
}
}
if (macintstatus & MI_GP0) {
- WL_ERROR("wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n",
- wlc_hw->unit, wlc_hw->now);
+ wiphy_err(wiphy, "wl%d: PSM microcode watchdog fired at %d "
+ "(seconds). Resetting.\n", wlc_hw->unit, wlc_hw->now);
printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n",
__func__, wlc_hw->sih->chip,
struct wlc_hw_info *wlc_hw = wlc->hw;
uint unit = wlc_hw->unit;
wlc_tunables_t *tune = wlc->pub->tunables;
+ struct wiphy *wiphy = wlc->wiphy;
/* name and offsets for dma_attach */
snprintf(name, sizeof(name), "wl%d", unit);
dma_addrwidth(wlc_hw->sih, DMAREG(wlc_hw, DMA_TX, 0));
if (!wl_alloc_dma_resources(wlc_hw->wlc->wl, addrwidth)) {
- WL_ERROR("wl%d: wlc_attach: alloc_dma_resources failed\n",
- unit);
+ wiphy_err(wiphy, "wl%d: wlc_attach: alloc_dma_"
+ "resources failed\n", unit);
return false;
}
/* Cleaner to leave this as if with AP defined */
if (dma_attach_err) {
- WL_ERROR("wl%d: wlc_attach: dma_attach failed\n", unit);
+ wiphy_err(wiphy, "wl%d: wlc_attach: dma_attach failed"
+ "\n", unit);
return false;
}
uint j;
bool wme = false;
shared_phy_params_t sha_params;
+ struct wiphy *wiphy = wlc->wiphy;
WL_TRACE("wl%d: wlc_bmac_attach: vendor 0x%x device 0x%x\n",
unit, vendor, device);
wlc_hw->sih = si_attach((uint) device, regsva, bustype, btparam,
&wlc_hw->vars, &wlc_hw->vars_size);
if (wlc_hw->sih == NULL) {
- WL_ERROR("wl%d: wlc_bmac_attach: si_attach failed\n", unit);
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: si_attach failed\n",
+ unit);
err = 11;
goto fail;
}
var = getvar(vars, "vendid");
if (var) {
vendor = (u16) simple_strtoul(var, NULL, 0);
- WL_ERROR("Overriding vendor id = 0x%x\n", vendor);
+ wiphy_err(wiphy, "Overriding vendor id = 0x%x\n",
+ vendor);
}
var = getvar(vars, "devid");
if (var) {
u16 devid = (u16) simple_strtoul(var, NULL, 0);
if (devid != 0xffff) {
device = devid;
- WL_ERROR("Overriding device id = 0x%x\n",
- device);
+ wiphy_err(wiphy, "Overriding device id = 0x%x"
+ "\n", device);
}
}
/* verify again the device is supported */
if (!wlc_chipmatch(vendor, device)) {
- WL_ERROR("wl%d: wlc_bmac_attach: Unsupported vendor/device (0x%x/0x%x)\n",
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: Unsupported "
+ "vendor/device (0x%x/0x%x)\n",
unit, vendor, device);
err = 12;
goto fail;
wlc_bmac_corereset(wlc_hw, WLC_USE_COREFLAGS);
if (!wlc_bmac_validate_chip_access(wlc_hw)) {
- WL_ERROR("wl%d: wlc_bmac_attach: validate_chip_access failed\n",
- unit);
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: validate_chip_access "
+ "failed\n", unit);
err = 14;
goto fail;
}
j = BOARDREV_PROMOTED;
wlc_hw->boardrev = (u16) j;
if (!wlc_validboardtype(wlc_hw)) {
- WL_ERROR("wl%d: wlc_bmac_attach: Unsupported Broadcom board type (0x%x)" " or revision level (0x%x)\n",
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: Unsupported Broadcom "
+ "board type (0x%x)" " or revision level (0x%x)\n",
unit, wlc_hw->sih->boardtype, wlc_hw->boardrev);
err = 15;
goto fail;
wlc_hw->physhim = wlc_phy_shim_attach(wlc_hw, wlc->wl, wlc);
if (wlc_hw->physhim == NULL) {
- WL_ERROR("wl%d: wlc_bmac_attach: wlc_phy_shim_attach failed\n",
- unit);
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: wlc_phy_shim_attach "
+ "failed\n", unit);
err = 25;
goto fail;
}
(void *)regs, wlc_bmac_bandtype(wlc_hw), vars,
wlc->wiphy);
if (wlc_hw->band->pi == NULL) {
- WL_ERROR("wl%d: wlc_bmac_attach: wlc_phy_attach failed\n",
- unit);
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: wlc_phy_"
+ "attach failed\n", unit);
err = 17;
goto fail;
}
goto bad_phy;
} else {
bad_phy:
- WL_ERROR("wl%d: wlc_bmac_attach: unsupported phy type/rev (%d/%d)\n",
- unit,
- wlc_hw->band->phytype, wlc_hw->band->phyrev);
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: unsupported "
+ "phy type/rev (%d/%d)\n", unit,
+ wlc_hw->band->phytype, wlc_hw->band->phyrev);
err = 18;
goto fail;
}
/* init etheraddr state variables */
macaddr = wlc_get_macaddr(wlc_hw);
if (macaddr == NULL) {
- WL_ERROR("wl%d: wlc_bmac_attach: macaddr not found\n", unit);
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: macaddr not found\n",
+ unit);
err = 21;
goto fail;
}
bcm_ether_atoe(macaddr, wlc_hw->etheraddr);
if (is_broadcast_ether_addr(wlc_hw->etheraddr) ||
is_zero_ether_addr(wlc_hw->etheraddr)) {
- WL_ERROR("wl%d: wlc_bmac_attach: bad macaddr %s\n",
- unit, macaddr);
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: bad macaddr %s\n",
+ unit, macaddr);
err = 22;
goto fail;
}
return err;
fail:
- WL_ERROR("wl%d: wlc_bmac_attach: failed with err %d\n", unit, err);
+ wiphy_err(wiphy, "wl%d: wlc_bmac_attach: failed with err %d\n", unit,
+ err);
return err;
}
/* reject unsupported corerev */
if (!VALID_COREREV(wlc_hw->corerev)) {
- WL_ERROR("unsupported core rev %d\n", wlc_hw->corerev);
+ wiphy_err(wlc_hw->wlc->wiphy, "unsupported core rev %d\n",
+ wlc_hw->corerev);
return false;
}
macaddr = getvar(wlc_hw->vars, varname);
if (macaddr == NULL) {
- WL_ERROR("wl%d: wlc_get_macaddr: macaddr getvar(%s) not found\n",
- wlc_hw->unit, varname);
+ wiphy_err(wlc_hw->wlc->wiphy, "wl%d: wlc_get_macaddr: macaddr "
+ "getvar(%s) not found\n", wlc_hw->unit, varname);
}
return macaddr;
if (ai_iscoreup(wlc_hw->sih)) {
for (i = 0; i < NFIFO; i++)
if ((wlc_hw->di[i]) && (!dma_txreset(wlc_hw->di[i]))) {
- WL_ERROR("wl%d: %s: dma_txreset[%d]: cannot stop dma\n",
- wlc_hw->unit, __func__, i);
+ wiphy_err(wlc_hw->wlc->wiphy, "wl%d: %s: "
+ "dma_txreset[%d]: cannot stop dma\n",
+ wlc_hw->unit, __func__, i);
}
if ((wlc_hw->di[RX_FIFO])
&& (!wlc_dma_rxreset(wlc_hw, RX_FIFO))) {
- WL_ERROR("wl%d: %s: dma_rxreset[%d]: cannot stop dma\n",
- wlc_hw->unit, __func__, RX_FIFO);
+ wiphy_err(wlc_hw->wlc->wiphy, "wl%d: %s: dma_rxreset"
+ "[%d]: cannot stop dma\n",
+ wlc_hw->unit, __func__, RX_FIFO);
}
}
/* if noreset, just stop the psm and return */
bool fifosz_fixup = false;
int err = 0;
u16 buf[NFIFO];
+ struct wiphy *wiphy = wlc->wiphy;
regs = wlc_hw->regs;
SPINWAIT(((R_REG(®s->macintstatus) & MI_MACSSPNDD) == 0),
1000 * 1000);
if ((R_REG(®s->macintstatus) & MI_MACSSPNDD) == 0)
- WL_ERROR("wl%d: wlc_coreinit: ucode did not self-suspend!\n",
- wlc_hw->unit);
+ wiphy_err(wiphy, "wl%d: wlc_coreinit: ucode did not self-"
+ "suspend!\n", wlc_hw->unit);
wlc_gpio_init(wlc);
if (WLCISNPHY(wlc_hw->band))
wlc_write_inits(wlc_hw, d11n0initvals16);
else
- WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
- __func__, wlc_hw->unit, wlc_hw->corerev);
+ 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);
} else {
- WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
- __func__, wlc_hw->unit, wlc_hw->corerev);
+ wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
+ " %d\n", __func__, wlc_hw->unit,
+ wlc_hw->corerev);
}
} else {
- WL_ERROR("%s: wl%d: unsupported corerev %d\n",
- __func__, wlc_hw->unit, wlc_hw->corerev);
+ wiphy_err(wiphy, "%s: wl%d: unsupported corerev %d\n",
+ __func__, wlc_hw->unit, wlc_hw->corerev);
}
/* For old ucode, txfifo sizes needs to be modified(increased) */
err = -1;
}
if (err != 0) {
- WL_ERROR("wlc_coreinit: txfifo mismatch: ucode size %d driver size %d index %d\n",
- buf[i], wlc_hw->xmtfifo_sz[i], i);
+ wiphy_err(wiphy, "wlc_coreinit: txfifo mismatch: ucode size %d"
+ " driver size %d index %d\n", buf[i],
+ wlc_hw->xmtfifo_sz[i], i);
ASSERT(0);
}
bcm43xx_16_mimosz);
wlc_hw->ucode_loaded = true;
} else
- WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
- __func__, wlc_hw->unit, wlc_hw->corerev);
+ wiphy_err(wlc->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_ucode_write(wlc_hw, bcm43xx_24_lcn,
bcm43xx_24_lcnsz);
wlc_hw->ucode_loaded = true;
} else {
- WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
- __func__, wlc_hw->unit, wlc_hw->corerev);
+ wiphy_err(wlc->wiphy, "%s: wl%d: unsupported phy in "
+ "corerev %d\n",
+ __func__, wlc_hw->unit, wlc_hw->corerev);
}
}
}
uint unit;
uint intstatus, idx;
d11regs_t *regs = wlc_hw->regs;
+ struct wiphy *wiphy = wlc_hw->wlc->wiphy;
unit = wlc_hw->unit;
unit, idx, intstatus);
if (intstatus & I_RO) {
- WL_ERROR("wl%d: fifo %d: receive fifo overflow\n",
- unit, idx);
+ wiphy_err(wiphy, "wl%d: fifo %d: receive fifo "
+ "overflow\n", unit, idx);
wlc_hw->wlc->pub->_cnt->rxoflo++;
fatal = true;
}
if (intstatus & I_PC) {
- WL_ERROR("wl%d: fifo %d: descriptor error\n",
+ wiphy_err(wiphy, "wl%d: fifo %d: descriptor error\n",
unit, idx);
wlc_hw->wlc->pub->_cnt->dmade++;
fatal = true;
}
if (intstatus & I_PD) {
- WL_ERROR("wl%d: fifo %d: data error\n", unit, idx);
+ wiphy_err(wiphy, "wl%d: fifo %d: data error\n", unit,
+ idx);
wlc_hw->wlc->pub->_cnt->dmada++;
fatal = true;
}
if (intstatus & I_DE) {
- WL_ERROR("wl%d: fifo %d: descriptor protocol error\n",
- unit, idx);
+ wiphy_err(wiphy, "wl%d: fifo %d: descriptor protocol "
+ "error\n", unit, idx);
wlc_hw->wlc->pub->_cnt->dmape++;
fatal = true;
}
if (intstatus & I_RU) {
- WL_ERROR("wl%d: fifo %d: receive descriptor underflow\n",
- idx, unit);
+ wiphy_err(wiphy, "wl%d: fifo %d: receive descriptor "
+ "underflow\n", idx, unit);
wlc_hw->wlc->pub->_cnt->rxuflo[idx]++;
}
if (intstatus & I_XU) {
- WL_ERROR("wl%d: fifo %d: transmit fifo underflow\n",
- idx, unit);
+ wiphy_err(wiphy, "wl%d: fifo %d: transmit fifo "
+ "underflow\n", idx, unit);
wlc_hw->wlc->pub->_cnt->txuflo++;
fatal = true;
}
macintstatus = wlc_intstatus(wlc, true);
if (macintstatus == 0xffffffff)
- WL_ERROR("DEVICEREMOVED detected in the ISR code path\n");
+ wiphy_err(wlc->wiphy, "DEVICEREMOVED detected in the ISR code"
+ " path\n");
/* it is not for us */
if (macintstatus == 0)
&& (s1 = R_REG(®s->frmtxstatus)) & TXS_V) {
if (s1 == 0xffffffff) {
- WL_ERROR("wl%d: %s: dead chip\n",
+ wiphy_err(wlc->wiphy, "wl%d: %s: dead chip\n",
wlc_hw->unit, __func__);
ASSERT(s1 != 0xffffffff);
return morepending;
struct wlc_hw_info *wlc_hw = wlc->hw;
d11regs_t *regs = wlc_hw->regs;
u32 mc, mi;
+ struct wiphy *wiphy = wlc->wiphy;
WL_TRACE("wl%d: wlc_suspend_mac_and_wait: bandunit %d\n",
wlc_hw->unit, wlc_hw->band->bandunit);
mc = R_REG(®s->maccontrol);
if (mc == 0xffffffff) {
- WL_ERROR("wl%d: %s: dead chip\n", wlc_hw->unit, __func__);
+ wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit,
+ __func__);
wl_down(wlc->wl);
return;
}
mi = R_REG(®s->macintstatus);
if (mi == 0xffffffff) {
- WL_ERROR("wl%d: %s: dead chip\n", wlc_hw->unit, __func__);
+ wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit,
+ __func__);
wl_down(wlc->wl);
return;
}
WLC_MAX_MAC_SUSPEND);
if (!(R_REG(®s->macintstatus) & MI_MACSSPNDD)) {
- WL_ERROR("wl%d: wlc_suspend_mac_and_wait: waited %d uS and MI_MACSSPNDD is still not on.\n",
- wlc_hw->unit, WLC_MAX_MAC_SUSPEND);
- WL_ERROR("wl%d: psmdebug 0x%08x, phydebug 0x%08x, psm_brc 0x%04x\n",
- wlc_hw->unit,
- R_REG(®s->psmdebug),
- R_REG(®s->phydebug),
- R_REG(®s->psm_brc));
+ wiphy_err(wiphy, "wl%d: wlc_suspend_mac_and_wait: waited %d uS"
+ " and MI_MACSSPNDD is still not on.\n",
+ wlc_hw->unit, WLC_MAX_MAC_SUSPEND);
+ wiphy_err(wiphy, "wl%d: psmdebug 0x%08x, phydebug 0x%08x, "
+ "psm_brc 0x%04x\n", wlc_hw->unit,
+ R_REG(®s->psmdebug),
+ R_REG(®s->phydebug),
+ R_REG(®s->psm_brc));
}
mc = R_REG(®s->maccontrol);
if (mc == 0xffffffff) {
- WL_ERROR("wl%d: %s: dead chip\n", wlc_hw->unit, __func__);
+ wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit,
+ __func__);
wl_down(wlc->wl);
return;
}
{
d11regs_t *regs;
u32 w, val;
+ struct wiphy *wiphy = wlc_hw->wlc->wiphy;
WL_TRACE("wl%d: validate_chip_access\n", wlc_hw->unit);
(void)R_REG(®s->objaddr);
val = R_REG(®s->objdata);
if (val != (u32) 0xaa5555aa) {
- WL_ERROR("wl%d: validate_chip_access: SHM = 0x%x, expected 0xaa5555aa\n",
- wlc_hw->unit, val);
+ wiphy_err(wiphy, "wl%d: validate_chip_access: SHM = 0x%x, "
+ "expected 0xaa5555aa\n", wlc_hw->unit, val);
return false;
}
(void)R_REG(®s->objaddr);
val = R_REG(®s->objdata);
if (val != (u32) 0x55aaaa55) {
- WL_ERROR("wl%d: validate_chip_access: SHM = 0x%x, expected 0x55aaaa55\n",
- wlc_hw->unit, val);
+ wiphy_err(wiphy, "wl%d: validate_chip_access: SHM = 0x%x, "
+ "expected 0x55aaaa55\n", wlc_hw->unit, val);
return false;
}
w = R_REG(®s->maccontrol);
if ((w != (MCTL_IHR_EN | MCTL_WAKE)) &&
(w != (MCTL_IHR_EN | MCTL_GMODE | MCTL_WAKE))) {
- WL_ERROR("wl%d: validate_chip_access: maccontrol = 0x%x, expected 0x%x or 0x%x\n",
- wlc_hw->unit, w,
- (MCTL_IHR_EN | MCTL_WAKE),
- (MCTL_IHR_EN | MCTL_GMODE | MCTL_WAKE));
+ wiphy_err(wiphy, "wl%d: validate_chip_access: maccontrol = "
+ "0x%x, expected 0x%x or 0x%x\n", wlc_hw->unit, w,
+ (MCTL_IHR_EN | MCTL_WAKE),
+ (MCTL_IHR_EN | MCTL_GMODE | MCTL_WAKE));
return false;
}
tmp = R_REG(®s->clk_ctl_st);
if ((tmp & (CCS_ERSRC_AVAIL_HT)) !=
(CCS_ERSRC_AVAIL_HT)) {
- WL_ERROR("%s: turn on PHY PLL failed\n",
- __func__);
+ wiphy_err(wlc_hw->wlc->wiphy, "%s: turn on PHY"
+ " PLL failed\n", __func__);
ASSERT(0);
}
} else {
(CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL))
!=
(CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL)) {
- WL_ERROR("%s: turn on PHY PLL failed\n",
- __func__);
+ wiphy_err(wlc_hw->wlc->wiphy, "%s: turn on "
+ "PHY PLL failed\n", __func__);
ASSERT(0);
}
}