Commit 384235ee authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: replaced WL_ERROR in wlc_bmac.c

Code cleanup. Replaced proprietary function by wiphy_err().

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cd67038e
...@@ -200,6 +200,8 @@ static void wlc_bmac_update_slot_timing(struct wlc_hw_info *wlc_hw, ...@@ -200,6 +200,8 @@ static void wlc_bmac_update_slot_timing(struct wlc_hw_info *wlc_hw,
static void WLBANDINITFN(wlc_ucode_bsinit) (struct wlc_hw_info *wlc_hw) static void WLBANDINITFN(wlc_ucode_bsinit) (struct wlc_hw_info *wlc_hw)
{ {
struct wiphy *wiphy = wlc_hw->wlc->wiphy;
/* init microcode host flags */ /* init microcode host flags */
wlc_write_mhf(wlc_hw, wlc_hw->band->mhfs); wlc_write_mhf(wlc_hw, wlc_hw->band->mhfs);
...@@ -208,20 +210,21 @@ static void WLBANDINITFN(wlc_ucode_bsinit) (struct wlc_hw_info *wlc_hw) ...@@ -208,20 +210,21 @@ static void WLBANDINITFN(wlc_ucode_bsinit) (struct wlc_hw_info *wlc_hw)
if (WLCISNPHY(wlc_hw->band)) { if (WLCISNPHY(wlc_hw->band)) {
wlc_write_inits(wlc_hw, d11n0bsinitvals16); wlc_write_inits(wlc_hw, d11n0bsinitvals16);
} else { } else {
WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n", wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
__func__, wlc_hw->unit, wlc_hw->corerev); " %d\n", __func__, wlc_hw->unit,
wlc_hw->corerev);
} }
} else { } else {
if (D11REV_IS(wlc_hw->corerev, 24)) { if (D11REV_IS(wlc_hw->corerev, 24)) {
if (WLCISLCNPHY(wlc_hw->band)) { if (WLCISLCNPHY(wlc_hw->band)) {
wlc_write_inits(wlc_hw, d11lcn0bsinitvals24); wlc_write_inits(wlc_hw, d11lcn0bsinitvals24);
} else } else
WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n", wiphy_err(wiphy, "%s: wl%d: unsupported phy in"
__func__, wlc_hw->unit, " core rev %d\n", __func__,
wlc_hw->corerev); wlc_hw->unit, wlc_hw->corerev);
} else { } else {
WL_ERROR("%s: wl%d: unsupported corerev %d\n", wiphy_err(wiphy, "%s: wl%d: unsupported corerev %d\n",
__func__, wlc_hw->unit, wlc_hw->corerev); __func__, wlc_hw->unit, wlc_hw->corerev);
} }
} }
} }
...@@ -320,9 +323,11 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded) ...@@ -320,9 +323,11 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
struct wlc_hw_info *wlc_hw = wlc->hw; struct wlc_hw_info *wlc_hw = wlc->hw;
d11regs_t *regs = wlc_hw->regs; d11regs_t *regs = wlc_hw->regs;
bool fatal = false; bool fatal = false;
struct wiphy *wiphy = wlc->wiphy;
if (DEVICEREMOVED(wlc)) { 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); wl_down(wlc->wl);
return false; return false;
} }
...@@ -355,7 +360,7 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded) ...@@ -355,7 +360,7 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
if (wlc_bmac_txstatus(wlc->hw, bounded, &fatal)) if (wlc_bmac_txstatus(wlc->hw, bounded, &fatal))
wlc->macintstatus |= MI_TFS; wlc->macintstatus |= MI_TFS;
if (fatal) { if (fatal) {
WL_ERROR("MI_TFS: fatal\n"); wiphy_err(wiphy, "MI_TFS: fatal\n");
goto fatal; goto fatal;
} }
} }
...@@ -386,7 +391,7 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded) ...@@ -386,7 +391,7 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
/* TX FIFO suspend/flush completion */ /* TX FIFO suspend/flush completion */
if (macintstatus & MI_TXSTOP) { if (macintstatus & MI_TXSTOP) {
if (wlc_bmac_tx_fifo_suspended(wlc_hw, TX_DATA_FIFO)) { 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"); */
} }
} }
...@@ -396,8 +401,8 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded) ...@@ -396,8 +401,8 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
} }
if (macintstatus & MI_GP0) { if (macintstatus & MI_GP0) {
WL_ERROR("wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n", wiphy_err(wiphy, "wl%d: PSM microcode watchdog fired at %d "
wlc_hw->unit, wlc_hw->now); "(seconds). Resetting.\n", wlc_hw->unit, wlc_hw->now);
printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n", printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n",
__func__, wlc_hw->sih->chip, __func__, wlc_hw->sih->chip,
...@@ -522,6 +527,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme) ...@@ -522,6 +527,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme)
struct wlc_hw_info *wlc_hw = wlc->hw; struct wlc_hw_info *wlc_hw = wlc->hw;
uint unit = wlc_hw->unit; uint unit = wlc_hw->unit;
wlc_tunables_t *tune = wlc->pub->tunables; wlc_tunables_t *tune = wlc->pub->tunables;
struct wiphy *wiphy = wlc->wiphy;
/* name and offsets for dma_attach */ /* name and offsets for dma_attach */
snprintf(name, sizeof(name), "wl%d", unit); snprintf(name, sizeof(name), "wl%d", unit);
...@@ -537,8 +543,8 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme) ...@@ -537,8 +543,8 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme)
dma_addrwidth(wlc_hw->sih, DMAREG(wlc_hw, DMA_TX, 0)); dma_addrwidth(wlc_hw->sih, DMAREG(wlc_hw, DMA_TX, 0));
if (!wl_alloc_dma_resources(wlc_hw->wlc->wl, addrwidth)) { if (!wl_alloc_dma_resources(wlc_hw->wlc->wl, addrwidth)) {
WL_ERROR("wl%d: wlc_attach: alloc_dma_resources failed\n", wiphy_err(wiphy, "wl%d: wlc_attach: alloc_dma_"
unit); "resources failed\n", unit);
return false; return false;
} }
...@@ -590,7 +596,8 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme) ...@@ -590,7 +596,8 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme)
/* Cleaner to leave this as if with AP defined */ /* Cleaner to leave this as if with AP defined */
if (dma_attach_err) { 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; return false;
} }
...@@ -637,6 +644,7 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -637,6 +644,7 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
uint j; uint j;
bool wme = false; bool wme = false;
shared_phy_params_t sha_params; 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", WL_TRACE("wl%d: wlc_bmac_attach: vendor 0x%x device 0x%x\n",
unit, vendor, device); unit, vendor, device);
...@@ -661,7 +669,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -661,7 +669,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
wlc_hw->sih = si_attach((uint) device, regsva, bustype, btparam, wlc_hw->sih = si_attach((uint) device, regsva, bustype, btparam,
&wlc_hw->vars, &wlc_hw->vars_size); &wlc_hw->vars, &wlc_hw->vars_size);
if (wlc_hw->sih == NULL) { 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; err = 11;
goto fail; goto fail;
} }
...@@ -681,21 +690,23 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -681,21 +690,23 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
var = getvar(vars, "vendid"); var = getvar(vars, "vendid");
if (var) { if (var) {
vendor = (u16) simple_strtoul(var, NULL, 0); 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"); var = getvar(vars, "devid");
if (var) { if (var) {
u16 devid = (u16) simple_strtoul(var, NULL, 0); u16 devid = (u16) simple_strtoul(var, NULL, 0);
if (devid != 0xffff) { if (devid != 0xffff) {
device = devid; device = devid;
WL_ERROR("Overriding device id = 0x%x\n", wiphy_err(wiphy, "Overriding device id = 0x%x"
device); "\n", device);
} }
} }
/* verify again the device is supported */ /* verify again the device is supported */
if (!wlc_chipmatch(vendor, device)) { 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); unit, vendor, device);
err = 12; err = 12;
goto fail; goto fail;
...@@ -731,8 +742,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -731,8 +742,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
wlc_bmac_corereset(wlc_hw, WLC_USE_COREFLAGS); wlc_bmac_corereset(wlc_hw, WLC_USE_COREFLAGS);
if (!wlc_bmac_validate_chip_access(wlc_hw)) { if (!wlc_bmac_validate_chip_access(wlc_hw)) {
WL_ERROR("wl%d: wlc_bmac_attach: validate_chip_access failed\n", wiphy_err(wiphy, "wl%d: wlc_bmac_attach: validate_chip_access "
unit); "failed\n", unit);
err = 14; err = 14;
goto fail; goto fail;
} }
...@@ -744,7 +755,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -744,7 +755,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
j = BOARDREV_PROMOTED; j = BOARDREV_PROMOTED;
wlc_hw->boardrev = (u16) j; wlc_hw->boardrev = (u16) j;
if (!wlc_validboardtype(wlc_hw)) { 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); unit, wlc_hw->sih->boardtype, wlc_hw->boardrev);
err = 15; err = 15;
goto fail; goto fail;
...@@ -786,8 +798,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -786,8 +798,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
wlc_hw->physhim = wlc_phy_shim_attach(wlc_hw, wlc->wl, wlc); wlc_hw->physhim = wlc_phy_shim_attach(wlc_hw, wlc->wl, wlc);
if (wlc_hw->physhim == NULL) { if (wlc_hw->physhim == NULL) {
WL_ERROR("wl%d: wlc_bmac_attach: wlc_phy_shim_attach failed\n", wiphy_err(wiphy, "wl%d: wlc_bmac_attach: wlc_phy_shim_attach "
unit); "failed\n", unit);
err = 25; err = 25;
goto fail; goto fail;
} }
...@@ -852,8 +864,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -852,8 +864,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
(void *)regs, wlc_bmac_bandtype(wlc_hw), vars, (void *)regs, wlc_bmac_bandtype(wlc_hw), vars,
wlc->wiphy); wlc->wiphy);
if (wlc_hw->band->pi == NULL) { if (wlc_hw->band->pi == NULL) {
WL_ERROR("wl%d: wlc_bmac_attach: wlc_phy_attach failed\n", wiphy_err(wiphy, "wl%d: wlc_bmac_attach: wlc_phy_"
unit); "attach failed\n", unit);
err = 17; err = 17;
goto fail; goto fail;
} }
...@@ -883,9 +895,9 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -883,9 +895,9 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
goto bad_phy; goto bad_phy;
} else { } else {
bad_phy: bad_phy:
WL_ERROR("wl%d: wlc_bmac_attach: unsupported phy type/rev (%d/%d)\n", wiphy_err(wiphy, "wl%d: wlc_bmac_attach: unsupported "
unit, "phy type/rev (%d/%d)\n", unit,
wlc_hw->band->phytype, wlc_hw->band->phyrev); wlc_hw->band->phytype, wlc_hw->band->phyrev);
err = 18; err = 18;
goto fail; goto fail;
} }
...@@ -940,15 +952,16 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -940,15 +952,16 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
/* init etheraddr state variables */ /* init etheraddr state variables */
macaddr = wlc_get_macaddr(wlc_hw); macaddr = wlc_get_macaddr(wlc_hw);
if (macaddr == NULL) { 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; err = 21;
goto fail; goto fail;
} }
bcm_ether_atoe(macaddr, wlc_hw->etheraddr); bcm_ether_atoe(macaddr, wlc_hw->etheraddr);
if (is_broadcast_ether_addr(wlc_hw->etheraddr) || if (is_broadcast_ether_addr(wlc_hw->etheraddr) ||
is_zero_ether_addr(wlc_hw->etheraddr)) { is_zero_ether_addr(wlc_hw->etheraddr)) {
WL_ERROR("wl%d: wlc_bmac_attach: bad macaddr %s\n", wiphy_err(wiphy, "wl%d: wlc_bmac_attach: bad macaddr %s\n",
unit, macaddr); unit, macaddr);
err = 22; err = 22;
goto fail; goto fail;
} }
...@@ -960,7 +973,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -960,7 +973,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
return err; return err;
fail: 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; return err;
} }
...@@ -1999,7 +2013,8 @@ static bool wlc_isgoodchip(struct wlc_hw_info *wlc_hw) ...@@ -1999,7 +2013,8 @@ static bool wlc_isgoodchip(struct wlc_hw_info *wlc_hw)
/* reject unsupported corerev */ /* reject unsupported corerev */
if (!VALID_COREREV(wlc_hw->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; return false;
} }
...@@ -2047,8 +2062,8 @@ static char *wlc_get_macaddr(struct wlc_hw_info *wlc_hw) ...@@ -2047,8 +2062,8 @@ static char *wlc_get_macaddr(struct wlc_hw_info *wlc_hw)
macaddr = getvar(wlc_hw->vars, varname); macaddr = getvar(wlc_hw->vars, varname);
if (macaddr == NULL) { if (macaddr == NULL) {
WL_ERROR("wl%d: wlc_get_macaddr: macaddr getvar(%s) not found\n", wiphy_err(wlc_hw->wlc->wiphy, "wl%d: wlc_get_macaddr: macaddr "
wlc_hw->unit, varname); "getvar(%s) not found\n", wlc_hw->unit, varname);
} }
return macaddr; return macaddr;
...@@ -2182,14 +2197,16 @@ void wlc_bmac_corereset(struct wlc_hw_info *wlc_hw, u32 flags) ...@@ -2182,14 +2197,16 @@ void wlc_bmac_corereset(struct wlc_hw_info *wlc_hw, u32 flags)
if (ai_iscoreup(wlc_hw->sih)) { if (ai_iscoreup(wlc_hw->sih)) {
for (i = 0; i < NFIFO; i++) for (i = 0; i < NFIFO; i++)
if ((wlc_hw->di[i]) && (!dma_txreset(wlc_hw->di[i]))) { if ((wlc_hw->di[i]) && (!dma_txreset(wlc_hw->di[i]))) {
WL_ERROR("wl%d: %s: dma_txreset[%d]: cannot stop dma\n", wiphy_err(wlc_hw->wlc->wiphy, "wl%d: %s: "
wlc_hw->unit, __func__, i); "dma_txreset[%d]: cannot stop dma\n",
wlc_hw->unit, __func__, i);
} }
if ((wlc_hw->di[RX_FIFO]) if ((wlc_hw->di[RX_FIFO])
&& (!wlc_dma_rxreset(wlc_hw, RX_FIFO))) { && (!wlc_dma_rxreset(wlc_hw, RX_FIFO))) {
WL_ERROR("wl%d: %s: dma_rxreset[%d]: cannot stop dma\n", wiphy_err(wlc_hw->wlc->wiphy, "wl%d: %s: dma_rxreset"
wlc_hw->unit, __func__, RX_FIFO); "[%d]: cannot stop dma\n",
wlc_hw->unit, __func__, RX_FIFO);
} }
} }
/* if noreset, just stop the psm and return */ /* if noreset, just stop the psm and return */
...@@ -2305,6 +2322,7 @@ static void wlc_coreinit(struct wlc_info *wlc) ...@@ -2305,6 +2322,7 @@ static void wlc_coreinit(struct wlc_info *wlc)
bool fifosz_fixup = false; bool fifosz_fixup = false;
int err = 0; int err = 0;
u16 buf[NFIFO]; u16 buf[NFIFO];
struct wiphy *wiphy = wlc->wiphy;
regs = wlc_hw->regs; regs = wlc_hw->regs;
...@@ -2328,8 +2346,8 @@ static void wlc_coreinit(struct wlc_info *wlc) ...@@ -2328,8 +2346,8 @@ static void wlc_coreinit(struct wlc_info *wlc)
SPINWAIT(((R_REG(&regs->macintstatus) & MI_MACSSPNDD) == 0), SPINWAIT(((R_REG(&regs->macintstatus) & MI_MACSSPNDD) == 0),
1000 * 1000); 1000 * 1000);
if ((R_REG(&regs->macintstatus) & MI_MACSSPNDD) == 0) if ((R_REG(&regs->macintstatus) & MI_MACSSPNDD) == 0)
WL_ERROR("wl%d: wlc_coreinit: ucode did not self-suspend!\n", wiphy_err(wiphy, "wl%d: wlc_coreinit: ucode did not self-"
wlc_hw->unit); "suspend!\n", wlc_hw->unit);
wlc_gpio_init(wlc); wlc_gpio_init(wlc);
...@@ -2339,18 +2357,20 @@ static void wlc_coreinit(struct wlc_info *wlc) ...@@ -2339,18 +2357,20 @@ static void wlc_coreinit(struct wlc_info *wlc)
if (WLCISNPHY(wlc_hw->band)) if (WLCISNPHY(wlc_hw->band))
wlc_write_inits(wlc_hw, d11n0initvals16); wlc_write_inits(wlc_hw, d11n0initvals16);
else else
WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n", wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
__func__, wlc_hw->unit, wlc_hw->corerev); " %d\n", __func__, wlc_hw->unit,
wlc_hw->corerev);
} else if (D11REV_IS(wlc_hw->corerev, 24)) { } else if (D11REV_IS(wlc_hw->corerev, 24)) {
if (WLCISLCNPHY(wlc_hw->band)) { if (WLCISLCNPHY(wlc_hw->band)) {
wlc_write_inits(wlc_hw, d11lcn0initvals24); wlc_write_inits(wlc_hw, d11lcn0initvals24);
} else { } else {
WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n", wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
__func__, wlc_hw->unit, wlc_hw->corerev); " %d\n", __func__, wlc_hw->unit,
wlc_hw->corerev);
} }
} else { } else {
WL_ERROR("%s: wl%d: unsupported corerev %d\n", wiphy_err(wiphy, "%s: wl%d: unsupported corerev %d\n",
__func__, wlc_hw->unit, wlc_hw->corerev); __func__, wlc_hw->unit, wlc_hw->corerev);
} }
/* For old ucode, txfifo sizes needs to be modified(increased) */ /* For old ucode, txfifo sizes needs to be modified(increased) */
...@@ -2392,8 +2412,9 @@ static void wlc_coreinit(struct wlc_info *wlc) ...@@ -2392,8 +2412,9 @@ static void wlc_coreinit(struct wlc_info *wlc)
err = -1; err = -1;
} }
if (err != 0) { if (err != 0) {
WL_ERROR("wlc_coreinit: txfifo mismatch: ucode size %d driver size %d index %d\n", wiphy_err(wiphy, "wlc_coreinit: txfifo mismatch: ucode size %d"
buf[i], wlc_hw->xmtfifo_sz[i], i); " driver size %d index %d\n", buf[i],
wlc_hw->xmtfifo_sz[i], i);
ASSERT(0); ASSERT(0);
} }
...@@ -2588,16 +2609,18 @@ static void wlc_ucode_download(struct wlc_hw_info *wlc_hw) ...@@ -2588,16 +2609,18 @@ static void wlc_ucode_download(struct wlc_hw_info *wlc_hw)
bcm43xx_16_mimosz); bcm43xx_16_mimosz);
wlc_hw->ucode_loaded = true; wlc_hw->ucode_loaded = true;
} else } else
WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n", wiphy_err(wlc->wiphy, "%s: wl%d: unsupported phy in "
__func__, wlc_hw->unit, wlc_hw->corerev); "corerev %d\n",
__func__, wlc_hw->unit, wlc_hw->corerev);
} else if (D11REV_IS(wlc_hw->corerev, 24)) { } else if (D11REV_IS(wlc_hw->corerev, 24)) {
if (WLCISLCNPHY(wlc_hw->band)) { if (WLCISLCNPHY(wlc_hw->band)) {
wlc_ucode_write(wlc_hw, bcm43xx_24_lcn, wlc_ucode_write(wlc_hw, bcm43xx_24_lcn,
bcm43xx_24_lcnsz); bcm43xx_24_lcnsz);
wlc_hw->ucode_loaded = true; wlc_hw->ucode_loaded = true;
} else { } else {
WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n", wiphy_err(wlc->wiphy, "%s: wl%d: unsupported phy in "
__func__, wlc_hw->unit, wlc_hw->corerev); "corerev %d\n",
__func__, wlc_hw->unit, wlc_hw->corerev);
} }
} }
} }
...@@ -2690,6 +2713,7 @@ void wlc_bmac_fifoerrors(struct wlc_hw_info *wlc_hw) ...@@ -2690,6 +2713,7 @@ void wlc_bmac_fifoerrors(struct wlc_hw_info *wlc_hw)
uint unit; uint unit;
uint intstatus, idx; uint intstatus, idx;
d11regs_t *regs = wlc_hw->regs; d11regs_t *regs = wlc_hw->regs;
struct wiphy *wiphy = wlc_hw->wlc->wiphy;
unit = wlc_hw->unit; unit = wlc_hw->unit;
...@@ -2704,41 +2728,42 @@ void wlc_bmac_fifoerrors(struct wlc_hw_info *wlc_hw) ...@@ -2704,41 +2728,42 @@ void wlc_bmac_fifoerrors(struct wlc_hw_info *wlc_hw)
unit, idx, intstatus); unit, idx, intstatus);
if (intstatus & I_RO) { if (intstatus & I_RO) {
WL_ERROR("wl%d: fifo %d: receive fifo overflow\n", wiphy_err(wiphy, "wl%d: fifo %d: receive fifo "
unit, idx); "overflow\n", unit, idx);
wlc_hw->wlc->pub->_cnt->rxoflo++; wlc_hw->wlc->pub->_cnt->rxoflo++;
fatal = true; fatal = true;
} }
if (intstatus & I_PC) { 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); unit, idx);
wlc_hw->wlc->pub->_cnt->dmade++; wlc_hw->wlc->pub->_cnt->dmade++;
fatal = true; fatal = true;
} }
if (intstatus & I_PD) { 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++; wlc_hw->wlc->pub->_cnt->dmada++;
fatal = true; fatal = true;
} }
if (intstatus & I_DE) { if (intstatus & I_DE) {
WL_ERROR("wl%d: fifo %d: descriptor protocol error\n", wiphy_err(wiphy, "wl%d: fifo %d: descriptor protocol "
unit, idx); "error\n", unit, idx);
wlc_hw->wlc->pub->_cnt->dmape++; wlc_hw->wlc->pub->_cnt->dmape++;
fatal = true; fatal = true;
} }
if (intstatus & I_RU) { if (intstatus & I_RU) {
WL_ERROR("wl%d: fifo %d: receive descriptor underflow\n", wiphy_err(wiphy, "wl%d: fifo %d: receive descriptor "
idx, unit); "underflow\n", idx, unit);
wlc_hw->wlc->pub->_cnt->rxuflo[idx]++; wlc_hw->wlc->pub->_cnt->rxuflo[idx]++;
} }
if (intstatus & I_XU) { if (intstatus & I_XU) {
WL_ERROR("wl%d: fifo %d: transmit fifo underflow\n", wiphy_err(wiphy, "wl%d: fifo %d: transmit fifo "
idx, unit); "underflow\n", idx, unit);
wlc_hw->wlc->pub->_cnt->txuflo++; wlc_hw->wlc->pub->_cnt->txuflo++;
fatal = true; fatal = true;
} }
...@@ -3038,7 +3063,8 @@ bool BCMFASTPATH wlc_isr(struct wlc_info *wlc, bool *wantdpc) ...@@ -3038,7 +3063,8 @@ bool BCMFASTPATH wlc_isr(struct wlc_info *wlc, bool *wantdpc)
macintstatus = wlc_intstatus(wlc, true); macintstatus = wlc_intstatus(wlc, true);
if (macintstatus == 0xffffffff) 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 */ /* it is not for us */
if (macintstatus == 0) if (macintstatus == 0)
...@@ -3096,7 +3122,7 @@ wlc_bmac_txstatus(struct wlc_hw_info *wlc_hw, bool bound, bool *fatal) ...@@ -3096,7 +3122,7 @@ wlc_bmac_txstatus(struct wlc_hw_info *wlc_hw, bool bound, bool *fatal)
&& (s1 = R_REG(&regs->frmtxstatus)) & TXS_V) { && (s1 = R_REG(&regs->frmtxstatus)) & TXS_V) {
if (s1 == 0xffffffff) { 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__); wlc_hw->unit, __func__);
ASSERT(s1 != 0xffffffff); ASSERT(s1 != 0xffffffff);
return morepending; return morepending;
...@@ -3134,6 +3160,7 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc) ...@@ -3134,6 +3160,7 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
struct wlc_hw_info *wlc_hw = wlc->hw; struct wlc_hw_info *wlc_hw = wlc->hw;
d11regs_t *regs = wlc_hw->regs; d11regs_t *regs = wlc_hw->regs;
u32 mc, mi; u32 mc, mi;
struct wiphy *wiphy = wlc->wiphy;
WL_TRACE("wl%d: wlc_suspend_mac_and_wait: bandunit %d\n", WL_TRACE("wl%d: wlc_suspend_mac_and_wait: bandunit %d\n",
wlc_hw->unit, wlc_hw->band->bandunit); wlc_hw->unit, wlc_hw->band->bandunit);
...@@ -3151,7 +3178,8 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc) ...@@ -3151,7 +3178,8 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
mc = R_REG(&regs->maccontrol); mc = R_REG(&regs->maccontrol);
if (mc == 0xffffffff) { 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); wl_down(wlc->wl);
return; return;
} }
...@@ -3161,7 +3189,8 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc) ...@@ -3161,7 +3189,8 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
mi = R_REG(&regs->macintstatus); mi = R_REG(&regs->macintstatus);
if (mi == 0xffffffff) { 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); wl_down(wlc->wl);
return; return;
} }
...@@ -3173,18 +3202,20 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc) ...@@ -3173,18 +3202,20 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
WLC_MAX_MAC_SUSPEND); WLC_MAX_MAC_SUSPEND);
if (!(R_REG(&regs->macintstatus) & MI_MACSSPNDD)) { if (!(R_REG(&regs->macintstatus) & MI_MACSSPNDD)) {
WL_ERROR("wl%d: wlc_suspend_mac_and_wait: waited %d uS and MI_MACSSPNDD is still not on.\n", wiphy_err(wiphy, "wl%d: wlc_suspend_mac_and_wait: waited %d uS"
wlc_hw->unit, WLC_MAX_MAC_SUSPEND); " and MI_MACSSPNDD is still not on.\n",
WL_ERROR("wl%d: psmdebug 0x%08x, phydebug 0x%08x, psm_brc 0x%04x\n", wlc_hw->unit, WLC_MAX_MAC_SUSPEND);
wlc_hw->unit, wiphy_err(wiphy, "wl%d: psmdebug 0x%08x, phydebug 0x%08x, "
R_REG(&regs->psmdebug), "psm_brc 0x%04x\n", wlc_hw->unit,
R_REG(&regs->phydebug), R_REG(&regs->psmdebug),
R_REG(&regs->psm_brc)); R_REG(&regs->phydebug),
R_REG(&regs->psm_brc));
} }
mc = R_REG(&regs->maccontrol); mc = R_REG(&regs->maccontrol);
if (mc == 0xffffffff) { 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); wl_down(wlc->wl);
return; return;
} }
...@@ -3321,6 +3352,7 @@ static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw) ...@@ -3321,6 +3352,7 @@ static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
{ {
d11regs_t *regs; d11regs_t *regs;
u32 w, val; u32 w, val;
struct wiphy *wiphy = wlc_hw->wlc->wiphy;
WL_TRACE("wl%d: validate_chip_access\n", wlc_hw->unit); WL_TRACE("wl%d: validate_chip_access\n", wlc_hw->unit);
...@@ -3341,8 +3373,8 @@ static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw) ...@@ -3341,8 +3373,8 @@ static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
(void)R_REG(&regs->objaddr); (void)R_REG(&regs->objaddr);
val = R_REG(&regs->objdata); val = R_REG(&regs->objdata);
if (val != (u32) 0xaa5555aa) { if (val != (u32) 0xaa5555aa) {
WL_ERROR("wl%d: validate_chip_access: SHM = 0x%x, expected 0xaa5555aa\n", wiphy_err(wiphy, "wl%d: validate_chip_access: SHM = 0x%x, "
wlc_hw->unit, val); "expected 0xaa5555aa\n", wlc_hw->unit, val);
return false; return false;
} }
...@@ -3354,8 +3386,8 @@ static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw) ...@@ -3354,8 +3386,8 @@ static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
(void)R_REG(&regs->objaddr); (void)R_REG(&regs->objaddr);
val = R_REG(&regs->objdata); val = R_REG(&regs->objdata);
if (val != (u32) 0x55aaaa55) { if (val != (u32) 0x55aaaa55) {
WL_ERROR("wl%d: validate_chip_access: SHM = 0x%x, expected 0x55aaaa55\n", wiphy_err(wiphy, "wl%d: validate_chip_access: SHM = 0x%x, "
wlc_hw->unit, val); "expected 0x55aaaa55\n", wlc_hw->unit, val);
return false; return false;
} }
...@@ -3369,10 +3401,10 @@ static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw) ...@@ -3369,10 +3401,10 @@ static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
w = R_REG(&regs->maccontrol); w = R_REG(&regs->maccontrol);
if ((w != (MCTL_IHR_EN | MCTL_WAKE)) && if ((w != (MCTL_IHR_EN | MCTL_WAKE)) &&
(w != (MCTL_IHR_EN | MCTL_GMODE | 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", wiphy_err(wiphy, "wl%d: validate_chip_access: maccontrol = "
wlc_hw->unit, w, "0x%x, expected 0x%x or 0x%x\n", wlc_hw->unit, w,
(MCTL_IHR_EN | MCTL_WAKE), (MCTL_IHR_EN | MCTL_WAKE),
(MCTL_IHR_EN | MCTL_GMODE | MCTL_WAKE)); (MCTL_IHR_EN | MCTL_GMODE | MCTL_WAKE));
return false; return false;
} }
...@@ -3403,8 +3435,8 @@ void wlc_bmac_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on) ...@@ -3403,8 +3435,8 @@ void wlc_bmac_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on)
tmp = R_REG(&regs->clk_ctl_st); tmp = R_REG(&regs->clk_ctl_st);
if ((tmp & (CCS_ERSRC_AVAIL_HT)) != if ((tmp & (CCS_ERSRC_AVAIL_HT)) !=
(CCS_ERSRC_AVAIL_HT)) { (CCS_ERSRC_AVAIL_HT)) {
WL_ERROR("%s: turn on PHY PLL failed\n", wiphy_err(wlc_hw->wlc->wiphy, "%s: turn on PHY"
__func__); " PLL failed\n", __func__);
ASSERT(0); ASSERT(0);
} }
} else { } else {
...@@ -3421,8 +3453,8 @@ void wlc_bmac_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on) ...@@ -3421,8 +3453,8 @@ void wlc_bmac_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on)
(CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL)) (CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL))
!= !=
(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", wiphy_err(wlc_hw->wlc->wiphy, "%s: turn on "
__func__); "PHY PLL failed\n", __func__);
ASSERT(0); ASSERT(0);
} }
} }
......
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