Code cleanup. Replaced proprietary function by dev_err(). Signed-off-by: Roland Vossen <rvossen@xxxxxxxxxxxx> Reviewed-by: Arend van Spriel <arend@xxxxxxxxxxxx> --- drivers/staging/brcm80211/brcmsmac/wlc_main.c | 187 ++++++++++++++----------- 1 files changed, 104 insertions(+), 83 deletions(-) diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.c b/drivers/staging/brcm80211/brcmsmac/wlc_main.c index a639c70..7befb72 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_main.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.c @@ -276,7 +276,8 @@ static void wlc_txflowcontrol_signal(struct wlc_info *wlc, static void wlc_txflowcontrol_reset(struct wlc_info *wlc); static u16 wlc_compute_airtime(struct wlc_info *wlc, ratespec_t rspec, uint length); -static void wlc_compute_cck_plcp(ratespec_t rate, uint length, u8 *plcp); +static void wlc_compute_cck_plcp(struct wlc_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 wlc_info *wlc, ratespec_t rate, @@ -400,7 +401,8 @@ void wlc_reset(struct wlc_info *wlc) void wlc_fatal_error(struct wlc_info *wlc) { - WL_ERROR("wl%d: fatal error, reinitializing\n", wlc->pub->unit); + dev_err(wlc->dev, "wl%d: fatal error, reinitializing\n", + wlc->pub->unit); wl_init(wlc->wl); } @@ -622,7 +624,7 @@ bool wlc_ps_check(struct wlc_info *wlc) * take care of the condition. This is just to avoid assert */ if (tmp == 0xffffffff) { - WL_ERROR("wl%d: %s: dead chip\n", + dev_err(wlc->dev, "wl%d: %s: dead chip\n", wlc->pub->unit, __func__); return DEVICEREMOVED(wlc); } @@ -632,7 +634,7 @@ bool wlc_ps_check(struct wlc_info *wlc) if (hps != ((tmp & MCTL_HPS) != 0)) { int idx; struct wlc_bsscfg *cfg; - WL_ERROR("wl%d: hps not sync, sw %d, maccontrol 0x%x\n", + dev_err(wlc->dev, "wl%d: hps not sync, sw %d, maccontrol 0x%x\n", wlc->pub->unit, hps, tmp); FOREACH_BSS(wlc, idx, cfg) { if (!BSSCFG_STA(cfg)) @@ -647,7 +649,7 @@ bool wlc_ps_check(struct wlc_info *wlc) wake = STAY_AWAKE(wlc) || wlc->hw->wake_override; wake_ok = (wake == ((tmp & MCTL_WAKE) != 0)); if (hps && !wake_ok) { - WL_ERROR("wl%d: wake not sync, sw %d maccontrol 0x%x\n", + dev_err(wlc->dev, "wl%d: wake not sync, sw %d maccontrol 0x%x\n", wlc->pub->unit, wake, tmp); res = false; } @@ -827,7 +829,7 @@ void wlc_set_chanspec(struct wlc_info *wlc, chanspec_t chanspec) chanspec_t old_chanspec = wlc->chanspec; if (!wlc_valid_chanspec_db(wlc->cmi, chanspec)) { - WL_ERROR("wl%d: %s: Bad channel %d\n", + dev_err(wlc->dev, "wl%d: %s: Bad channel %d\n", wlc->pub->unit, __func__, CHSPEC_CHANNEL(chanspec)); ASSERT(wlc_valid_chanspec_db(wlc->cmi, chanspec)); return; @@ -839,7 +841,7 @@ void wlc_set_chanspec(struct wlc_info *wlc, chanspec_t chanspec) if (wlc->band->bandunit != bandunit || wlc->bandinit_pending) { switchband = true; if (wlc->bandlocked) { - WL_ERROR("wl%d: %s: chspec %d band is locked!\n", + dev_err(wlc->dev, "wl%d: %s: chspec %d band is locked!\n", wlc->pub->unit, __func__, CHSPEC_CHANNEL(chanspec)); return; @@ -1371,7 +1373,8 @@ void wlc_wme_setparams(struct wlc_info *wlc, u16 aci, /* Only apply params if the core is out of reset and has clocks */ if (!wlc->clk) { - WL_ERROR("wl%d: %s : no-clock\n", wlc->pub->unit, __func__); + dev_err(wlc->dev, "wl%d: %s : no-clock\n", wlc->pub->unit, + __func__); return; } @@ -1395,7 +1398,7 @@ void wlc_wme_setparams(struct wlc_info *wlc, u16 aci, if (acp_shm.aifs < EDCF_AIFSN_MIN || acp_shm.aifs > EDCF_AIFSN_MAX) { - WL_ERROR("wl%d: wlc_edcf_setparams: bad aifs %d\n", + dev_err(wlc->dev, "wl%d: wlc_edcf_setparams: bad aifs %d\n", wlc->pub->unit, acp_shm.aifs); continue; } @@ -1489,14 +1492,16 @@ bool wlc_timers_init(struct wlc_info *wlc, int unit) wlc->wdtimer = wl_init_timer(wlc->wl, wlc_watchdog_by_timer, wlc, "watchdog"); if (!wlc->wdtimer) { - WL_ERROR("wl%d: wl_init_timer for wdtimer failed\n", unit); + dev_err(wlc->dev, "wl%d: wl_init_timer for wdtimer failed\n", + unit); goto fail; } wlc->radio_timer = wl_init_timer(wlc->wl, wlc_radio_timer, wlc, "radio"); if (!wlc->radio_timer) { - WL_ERROR("wl%d: wl_init_timer for radio_timer failed\n", unit); + dev_err(wlc->dev, "wl%d: wl_init_timer for radio_timer failed" + "\n", unit); goto fail; } @@ -1643,20 +1648,23 @@ static uint wlc_attach_module(struct wlc_info *wlc) wlc->asi = wlc_antsel_attach(wlc); if (wlc->asi == NULL) { - WL_ERROR("wl%d: wlc_attach: wlc_antsel_attach failed\n", unit); + dev_err(wlc->dev, "wl%d: wlc_attach: wlc_antsel_attach failed" + "\n", unit); err = 44; goto fail; } wlc->ampdu = wlc_ampdu_attach(wlc); if (wlc->ampdu == NULL) { - WL_ERROR("wl%d: wlc_attach: wlc_ampdu_attach failed\n", unit); + dev_err(wlc->dev, "wl%d: wlc_attach: wlc_ampdu_attach failed\n" + , unit); err = 50; goto fail; } if ((wlc_stf_attach(wlc) != 0)) { - WL_ERROR("wl%d: wlc_attach: wlc_stf_attach failed\n", unit); + dev_err(wlc->dev, "wl%d: wlc_attach: wlc_stf_attach failed\n", + unit); err = 68; goto fail; } @@ -1828,7 +1836,8 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, goto fail; if (!wlc_timers_init(wlc, unit)) { - WL_ERROR("wl%d: %s: wlc_init_timer failed\n", unit, __func__); + dev_err(dev, "wl%d: %s: wlc_init_timer failed\n", unit, + __func__); err = 32; goto fail; } @@ -1836,7 +1845,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, /* depend on rateset, gmode */ wlc->cmi = wlc_channel_mgr_attach(wlc); if (!wlc->cmi) { - WL_ERROR("wl%d: %s: wlc_channel_mgr_attach failed\n", + dev_err(dev, "wl%d: %s: wlc_channel_mgr_attach failed\n", unit, __func__); err = 33; goto fail; @@ -1852,7 +1861,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, /* allocate our initial queue */ qi = wlc_txq_alloc(wlc); if (qi == NULL) { - WL_ERROR("wl%d: %s: failed to malloc tx queue\n", + dev_err(dev, "wl%d: %s: failed to malloc tx queue\n", unit, __func__); err = 100; goto fail; @@ -1937,7 +1946,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, return (void *)wlc; fail: - WL_ERROR("wl%d: %s: failed with err %d\n", unit, __func__, err); + dev_err(dev, "wl%d: %s: failed with err %d\n", unit, __func__, err); if (wlc) wlc_detach(wlc); @@ -1955,7 +1964,7 @@ static void wlc_attach_antgain_init(struct wlc_info *wlc) /* default antenna gain for srom rev 1 is 2 dBm (8 qdbm) */ wlc->band->antgain = 8; } else if (wlc->band->antgain == -1) { - WL_ERROR("wl%d: %s: Invalid antennas available in srom, using 2dB\n", + dev_err(wlc->dev, "wl%d: %s: Invalid antennas available in srom, using 2dB\n", unit, __func__); wlc->band->antgain = 8; } else { @@ -1995,7 +2004,7 @@ static bool wlc_attach_stf_ant_init(struct wlc_info *wlc) aa = (s8) getintvar(vars, (BAND_5G(bandtype) ? "aa1" : "aa0")); if ((aa < 1) || (aa > 15)) { - WL_ERROR("wl%d: %s: Invalid antennas available in srom (0x%x), using 3\n", + dev_err(wlc->dev, "wl%d: %s: Invalid antennas available in srom (0x%x), using 3\n", unit, __func__, aa); aa = 3; } @@ -2272,7 +2281,8 @@ static void wlc_radio_timer(void *arg) struct wlc_info *wlc = (struct wlc_info *) arg; if (DEVICEREMOVED(wlc)) { - WL_ERROR("wl%d: %s: dead chip\n", wlc->pub->unit, __func__); + dev_err(wlc->dev, "wl%d: %s: dead chip\n", wlc->pub->unit, + __func__); wl_down(wlc->wl); return; } @@ -2379,7 +2389,8 @@ static void wlc_watchdog(void *arg) return; if (DEVICEREMOVED(wlc)) { - WL_ERROR("wl%d: %s: dead chip\n", wlc->pub->unit, __func__); + dev_err(wlc->dev, "wl%d: %s: dead chip\n", wlc->pub->unit, + __func__); wl_down(wlc->wl); return; } @@ -2495,7 +2506,9 @@ int wlc_up(struct wlc_info *wlc) if (!BSSCFG_STA(bsscfg) || !bsscfg->enable || !bsscfg->BSS) continue; - WL_ERROR("wl%d.%d: wlc_up: rfdisable -> " "wlc_bsscfg_disable()\n", + dev_err(wlc->dev, "wl%d.%d: wlc_up: " + "rfdisable -> " + "wlc_bsscfg_disable()\n", wlc->pub->unit, idx); } } @@ -2600,7 +2613,7 @@ uint wlc_down(struct wlc_info *wlc) /* check if we are already in the going down path */ if (wlc->going_down) { - WL_ERROR("wl%d: %s: Driver going down so return\n", + dev_err(wlc->dev, "wl%d: %s: Driver going down so return\n", wlc->pub->unit, __func__); return 0; } @@ -2746,7 +2759,7 @@ int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config) default: /* Error */ - WL_ERROR("wl%d: %s: invalid gmode %d\n", + dev_err(wlc->dev, "wl%d: %s: invalid gmode %d\n", wlc->pub->unit, __func__, gmode); return BCME_UNSUPPORTED; } @@ -3001,7 +3014,8 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, /* If the device is turned off, then it's not "removed" */ if (!wlc->pub->hw_off && DEVICEREMOVED(wlc)) { - WL_ERROR("wl%d: %s: dead chip\n", wlc->pub->unit, __func__); + dev_err(wlc->dev, "wl%d: %s: dead chip\n", wlc->pub->unit, + __func__); wl_down(wlc->wl); return BCME_ERROR; } @@ -3041,7 +3055,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, default: if ((arg == NULL) || (len <= 0)) { - WL_ERROR("wl%d: %s: Command %d needs arguments\n", + dev_err(wlc->dev, "wl%d: %s: Command %d needs arguments\n", wlc->pub->unit, __func__, cmd); bcmerror = BCME_BADARG; goto done; @@ -3462,7 +3476,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, if ((radiomask == 0) || (radiomask & ~validbits) || (radioval & ~validbits) || ((radioval & ~radiomask) != 0)) { - WL_ERROR("SET_RADIO with wrong bits 0x%x\n", + dev_err(wlc->dev, "SET_RADIO with wrong bits 0x%x\n", val); bcmerror = BCME_RANGE; break; @@ -4098,7 +4112,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len, #endif case WLC_LAST: - WL_ERROR("%s: WLC_LAST\n", __func__); + dev_err(wlc->dev, "%s: WLC_LAST\n", __func__); } done: @@ -4308,7 +4322,7 @@ wlc_iovar_op(struct wlc_info *wlc, const char *name, if (!set && (len == sizeof(int)) && !(IS_ALIGNED((unsigned long)(arg), (uint) sizeof(int)))) { - WL_ERROR("wl%d: %s unaligned get ptr for %s\n", + dev_err(wlc->dev, "wl%d: %s unaligned get ptr for %s\n", wlc->pub->unit, __func__, name); ASSERT(0); } @@ -4522,7 +4536,8 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid, break; default: - WL_ERROR("wl%d: %s: unsupported\n", wlc->pub->unit, __func__); + dev_err(wlc->dev, "wl%d: %s: unsupported\n", wlc->pub->unit, + __func__); err = BCME_UNSUPPORTED; break; } @@ -4736,7 +4751,7 @@ void wlc_statsupd(struct wlc_info *wlc) /* check for rx fifo 0 overflow */ delta = (u16) (wlc->core->macstat_snapshot->rxf0ovfl - rxf0ovfl); if (delta) - WL_ERROR("wl%d: %u rx fifo 0 overflows!\n", + dev_err(wlc->dev, "wl%d: %u rx fifo 0 overflows!\n", wlc->pub->unit, delta); /* check for tx fifo underflows */ @@ -4745,7 +4760,7 @@ void wlc_statsupd(struct wlc_info *wlc) (u16) (wlc->core->macstat_snapshot->txfunfl[i] - txfunfl[i]); if (delta) - WL_ERROR("wl%d: %u tx fifo %d underflows!\n", + dev_err(wlc->dev, "wl%d: %u tx fifo %d underflows!\n", wlc->pub->unit, delta, i); } #endif /* BCMDBG */ @@ -4795,7 +4810,7 @@ void wlc_statsupd(struct wlc_info *wlc) bool wlc_chipmatch(u16 vendor, u16 device) { if (vendor != PCI_VENDOR_ID_BROADCOM) { - WL_ERROR("wlc_chipmatch: unknown vendor id %04x\n", vendor); + pr_err("wlc_chipmatch: unknown vendor id %04x\n", vendor); return false; } @@ -4807,7 +4822,7 @@ bool wlc_chipmatch(u16 vendor, u16 device) if ((device == BCM43236_D11N_ID) || (device == BCM43236_D11N2G_ID)) return true; - WL_ERROR("wlc_chipmatch: unknown device id %04x\n", device); + pr_err("wlc_chipmatch: unknown device id %04x\n", device); return false; } @@ -4998,7 +5013,7 @@ wlc_prec_enq_head(struct wlc_info *wlc, struct pktq *q, struct sk_buff *pkt, p = pktq_peek_tail(q, &eprec); ASSERT(p != NULL); if (eprec > prec) { - WL_ERROR("%s: Failing: eprec %d > prec %d\n", + dev_err(wlc->dev, "%s: Failing: eprec %d > prec %d\n", __func__, eprec, prec); return false; } @@ -5015,7 +5030,7 @@ wlc_prec_enq_head(struct wlc_info *wlc, struct pktq *q, struct sk_buff *pkt, /* Refuse newer packet unless configured to discard oldest */ if (eprec == prec && !discard_oldest) { - WL_ERROR("%s: No where to go, prec == %d\n", + dev_err(wlc->dev, "%s: No where to go, prec == %d\n", __func__, prec); return false; } @@ -5062,7 +5077,7 @@ void BCMFASTPATH wlc_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu, if (!wlc_prec_enq(wlc, q, sdu, prec)) { if (!EDCF_ENAB(wlc->pub) || (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL)) - WL_ERROR("wl%d: wlc_txq_enq: txq overflow\n", + dev_err(wlc->dev, "wl%d: wlc_txq_enq: txq overflow\n", wlc->pub->unit); /* @@ -5249,7 +5264,7 @@ wlc_txfifo(struct wlc_info *wlc, uint fifo, struct sk_buff *p, bool commit, BCMCFID(wlc, frameid); if (dma_txfast(wlc->hw->di[fifo], p, commit) < 0) { - WL_ERROR("wlc_txfifo: fatal, toss frames !!!\n"); + dev_err(wlc->dev, "wlc_txfifo: fatal, toss frames !!!\n"); } } @@ -5289,7 +5304,7 @@ wlc_compute_airtime(struct wlc_info *wlc, ratespec_t rspec, uint length) usec = (length << 3) / 11; break; default: - WL_ERROR("wl%d: wlc_compute_airtime: unsupported rspec 0x%x\n", + dev_err(wlc->dev, "wl%d: wlc_compute_airtime: unsupported rspec 0x%x\n", wlc->pub->unit, rspec); ASSERT((const char *)"Bad phy_rate" == NULL); break; @@ -5307,7 +5322,7 @@ wlc_compute_plcp(struct wlc_info *wlc, ratespec_t rspec, uint length, u8 *plcp) } else if (IS_OFDM(rspec)) { wlc_compute_ofdm_plcp(rspec, length, plcp); } else { - wlc_compute_cck_plcp(rspec, length, plcp); + wlc_compute_cck_plcp(wlc, rspec, length, plcp); } return; } @@ -5359,7 +5374,8 @@ wlc_compute_ofdm_plcp(ratespec_t rspec, u32 length, u8 *plcp) * Broken out for PRQ. */ -static void wlc_cck_plcp_set(int rate_500, uint length, u8 *plcp) +static void wlc_cck_plcp_set(struct wlc_info *wlc, int rate_500, uint length, + u8 *plcp) { u16 usec = 0; u8 le = 0; @@ -5386,7 +5402,8 @@ static void wlc_cck_plcp_set(int rate_500, uint length, u8 *plcp) break; default: - WL_ERROR("wlc_cck_plcp_set: unsupported rate %d\n", rate_500); + dev_err(wlc->dev, "wlc_cck_plcp_set: unsupported rate %d\n", + rate_500); rate_500 = WLC_RATE_1M; usec = length << 3; break; @@ -5404,13 +5421,14 @@ static void wlc_cck_plcp_set(int rate_500, uint length, u8 *plcp) } /* Rate: 802.11 rate code, length: PSDU length in octets */ -static void wlc_compute_cck_plcp(ratespec_t rspec, uint length, u8 *plcp) +static void wlc_compute_cck_plcp(struct wlc_info *wlc, ratespec_t rspec, + uint length, u8 *plcp) { int rate = RSPEC2RATE(rspec); ASSERT(IS_CCK(rspec)); - wlc_cck_plcp_set(rate, length, plcp); + wlc_cck_plcp_set(wlc, rate, length, plcp); } /* wlc_compute_frame_dur() @@ -5526,7 +5544,7 @@ u16 BCMFASTPATH wlc_phytxctl1_calc(struct wlc_info *wlc, ratespec_t rspec) bw = RSPEC_GET_BW(rspec); /* 10Mhz is not supported yet */ if (bw < PHY_TXC1_BW_20MHZ) { - WL_ERROR("wlc_phytxctl1_calc: bw %d is not supported yet, set to 20L\n", + dev_err(wlc->dev, "wlc_phytxctl1_calc: bw %d is not supported yet, set to 20L\n", bw); bw = PHY_TXC1_BW_20MHZ; } @@ -5552,7 +5570,7 @@ u16 BCMFASTPATH wlc_phytxctl1_calc(struct wlc_info *wlc, ratespec_t rspec) /* get the phyctl byte from rate phycfg table */ phycfg = wlc_rate_legacy_phyctl(RSPEC2RATE(rspec)); if (phycfg == -1) { - WL_ERROR("wlc_phytxctl1_calc: wrong legacy OFDM/CCK rate\n"); + dev_err(wlc->dev, "wlc_phytxctl1_calc: wrong legacy OFDM/CCK rate\n"); ASSERT(0); phycfg = 0; } @@ -5702,7 +5720,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, /* non-AP STA should never use BCMC queue */ ASSERT(queue != TX_BCMC_FIFO); if (queue == TX_BCMC_FIFO) { - WL_ERROR("wl%d: %s: ASSERT queue == TX_BCMC!\n", + dev_err(wlc->dev, "wl%d: %s: ASSERT queue == TX_BCMC!\n", WLCWLUNIT(wlc), __func__); frameid = bcmc_fid_generate(wlc, NULL, txh); } else { @@ -5880,7 +5898,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, if ((txrate[k]->flags & IEEE80211_TX_RC_MCS) && (!IS_MCS(rspec[k]))) { - WL_ERROR("wl%d: %s: IEEE80211_TX_RC_MCS != IS_MCS(rspec)\n", + dev_err(wlc->dev, "wl%d: %s: IEEE80211_TX_RC_MCS != IS_MCS(rspec)\n", WLCWLUNIT(wlc), __func__); ASSERT(0 && "Rate mismatch"); } @@ -6281,12 +6299,12 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, } } } else - WL_ERROR("wl%d: %s txop invalid for rate %d\n", + dev_err(wlc->dev, "wl%d: %s txop invalid for rate %d\n", wlc->pub->unit, fifo_names[queue], RSPEC2RATE(rspec[0])); if (dur > wlc->edcf_txop[ac]) - WL_ERROR("wl%d: %s: %s txop exceeded phylen %d/%d dur %d/%d\n", + dev_err(wlc->dev, "wl%d: %s: %s txop exceeded phylen %d/%d dur %d/%d\n", wlc->pub->unit, __func__, fifo_names[queue], phylen, wlc->fragthresh[queue], @@ -6410,7 +6428,7 @@ void wlc_high_dpc(struct wlc_info *wlc, u32 macintstatus) wlc_tbtt(wlc, regs); if (macintstatus & MI_GP0) { - WL_ERROR("wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n", + dev_err(wlc->dev, "wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n", wlc->pub->unit, wlc->pub->now); printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n", @@ -6429,7 +6447,7 @@ void wlc_high_dpc(struct wlc_info *wlc, u32 macintstatus) } if (macintstatus & MI_RFDISABLE) { - WL_ERROR("wl%d: MAC Detected a change on the RF Disable Input 0x%x\n", + dev_err(wlc->dev, "wl%d: MAC Detected a change on the RF Disable Input 0x%x\n", wlc->pub->unit, R_REG(®s->phydebug) & PDBG_RFD); /* delay the cleanup to wl_down in IBSS case */ @@ -6440,7 +6458,7 @@ void wlc_high_dpc(struct wlc_info *wlc, u32 macintstatus) if (!BSSCFG_STA(bsscfg) || !bsscfg->enable || !bsscfg->BSS) continue; - WL_ERROR("wl%d: wlc_dpc: rfdisable -> wlc_bsscfg_disable()\n", + dev_err(wlc->dev, "wl%d: wlc_dpc: rfdisable -> wlc_bsscfg_disable()\n", wlc->pub->unit); } } @@ -6498,7 +6516,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2) ((txs-> status & TX_STATUS_FRM_RTX_MASK) >> TX_STATUS_FRM_RTX_SHIFT)); - WL_ERROR("%s: INTERMEDIATE but not AMPDU\n", __func__); + dev_err(wlc->dev, "%s: INTERMEDIATE but not AMPDU\n", __func__); return false; } @@ -6520,7 +6538,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2) if (txs->phyerr) { if (WL_ERROR_ON()) { - WL_ERROR("phyerr 0x%x, rate 0x%x\n", + dev_err(wlc->dev, "phyerr 0x%x, rate 0x%x\n", txs->phyerr, txh->MainRates); wlc_print_txdesc(txh); } @@ -6565,7 +6583,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2) lastframe = !ieee80211_has_morefrags(h->frame_control); if (!lastframe) { - WL_ERROR("Not last frame!\n"); + dev_err(wlc->dev, "Not last frame!\n"); } else { u16 sfbl, lfbl; ieee80211_tx_info_clear_status(tx_info); @@ -6616,7 +6634,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2) ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, p); wlc->pub->_cnt->ieee_tx_status++; } else { - WL_ERROR("%s: Not last frame => not calling tx_status\n", + dev_err(wlc->dev, "%s: Not last frame => not calling tx_status\n", __func__); } @@ -6834,7 +6852,7 @@ prep_mac80211_status(struct wlc_info *wlc, d11rxhdr_t *rxh, struct sk_buff *p, rx_status->rate_idx = 11; break; default: - WL_ERROR("%s: Unknown rate\n", __func__); + dev_err(wlc->dev, "%s: Unknown rate\n", __func__); } /* Determine short preamble and rate_idx */ @@ -6845,7 +6863,7 @@ prep_mac80211_status(struct wlc_info *wlc, d11rxhdr_t *rxh, struct sk_buff *p, } else if (IS_OFDM(rspec)) { rx_status->flag |= RX_FLAG_SHORTPRE; } else { - WL_ERROR("%s: Unknown modulation\n", __func__); + dev_err(wlc->dev, "%s: Unknown modulation\n", __func__); } } @@ -6854,11 +6872,11 @@ prep_mac80211_status(struct wlc_info *wlc, d11rxhdr_t *rxh, struct sk_buff *p, if (rxh->RxStatus1 & RXS_DECERR) { rx_status->flag |= RX_FLAG_FAILED_PLCP_CRC; - WL_ERROR("%s: RX_FLAG_FAILED_PLCP_CRC\n", __func__); + dev_err(wlc->dev, "%s: RX_FLAG_FAILED_PLCP_CRC\n", __func__); } if (rxh->RxStatus1 & RXS_FCSERR) { rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; - WL_ERROR("%s: RX_FLAG_FAILED_FCS_CRC\n", __func__); + dev_err(wlc->dev, "%s: RX_FLAG_FAILED_FCS_CRC\n", __func__); } } @@ -6896,7 +6914,8 @@ void wlc_bss_list_free(struct wlc_info *wlc, struct wlc_bss_list *bss_list) uint index; if (!bss_list) { - WL_ERROR("%s: Attempting to free NULL list\n", __func__); + dev_err(wlc->dev, "%s: Attempting to free NULL list\n", + __func__); return; } /* inspect all BSS descriptor */ @@ -6945,7 +6964,7 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p) if (rxh->RxStatus1 & RXS_PBPRES) { if (p->len < 2) { wlc->pub->_cnt->rxrunt++; - WL_ERROR("wl%d: wlc_recv: rcvd runt of len %d\n", + dev_err(wlc->dev, "wl%d: wlc_recv: rcvd runt of len %d\n", wlc->pub->unit, p->len); goto toss; } @@ -6957,10 +6976,10 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p) if (rxh->RxStatus1 & RXS_FCSERR) { if (wlc->pub->mac80211_state & MAC80211_PROMISC_BCNS) { - WL_ERROR("FCSERR while scanning******* - tossing\n"); + dev_err(wlc->dev, "FCSERR while scanning******* - tossing\n"); goto toss; } else { - WL_ERROR("RCSERR!!!\n"); + dev_err(wlc->dev, "RCSERR!!!\n"); goto toss; } } @@ -6981,8 +7000,9 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p) ieee80211_is_mgmt(h->frame_control)) { if ((is_zero_ether_addr(h->addr2) || is_multicast_ether_addr(h->addr2))) { - WL_ERROR("wl%d: %s: dropping a frame with " - "invalid src mac address, a2: %pM\n", + dev_err(wlc->dev, "wl%d: %s: dropping a frame " + "with invalid src mac address, a2: %pM" + "\n", wlc->pub->unit, __func__, h->addr2); wlc->pub->_cnt->rxbadsrcmac++; goto toss; @@ -6996,7 +7016,7 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p) goto toss; if (is_amsdu) { - WL_ERROR("%s: is_amsdu causing toss\n", __func__); + dev_err(wlc->dev, "%s: is_amsdu causing toss\n", __func__); goto toss; } @@ -7063,7 +7083,8 @@ wlc_calc_frame_time(struct wlc_info *wlc, ratespec_t ratespec, u8 preamble_type, if (rate == 0) { ASSERT(0); - WL_ERROR("wl%d: WAR: using rate of 1 mbps\n", wlc->pub->unit); + dev_err(wlc->dev, "wl%d: WAR: using rate of 1 mbps\n", + wlc->pub->unit); rate = WLC_RATE_1M; } @@ -7242,7 +7263,7 @@ void wlc_rate_lookup_init(struct wlc_info *wlc, wlc_rateset_t *rateset) rate = (rateset->rates[i] & RATE_MASK); if (rate > WLC_MAXRATE) { - WL_ERROR("wlc_rate_lookup_init: invalid rate 0x%X in rate set\n", + dev_err(wlc->dev, "wlc_rate_lookup_init: invalid rate 0x%X in rate set\n", rateset->rates[i]); continue; } @@ -7422,7 +7443,7 @@ bool wlc_valid_rate(struct wlc_info *wlc, ratespec_t rspec, int band, return true; error: if (verbose) { - WL_ERROR("wl%d: wlc_valid_rate: rate spec 0x%x not in hw_rateset\n", + dev_err(wlc->dev, "wl%d: wlc_valid_rate: rate spec 0x%x not in hw_rateset\n", wlc->pub->unit, rspec); } @@ -7505,7 +7526,7 @@ wlc_compute_bcntsfoff(struct wlc_info *wlc, ratespec_t rspec, uint bcntsfoff = 0; if (IS_MCS(rspec)) { - WL_ERROR("wl%d: recd beacon with mcs rate; rspec 0x%x\n", + dev_err(wlc->dev, "wl%d: recd beacon with mcs rate; rspec 0x%x\n", wlc->pub->unit, rspec); } else if (IS_OFDM(rspec)) { /* tx delay from MAC through phy to air (2.1 usec) + @@ -7912,7 +7933,7 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band, if (N_ENAB(wlc->pub) && ismcs) { /* mcs only allowed when nmode */ if (stf > PHY_TXC1_MODE_SDM) { - WL_ERROR("wl%d: %s: Invalid stf\n", + dev_err(wlc->dev, "wl%d: %s: Invalid stf\n", WLCWLUNIT(wlc), __func__); bcmerror = BCME_RANGE; goto done; @@ -7923,7 +7944,7 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band, if (!CHSPEC_IS40(wlc->home_chanspec) || ((stf != PHY_TXC1_MODE_SISO) && (stf != PHY_TXC1_MODE_CDD))) { - WL_ERROR("wl%d: %s: Invalid mcs 32\n", + dev_err(wlc->dev, "wl%d: %s: Invalid mcs 32\n", WLCWLUNIT(wlc), __func__); bcmerror = BCME_RANGE; goto done; @@ -7941,7 +7962,7 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band, if ((stf > PHY_TXC1_MODE_STBC) || (!WLC_STBC_CAP_PHY(wlc) && (stf == PHY_TXC1_MODE_STBC))) { - WL_ERROR("wl%d: %s: Invalid STBC\n", + dev_err(wlc->dev, "wl%d: %s: Invalid STBC\n", WLCWLUNIT(wlc), __func__); bcmerror = BCME_RANGE; goto done; @@ -7949,7 +7970,7 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band, } } else if (IS_OFDM(rate)) { if ((stf != PHY_TXC1_MODE_CDD) && (stf != PHY_TXC1_MODE_SISO)) { - WL_ERROR("wl%d: %s: Invalid OFDM\n", + dev_err(wlc->dev, "wl%d: %s: Invalid OFDM\n", WLCWLUNIT(wlc), __func__); bcmerror = BCME_RANGE; goto done; @@ -7957,20 +7978,20 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band, } else if (IS_CCK(rate)) { if ((cur_band->bandtype != WLC_BAND_2G) || (stf != PHY_TXC1_MODE_SISO)) { - WL_ERROR("wl%d: %s: Invalid CCK\n", + dev_err(wlc->dev, "wl%d: %s: Invalid CCK\n", WLCWLUNIT(wlc), __func__); bcmerror = BCME_RANGE; goto done; } } else { - WL_ERROR("wl%d: %s: Unknown rate type\n", + dev_err(wlc->dev, "wl%d: %s: Unknown rate type\n", WLCWLUNIT(wlc), __func__); bcmerror = BCME_RANGE; goto done; } /* make sure multiple antennae are available for non-siso rates */ if ((stf != PHY_TXC1_MODE_SISO) && (wlc->stf->txstreams == 1)) { - WL_ERROR("wl%d: %s: SISO antenna but !SISO request\n", + dev_err(wlc->dev, "wl%d: %s: SISO antenna but !SISO request\n", WLCWLUNIT(wlc), __func__); bcmerror = BCME_RANGE; goto done; @@ -8001,8 +8022,7 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band, } return rspec; - done: - WL_ERROR("Hoark\n"); +done: return rate; } @@ -8016,7 +8036,8 @@ wlc_duty_cycle_set(struct wlc_info *wlc, int duty_cycle, bool isOFDM, isOFDM ? M_TX_IDLE_BUSY_RATIO_X_16_OFDM : M_TX_IDLE_BUSY_RATIO_X_16_CCK; if (duty_cycle > 100 || duty_cycle < 0) { - WL_ERROR("wl%d: duty cycle value off limit\n", wlc->pub->unit); + dev_err(wlc->dev, "wl%d: duty cycle value off limit\n", + wlc->pub->unit); return BCME_RANGE; } if (duty_cycle) -- 1.7.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel