aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmsmac/main.c
diff options
context:
space:
mode:
authorSeth Forshee <seth.forshee@canonical.com>2012-11-15 09:08:03 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-11-20 14:06:16 -0500
commitb353dda485038d5033b066cc946dfcf66afae128 (patch)
tree580478e5f30806760f016959a59e269d89af9910 /drivers/net/wireless/brcm80211/brcmsmac/main.c
parent269de12bf10d2398bc6263ab4970bdcde7535787 (diff)
brcmsmac: Use debug macros for general error and debug statements
Convert most uses of wiphy_* and pr_* for general error and debug messages to use the internal debug macros instead. Most code used only for initialization still use wiphy_err(), as well as some locations which are executed too early to use the debug macros. Some debug messages which are redundant or not useful are removed. Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Tested-by: Daniel Wagner <wagi@monom.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/main.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c292
1 files changed, 145 insertions, 147 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 1e59ce3c150a..c7e7380a2e43 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -35,6 +35,7 @@
35#include "main.h" 35#include "main.h"
36#include "soc.h" 36#include "soc.h"
37#include "dma.h" 37#include "dma.h"
38#include "debug.h"
38 39
39/* watchdog timer, in unit of ms */ 40/* watchdog timer, in unit of ms */
40#define TIMER_INTERVAL_WATCHDOG 1000 41#define TIMER_INTERVAL_WATCHDOG 1000
@@ -640,7 +641,7 @@ static uint brcms_c_calc_frame_time(struct brcms_c_info *wlc, u32 ratespec,
640 uint rate = rspec2rate(ratespec); 641 uint rate = rspec2rate(ratespec);
641 642
642 if (rate == 0) { 643 if (rate == 0) {
643 wiphy_err(wlc->wiphy, "wl%d: WAR: using rate of 1 mbps\n", 644 brcms_err(wlc->hw->d11core, "wl%d: WAR: using rate of 1 mbps\n",
644 wlc->pub->unit); 645 wlc->pub->unit);
645 rate = BRCM_RATE_1M; 646 rate = BRCM_RATE_1M;
646 } 647 }
@@ -710,7 +711,7 @@ static void brcms_c_write_inits(struct brcms_hardware *wlc_hw,
710 u16 size; 711 u16 size;
711 u32 value; 712 u32 value;
712 713
713 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); 714 brcms_dbg_info(wlc_hw->d11core, "wl%d\n", wlc_hw->unit);
714 715
715 for (i = 0; inits[i].addr != cpu_to_le16(0xffff); i++) { 716 for (i = 0; inits[i].addr != cpu_to_le16(0xffff); i++) {
716 size = le16_to_cpu(inits[i].size); 717 size = le16_to_cpu(inits[i].size);
@@ -739,7 +740,6 @@ static void brcms_c_write_mhf(struct brcms_hardware *wlc_hw, u16 *mhfs)
739 740
740static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw) 741static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
741{ 742{
742 struct wiphy *wiphy = wlc_hw->wlc->wiphy;
743 struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode; 743 struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode;
744 744
745 /* init microcode host flags */ 745 /* init microcode host flags */
@@ -750,8 +750,9 @@ static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
750 if (BRCMS_ISNPHY(wlc_hw->band)) 750 if (BRCMS_ISNPHY(wlc_hw->band))
751 brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16); 751 brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16);
752 else 752 else
753 wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev" 753 brcms_err(wlc_hw->d11core,
754 " %d\n", __func__, wlc_hw->unit, 754 "%s: wl%d: unsupported phy in corerev %d\n",
755 __func__, wlc_hw->unit,
755 wlc_hw->corerev); 756 wlc_hw->corerev);
756 } else { 757 } else {
757 if (D11REV_IS(wlc_hw->corerev, 24)) { 758 if (D11REV_IS(wlc_hw->corerev, 24)) {
@@ -759,12 +760,14 @@ static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
759 brcms_c_write_inits(wlc_hw, 760 brcms_c_write_inits(wlc_hw,
760 ucode->d11lcn0bsinitvals24); 761 ucode->d11lcn0bsinitvals24);
761 else 762 else
762 wiphy_err(wiphy, "%s: wl%d: unsupported phy in" 763 brcms_err(wlc_hw->d11core,
763 " core rev %d\n", __func__, 764 "%s: wl%d: unsupported phy in core rev %d\n",
764 wlc_hw->unit, wlc_hw->corerev); 765 __func__, wlc_hw->unit,
766 wlc_hw->corerev);
765 } else { 767 } else {
766 wiphy_err(wiphy, "%s: wl%d: unsupported corerev %d\n", 768 brcms_err(wlc_hw->d11core,
767 __func__, wlc_hw->unit, wlc_hw->corerev); 769 "%s: wl%d: unsupported corerev %d\n",
770 __func__, wlc_hw->unit, wlc_hw->corerev);
768 } 771 }
769 } 772 }
770} 773}
@@ -779,7 +782,7 @@ static void brcms_b_core_ioctl(struct brcms_hardware *wlc_hw, u32 m, u32 v)
779 782
780static void brcms_b_core_phy_clk(struct brcms_hardware *wlc_hw, bool clk) 783static void brcms_b_core_phy_clk(struct brcms_hardware *wlc_hw, bool clk)
781{ 784{
782 BCMMSG(wlc_hw->wlc->wiphy, "wl%d: clk %d\n", wlc_hw->unit, clk); 785 brcms_dbg_info(wlc_hw->d11core, "wl%d: clk %d\n", wlc_hw->unit, clk);
783 786
784 wlc_hw->phyclk = clk; 787 wlc_hw->phyclk = clk;
785 788
@@ -898,7 +901,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
898 901
899 if (txs->phyerr) { 902 if (txs->phyerr) {
900 if (brcm_msg_level & BRCM_DL_INFO) { 903 if (brcm_msg_level & BRCM_DL_INFO) {
901 wiphy_err(wlc->wiphy, "phyerr 0x%x, rate 0x%x\n", 904 brcms_err(wlc->hw->d11core, "phyerr 0x%x, rate 0x%x\n",
902 txs->phyerr, txh->MainRates); 905 txs->phyerr, txh->MainRates);
903 brcms_c_print_txdesc(txh); 906 brcms_c_print_txdesc(txh);
904 } 907 }
@@ -934,7 +937,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
934 lastframe = !ieee80211_has_morefrags(h->frame_control); 937 lastframe = !ieee80211_has_morefrags(h->frame_control);
935 938
936 if (!lastframe) { 939 if (!lastframe) {
937 wiphy_err(wlc->wiphy, "Not last frame!\n"); 940 brcms_err(wlc->hw->d11core, "Not last frame!\n");
938 } else { 941 } else {
939 /* 942 /*
940 * Set information to be consumed by Minstrel ht. 943 * Set information to be consumed by Minstrel ht.
@@ -1006,8 +1009,9 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
1006 skb_pull(p, D11_TXH_LEN); 1009 skb_pull(p, D11_TXH_LEN);
1007 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, p); 1010 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, p);
1008 } else { 1011 } else {
1009 wiphy_err(wlc->wiphy, "%s: Not last frame => not calling " 1012 brcms_err(wlc->hw->d11core,
1010 "tx_status\n", __func__); 1013 "%s: Not last frame => not calling tx_status\n",
1014 __func__);
1011 } 1015 }
1012 1016
1013 fatal = false; 1017 fatal = false;
@@ -1055,8 +1059,8 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
1055 && (s1 & TXS_V)) { 1059 && (s1 & TXS_V)) {
1056 1060
1057 if (s1 == 0xffffffff) { 1061 if (s1 == 0xffffffff) {
1058 wiphy_err(wlc->wiphy, "wl%d: %s: dead chip\n", 1062 brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit,
1059 wlc_hw->unit, __func__); 1063 __func__);
1060 return morepending; 1064 return morepending;
1061 } 1065 }
1062 s2 = bcma_read32(core, D11REGOFFS(frmtxstatus2)); 1066 s2 = bcma_read32(core, D11REGOFFS(frmtxstatus2));
@@ -1132,7 +1136,6 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
1132 u16 pio_mhf2 = 0; 1136 u16 pio_mhf2 = 0;
1133 struct brcms_hardware *wlc_hw = wlc->hw; 1137 struct brcms_hardware *wlc_hw = wlc->hw;
1134 uint unit = wlc_hw->unit; 1138 uint unit = wlc_hw->unit;
1135 struct wiphy *wiphy = wlc->wiphy;
1136 1139
1137 /* name and offsets for dma_attach */ 1140 /* name and offsets for dma_attach */
1138 snprintf(name, sizeof(name), "wl%d", unit); 1141 snprintf(name, sizeof(name), "wl%d", unit);
@@ -1188,8 +1191,9 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
1188/* Cleaner to leave this as if with AP defined */ 1191/* Cleaner to leave this as if with AP defined */
1189 1192
1190 if (dma_attach_err) { 1193 if (dma_attach_err) {
1191 wiphy_err(wiphy, "wl%d: wlc_attach: dma_attach failed" 1194 brcms_err(wlc_hw->d11core,
1192 "\n", unit); 1195 "wl%d: wlc_attach: dma_attach failed\n",
1196 unit);
1193 return false; 1197 return false;
1194 } 1198 }
1195 1199
@@ -1547,7 +1551,7 @@ brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset, int len,
1547 __le32 word_le; 1551 __le32 word_le;
1548 __be32 word_be; 1552 __be32 word_be;
1549 bool be_bit; 1553 bool be_bit;
1550 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); 1554 brcms_dbg_info(core, "wl%d\n", wlc_hw->unit);
1551 1555
1552 bcma_write32(core, D11REGOFFS(tplatewrptr), offset); 1556 bcma_write32(core, D11REGOFFS(tplatewrptr), offset);
1553 1557
@@ -1756,8 +1760,6 @@ static void brcms_b_bsinit(struct brcms_c_info *wlc, u16 chanspec)
1756/* Perform a soft reset of the PHY PLL */ 1760/* Perform a soft reset of the PHY PLL */
1757void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw) 1761void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw)
1758{ 1762{
1759 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
1760
1761 ai_cc_reg(wlc_hw->sih, offsetof(struct chipcregs, chipcontrol_addr), 1763 ai_cc_reg(wlc_hw->sih, offsetof(struct chipcregs, chipcontrol_addr),
1762 ~0, 0); 1764 ~0, 0);
1763 udelay(1); 1765 udelay(1);
@@ -1802,7 +1804,7 @@ void brcms_b_phy_reset(struct brcms_hardware *wlc_hw)
1802 u32 phy_bw_clkbits; 1804 u32 phy_bw_clkbits;
1803 bool phy_in_reset = false; 1805 bool phy_in_reset = false;
1804 1806
1805 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); 1807 brcms_dbg_info(wlc_hw->d11core, "wl%d: reset phy\n", wlc_hw->unit);
1806 1808
1807 if (pih == NULL) 1809 if (pih == NULL)
1808 return; 1810 return;
@@ -1936,7 +1938,7 @@ static void brcms_c_get_macaddr(struct brcms_hardware *wlc_hw, u8 etheraddr[ETH_
1936/* power both the pll and external oscillator on/off */ 1938/* power both the pll and external oscillator on/off */
1937static void brcms_b_xtal(struct brcms_hardware *wlc_hw, bool want) 1939static void brcms_b_xtal(struct brcms_hardware *wlc_hw, bool want)
1938{ 1940{
1939 BCMMSG(wlc_hw->wlc->wiphy, "wl%d: want %d\n", wlc_hw->unit, want); 1941 brcms_dbg_info(wlc_hw->d11core, "wl%d: want %d\n", wlc_hw->unit, want);
1940 1942
1941 /* 1943 /*
1942 * dont power down if plldown is false or 1944 * dont power down if plldown is false or
@@ -2025,7 +2027,7 @@ void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags)
2025 if (flags == BRCMS_USE_COREFLAGS) 2027 if (flags == BRCMS_USE_COREFLAGS)
2026 flags = (wlc_hw->band->pi ? wlc_hw->band->core_flags : 0); 2028 flags = (wlc_hw->band->pi ? wlc_hw->band->core_flags : 0);
2027 2029
2028 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); 2030 brcms_dbg_info(wlc_hw->d11core, "wl%d: core reset\n", wlc_hw->unit);
2029 2031
2030 /* request FAST clock if not on */ 2032 /* request FAST clock if not on */
2031 fastclk = wlc_hw->forcefastclk; 2033 fastclk = wlc_hw->forcefastclk;
@@ -2036,13 +2038,13 @@ void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags)
2036 if (bcma_core_is_enabled(wlc_hw->d11core)) { 2038 if (bcma_core_is_enabled(wlc_hw->d11core)) {
2037 for (i = 0; i < NFIFO; i++) 2039 for (i = 0; i < NFIFO; i++)
2038 if ((wlc_hw->di[i]) && (!dma_txreset(wlc_hw->di[i]))) 2040 if ((wlc_hw->di[i]) && (!dma_txreset(wlc_hw->di[i])))
2039 wiphy_err(wlc_hw->wlc->wiphy, "wl%d: %s: " 2041 brcms_err(wlc_hw->d11core, "wl%d: %s: "
2040 "dma_txreset[%d]: cannot stop dma\n", 2042 "dma_txreset[%d]: cannot stop dma\n",
2041 wlc_hw->unit, __func__, i); 2043 wlc_hw->unit, __func__, i);
2042 2044
2043 if ((wlc_hw->di[RX_FIFO]) 2045 if ((wlc_hw->di[RX_FIFO])
2044 && (!wlc_dma_rxreset(wlc_hw, RX_FIFO))) 2046 && (!wlc_dma_rxreset(wlc_hw, RX_FIFO)))
2045 wiphy_err(wlc_hw->wlc->wiphy, "wl%d: %s: dma_rxreset" 2047 brcms_err(wlc_hw->d11core, "wl%d: %s: dma_rxreset"
2046 "[%d]: cannot stop dma\n", 2048 "[%d]: cannot stop dma\n",
2047 wlc_hw->unit, __func__, RX_FIFO); 2049 wlc_hw->unit, __func__, RX_FIFO);
2048 } 2050 }
@@ -2255,7 +2257,7 @@ static void brcms_ucode_write(struct brcms_hardware *wlc_hw,
2255 uint i; 2257 uint i;
2256 uint count; 2258 uint count;
2257 2259
2258 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); 2260 brcms_dbg_info(wlc_hw->d11core, "wl%d\n", wlc_hw->unit);
2259 2261
2260 count = (nbytes / sizeof(u32)); 2262 count = (nbytes / sizeof(u32));
2261 2263
@@ -2283,8 +2285,8 @@ static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
2283 ucode->bcm43xx_16_mimosz); 2285 ucode->bcm43xx_16_mimosz);
2284 wlc_hw->ucode_loaded = true; 2286 wlc_hw->ucode_loaded = true;
2285 } else 2287 } else
2286 wiphy_err(wlc->wiphy, "%s: wl%d: unsupported phy in " 2288 brcms_err(wlc_hw->d11core,
2287 "corerev %d\n", 2289 "%s: wl%d: unsupported phy in corerev %d\n",
2288 __func__, wlc_hw->unit, wlc_hw->corerev); 2290 __func__, wlc_hw->unit, wlc_hw->corerev);
2289 } else if (D11REV_IS(wlc_hw->corerev, 24)) { 2291 } else if (D11REV_IS(wlc_hw->corerev, 24)) {
2290 if (BRCMS_ISLCNPHY(wlc_hw->band)) { 2292 if (BRCMS_ISLCNPHY(wlc_hw->band)) {
@@ -2292,8 +2294,8 @@ static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
2292 ucode->bcm43xx_24_lcnsz); 2294 ucode->bcm43xx_24_lcnsz);
2293 wlc_hw->ucode_loaded = true; 2295 wlc_hw->ucode_loaded = true;
2294 } else { 2296 } else {
2295 wiphy_err(wlc->wiphy, "%s: wl%d: unsupported phy in " 2297 brcms_err(wlc_hw->d11core,
2296 "corerev %d\n", 2298 "%s: wl%d: unsupported phy in corerev %d\n",
2297 __func__, wlc_hw->unit, wlc_hw->corerev); 2299 __func__, wlc_hw->unit, wlc_hw->corerev);
2298 } 2300 }
2299 } 2301 }
@@ -2330,7 +2332,6 @@ static void brcms_b_fifoerrors(struct brcms_hardware *wlc_hw)
2330 uint unit; 2332 uint unit;
2331 uint intstatus, idx; 2333 uint intstatus, idx;
2332 struct bcma_device *core = wlc_hw->d11core; 2334 struct bcma_device *core = wlc_hw->d11core;
2333 struct wiphy *wiphy = wlc_hw->wlc->wiphy;
2334 2335
2335 unit = wlc_hw->unit; 2336 unit = wlc_hw->unit;
2336 2337
@@ -2347,35 +2348,35 @@ static void brcms_b_fifoerrors(struct brcms_hardware *wlc_hw)
2347 unit, idx, intstatus); 2348 unit, idx, intstatus);
2348 2349
2349 if (intstatus & I_RO) { 2350 if (intstatus & I_RO) {
2350 wiphy_err(wiphy, "wl%d: fifo %d: receive fifo " 2351 brcms_err(core, "wl%d: fifo %d: receive fifo "
2351 "overflow\n", unit, idx); 2352 "overflow\n", unit, idx);
2352 fatal = true; 2353 fatal = true;
2353 } 2354 }
2354 2355
2355 if (intstatus & I_PC) { 2356 if (intstatus & I_PC) {
2356 wiphy_err(wiphy, "wl%d: fifo %d: descriptor error\n", 2357 brcms_err(core, "wl%d: fifo %d: descriptor error\n",
2357 unit, idx); 2358 unit, idx);
2358 fatal = true; 2359 fatal = true;
2359 } 2360 }
2360 2361
2361 if (intstatus & I_PD) { 2362 if (intstatus & I_PD) {
2362 wiphy_err(wiphy, "wl%d: fifo %d: data error\n", unit, 2363 brcms_err(core, "wl%d: fifo %d: data error\n", unit,
2363 idx); 2364 idx);
2364 fatal = true; 2365 fatal = true;
2365 } 2366 }
2366 2367
2367 if (intstatus & I_DE) { 2368 if (intstatus & I_DE) {
2368 wiphy_err(wiphy, "wl%d: fifo %d: descriptor protocol " 2369 brcms_err(core, "wl%d: fifo %d: descriptor protocol "
2369 "error\n", unit, idx); 2370 "error\n", unit, idx);
2370 fatal = true; 2371 fatal = true;
2371 } 2372 }
2372 2373
2373 if (intstatus & I_RU) 2374 if (intstatus & I_RU)
2374 wiphy_err(wiphy, "wl%d: fifo %d: receive descriptor " 2375 brcms_err(core, "wl%d: fifo %d: receive descriptor "
2375 "underflow\n", idx, unit); 2376 "underflow\n", idx, unit);
2376 2377
2377 if (intstatus & I_XU) { 2378 if (intstatus & I_XU) {
2378 wiphy_err(wiphy, "wl%d: fifo %d: transmit fifo " 2379 brcms_err(core, "wl%d: fifo %d: transmit fifo "
2379 "underflow\n", idx, unit); 2380 "underflow\n", idx, unit);
2380 fatal = true; 2381 fatal = true;
2381 } 2382 }
@@ -2625,8 +2626,8 @@ bool brcms_c_isr(struct brcms_c_info *wlc, bool *wantdpc)
2625 macintstatus = wlc_intstatus(wlc, true); 2626 macintstatus = wlc_intstatus(wlc, true);
2626 2627
2627 if (macintstatus == 0xffffffff) 2628 if (macintstatus == 0xffffffff)
2628 wiphy_err(wlc->wiphy, "DEVICEREMOVED detected in the ISR code" 2629 brcms_err(wlc_hw->d11core,
2629 " path\n"); 2630 "DEVICEREMOVED detected in the ISR code path\n");
2630 2631
2631 /* it is not for us */ 2632 /* it is not for us */
2632 if (macintstatus == 0) 2633 if (macintstatus == 0)
@@ -2646,7 +2647,6 @@ void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc)
2646 struct brcms_hardware *wlc_hw = wlc->hw; 2647 struct brcms_hardware *wlc_hw = wlc->hw;
2647 struct bcma_device *core = wlc_hw->d11core; 2648 struct bcma_device *core = wlc_hw->d11core;
2648 u32 mc, mi; 2649 u32 mc, mi;
2649 struct wiphy *wiphy = wlc->wiphy;
2650 2650
2651 BCMMSG(wlc->wiphy, "wl%d: bandunit %d\n", wlc_hw->unit, 2651 BCMMSG(wlc->wiphy, "wl%d: bandunit %d\n", wlc_hw->unit,
2652 wlc_hw->band->bandunit); 2652 wlc_hw->band->bandunit);
@@ -2664,7 +2664,7 @@ void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc)
2664 mc = bcma_read32(core, D11REGOFFS(maccontrol)); 2664 mc = bcma_read32(core, D11REGOFFS(maccontrol));
2665 2665
2666 if (mc == 0xffffffff) { 2666 if (mc == 0xffffffff) {
2667 wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit, 2667 brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit,
2668 __func__); 2668 __func__);
2669 brcms_down(wlc->wl); 2669 brcms_down(wlc->wl);
2670 return; 2670 return;
@@ -2675,7 +2675,7 @@ void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc)
2675 2675
2676 mi = bcma_read32(core, D11REGOFFS(macintstatus)); 2676 mi = bcma_read32(core, D11REGOFFS(macintstatus));
2677 if (mi == 0xffffffff) { 2677 if (mi == 0xffffffff) {
2678 wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit, 2678 brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit,
2679 __func__); 2679 __func__);
2680 brcms_down(wlc->wl); 2680 brcms_down(wlc->wl);
2681 return; 2681 return;
@@ -2688,10 +2688,10 @@ void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc)
2688 BRCMS_MAX_MAC_SUSPEND); 2688 BRCMS_MAX_MAC_SUSPEND);
2689 2689
2690 if (!(bcma_read32(core, D11REGOFFS(macintstatus)) & MI_MACSSPNDD)) { 2690 if (!(bcma_read32(core, D11REGOFFS(macintstatus)) & MI_MACSSPNDD)) {
2691 wiphy_err(wiphy, "wl%d: wlc_suspend_mac_and_wait: waited %d uS" 2691 brcms_err(core, "wl%d: wlc_suspend_mac_and_wait: waited %d uS"
2692 " and MI_MACSSPNDD is still not on.\n", 2692 " and MI_MACSSPNDD is still not on.\n",
2693 wlc_hw->unit, BRCMS_MAX_MAC_SUSPEND); 2693 wlc_hw->unit, BRCMS_MAX_MAC_SUSPEND);
2694 wiphy_err(wiphy, "wl%d: psmdebug 0x%08x, phydebug 0x%08x, " 2694 brcms_err(core, "wl%d: psmdebug 0x%08x, phydebug 0x%08x, "
2695 "psm_brc 0x%04x\n", wlc_hw->unit, 2695 "psm_brc 0x%04x\n", wlc_hw->unit,
2696 bcma_read32(core, D11REGOFFS(psmdebug)), 2696 bcma_read32(core, D11REGOFFS(psmdebug)),
2697 bcma_read32(core, D11REGOFFS(phydebug)), 2697 bcma_read32(core, D11REGOFFS(phydebug)),
@@ -2700,7 +2700,7 @@ void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc)
2700 2700
2701 mc = bcma_read32(core, D11REGOFFS(maccontrol)); 2701 mc = bcma_read32(core, D11REGOFFS(maccontrol));
2702 if (mc == 0xffffffff) { 2702 if (mc == 0xffffffff) {
2703 wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit, 2703 brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit,
2704 __func__); 2704 __func__);
2705 brcms_down(wlc->wl); 2705 brcms_down(wlc->wl);
2706 return; 2706 return;
@@ -2760,8 +2760,6 @@ static bool brcms_b_validate_chip_access(struct brcms_hardware *wlc_hw)
2760 u32 w, val; 2760 u32 w, val;
2761 struct wiphy *wiphy = wlc_hw->wlc->wiphy; 2761 struct wiphy *wiphy = wlc_hw->wlc->wiphy;
2762 2762
2763 BCMMSG(wiphy, "wl%d\n", wlc_hw->unit);
2764
2765 /* Validate dchip register access */ 2763 /* Validate dchip register access */
2766 2764
2767 bcma_write32(core, D11REGOFFS(objaddr), OBJADDR_SHM_SEL | 0); 2765 bcma_write32(core, D11REGOFFS(objaddr), OBJADDR_SHM_SEL | 0);
@@ -2822,7 +2820,7 @@ void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on)
2822 struct bcma_device *core = wlc_hw->d11core; 2820 struct bcma_device *core = wlc_hw->d11core;
2823 u32 tmp; 2821 u32 tmp;
2824 2822
2825 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); 2823 brcms_dbg_info(core, "wl%d\n", wlc_hw->unit);
2826 2824
2827 tmp = 0; 2825 tmp = 0;
2828 2826
@@ -2838,8 +2836,8 @@ void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on)
2838 2836
2839 tmp = bcma_read32(core, D11REGOFFS(clk_ctl_st)); 2837 tmp = bcma_read32(core, D11REGOFFS(clk_ctl_st));
2840 if ((tmp & CCS_ERSRC_AVAIL_HT) != CCS_ERSRC_AVAIL_HT) 2838 if ((tmp & CCS_ERSRC_AVAIL_HT) != CCS_ERSRC_AVAIL_HT)
2841 wiphy_err(wlc_hw->wlc->wiphy, "%s: turn on PHY" 2839 brcms_err(core, "%s: turn on PHY PLL failed\n",
2842 " PLL failed\n", __func__); 2840 __func__);
2843 } else { 2841 } else {
2844 bcma_set32(core, D11REGOFFS(clk_ctl_st), 2842 bcma_set32(core, D11REGOFFS(clk_ctl_st),
2845 tmp | CCS_ERSRC_REQ_D11PLL | 2843 tmp | CCS_ERSRC_REQ_D11PLL |
@@ -2855,8 +2853,8 @@ void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on)
2855 (CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL)) 2853 (CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL))
2856 != 2854 !=
2857 (CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL)) 2855 (CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL))
2858 wiphy_err(wlc_hw->wlc->wiphy, "%s: turn on " 2856 brcms_err(core, "%s: turn on PHY PLL failed\n",
2859 "PHY PLL failed\n", __func__); 2857 __func__);
2860 } 2858 }
2861 } else { 2859 } else {
2862 /* 2860 /*
@@ -2874,7 +2872,7 @@ static void brcms_c_coredisable(struct brcms_hardware *wlc_hw)
2874{ 2872{
2875 bool dev_gone; 2873 bool dev_gone;
2876 2874
2877 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); 2875 brcms_dbg_info(wlc_hw->d11core, "wl%d: disable core\n", wlc_hw->unit);
2878 2876
2879 dev_gone = brcms_deviceremoved(wlc_hw->wlc); 2877 dev_gone = brcms_deviceremoved(wlc_hw->wlc);
2880 2878
@@ -3131,7 +3129,7 @@ static void brcms_c_statsupd(struct brcms_c_info *wlc)
3131 /* check for rx fifo 0 overflow */ 3129 /* check for rx fifo 0 overflow */
3132 delta = (u16) (wlc->core->macstat_snapshot->rxf0ovfl - rxf0ovfl); 3130 delta = (u16) (wlc->core->macstat_snapshot->rxf0ovfl - rxf0ovfl);
3133 if (delta) 3131 if (delta)
3134 wiphy_err(wlc->wiphy, "wl%d: %u rx fifo 0 overflows!\n", 3132 brcms_err(wlc->hw->d11core, "wl%d: %u rx fifo 0 overflows!\n",
3135 wlc->pub->unit, delta); 3133 wlc->pub->unit, delta);
3136 3134
3137 /* check for tx fifo underflows */ 3135 /* check for tx fifo underflows */
@@ -3140,8 +3138,9 @@ static void brcms_c_statsupd(struct brcms_c_info *wlc)
3140 (u16) (wlc->core->macstat_snapshot->txfunfl[i] - 3138 (u16) (wlc->core->macstat_snapshot->txfunfl[i] -
3141 txfunfl[i]); 3139 txfunfl[i]);
3142 if (delta) 3140 if (delta)
3143 wiphy_err(wlc->wiphy, "wl%d: %u tx fifo %d underflows!" 3141 brcms_err(wlc->hw->d11core,
3144 "\n", wlc->pub->unit, delta, i); 3142 "wl%d: %u tx fifo %d underflows!\n",
3143 wlc->pub->unit, delta, i);
3145 } 3144 }
3146#endif /* DEBUG */ 3145#endif /* DEBUG */
3147 3146
@@ -3154,8 +3153,6 @@ static void brcms_c_statsupd(struct brcms_c_info *wlc)
3154 3153
3155static void brcms_b_reset(struct brcms_hardware *wlc_hw) 3154static void brcms_b_reset(struct brcms_hardware *wlc_hw)
3156{ 3155{
3157 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
3158
3159 /* reset the core */ 3156 /* reset the core */
3160 if (!brcms_deviceremoved(wlc_hw->wlc)) 3157 if (!brcms_deviceremoved(wlc_hw->wlc))
3161 brcms_b_corereset(wlc_hw, BRCMS_USE_COREFLAGS); 3158 brcms_b_corereset(wlc_hw, BRCMS_USE_COREFLAGS);
@@ -3166,7 +3163,7 @@ static void brcms_b_reset(struct brcms_hardware *wlc_hw)
3166 3163
3167void brcms_c_reset(struct brcms_c_info *wlc) 3164void brcms_c_reset(struct brcms_c_info *wlc)
3168{ 3165{
3169 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); 3166 brcms_dbg_info(wlc->hw->d11core, "wl%d\n", wlc->pub->unit);
3170 3167
3171 /* slurp up hw mac counters before core reset */ 3168 /* slurp up hw mac counters before core reset */
3172 brcms_c_statsupd(wlc); 3169 brcms_c_statsupd(wlc);
@@ -3211,10 +3208,9 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
3211 bool fifosz_fixup = false; 3208 bool fifosz_fixup = false;
3212 int err = 0; 3209 int err = 0;
3213 u16 buf[NFIFO]; 3210 u16 buf[NFIFO];
3214 struct wiphy *wiphy = wlc->wiphy;
3215 struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode; 3211 struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode;
3216 3212
3217 BCMMSG(wlc->wiphy, "wl%d\n", wlc_hw->unit); 3213 brcms_dbg_info(core, "wl%d: core init\n", wlc_hw->unit);
3218 3214
3219 /* reset PSM */ 3215 /* reset PSM */
3220 brcms_b_mctrl(wlc_hw, ~0, (MCTL_IHR_EN | MCTL_PSM_JMP_0 | MCTL_WAKE)); 3216 brcms_b_mctrl(wlc_hw, ~0, (MCTL_IHR_EN | MCTL_PSM_JMP_0 | MCTL_WAKE));
@@ -3234,7 +3230,7 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
3234 SPINWAIT(((bcma_read32(core, D11REGOFFS(macintstatus)) & 3230 SPINWAIT(((bcma_read32(core, D11REGOFFS(macintstatus)) &
3235 MI_MACSSPNDD) == 0), 1000 * 1000); 3231 MI_MACSSPNDD) == 0), 1000 * 1000);
3236 if ((bcma_read32(core, D11REGOFFS(macintstatus)) & MI_MACSSPNDD) == 0) 3232 if ((bcma_read32(core, D11REGOFFS(macintstatus)) & MI_MACSSPNDD) == 0)
3237 wiphy_err(wiphy, "wl%d: wlc_coreinit: ucode did not self-" 3233 brcms_err(core, "wl%d: wlc_coreinit: ucode did not self-"
3238 "suspend!\n", wlc_hw->unit); 3234 "suspend!\n", wlc_hw->unit);
3239 3235
3240 brcms_c_gpio_init(wlc); 3236 brcms_c_gpio_init(wlc);
@@ -3245,18 +3241,18 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
3245 if (BRCMS_ISNPHY(wlc_hw->band)) 3241 if (BRCMS_ISNPHY(wlc_hw->band))
3246 brcms_c_write_inits(wlc_hw, ucode->d11n0initvals16); 3242 brcms_c_write_inits(wlc_hw, ucode->d11n0initvals16);
3247 else 3243 else
3248 wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev" 3244 brcms_err(core, "%s: wl%d: unsupported phy in corerev"
3249 " %d\n", __func__, wlc_hw->unit, 3245 " %d\n", __func__, wlc_hw->unit,
3250 wlc_hw->corerev); 3246 wlc_hw->corerev);
3251 } else if (D11REV_IS(wlc_hw->corerev, 24)) { 3247 } else if (D11REV_IS(wlc_hw->corerev, 24)) {
3252 if (BRCMS_ISLCNPHY(wlc_hw->band)) 3248 if (BRCMS_ISLCNPHY(wlc_hw->band))
3253 brcms_c_write_inits(wlc_hw, ucode->d11lcn0initvals24); 3249 brcms_c_write_inits(wlc_hw, ucode->d11lcn0initvals24);
3254 else 3250 else
3255 wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev" 3251 brcms_err(core, "%s: wl%d: unsupported phy in corerev"
3256 " %d\n", __func__, wlc_hw->unit, 3252 " %d\n", __func__, wlc_hw->unit,
3257 wlc_hw->corerev); 3253 wlc_hw->corerev);
3258 } else { 3254 } else {
3259 wiphy_err(wiphy, "%s: wl%d: unsupported corerev %d\n", 3255 brcms_err(core, "%s: wl%d: unsupported corerev %d\n",
3260 __func__, wlc_hw->unit, wlc_hw->corerev); 3256 __func__, wlc_hw->unit, wlc_hw->corerev);
3261 } 3257 }
3262 3258
@@ -3298,7 +3294,7 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
3298 err = -1; 3294 err = -1;
3299 } 3295 }
3300 if (err != 0) 3296 if (err != 0)
3301 wiphy_err(wiphy, "wlc_coreinit: txfifo mismatch: ucode size %d" 3297 brcms_err(core, "wlc_coreinit: txfifo mismatch: ucode size %d"
3302 " driver size %d index %d\n", buf[i], 3298 " driver size %d index %d\n", buf[i],
3303 wlc_hw->xmtfifo_sz[i], i); 3299 wlc_hw->xmtfifo_sz[i], i);
3304 3300
@@ -3381,8 +3377,6 @@ static brcms_b_init(struct brcms_hardware *wlc_hw, u16 chanspec) {
3381 bool fastclk; 3377 bool fastclk;
3382 struct brcms_c_info *wlc = wlc_hw->wlc; 3378 struct brcms_c_info *wlc = wlc_hw->wlc;
3383 3379
3384 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
3385
3386 /* request FAST clock if not on */ 3380 /* request FAST clock if not on */
3387 fastclk = wlc_hw->forcefastclk; 3381 fastclk = wlc_hw->forcefastclk;
3388 if (!fastclk) 3382 if (!fastclk)
@@ -3475,7 +3469,7 @@ static void brcms_c_rate_lookup_init(struct brcms_c_info *wlc,
3475 rate = (rateset->rates[i] & BRCMS_RATE_MASK); 3469 rate = (rateset->rates[i] & BRCMS_RATE_MASK);
3476 3470
3477 if (rate > BRCM_MAXRATE) { 3471 if (rate > BRCM_MAXRATE) {
3478 wiphy_err(wlc->wiphy, "brcms_c_rate_lookup_init: " 3472 brcms_err(wlc->hw->d11core, "brcms_c_rate_lookup_init: "
3479 "invalid rate 0x%X in rate set\n", 3473 "invalid rate 0x%X in rate set\n",
3480 rateset->rates[i]); 3474 rateset->rates[i]);
3481 continue; 3475 continue;
@@ -3551,7 +3545,6 @@ static void brcms_c_bandinit_ordered(struct brcms_c_info *wlc,
3551 uint parkband; 3545 uint parkband;
3552 uint i, band_order[2]; 3546 uint i, band_order[2];
3553 3547
3554 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);
3555 /* 3548 /*
3556 * We might have been bandlocked during down and the chip 3549 * We might have been bandlocked during down and the chip
3557 * power-cycled (hibernate). Figure out the right band to park on 3550 * power-cycled (hibernate). Figure out the right band to park on
@@ -3732,8 +3725,8 @@ static void brcms_c_set_ratetable(struct brcms_c_info *wlc)
3732/* band-specific init */ 3725/* band-specific init */
3733static void brcms_c_bsinit(struct brcms_c_info *wlc) 3726static void brcms_c_bsinit(struct brcms_c_info *wlc)
3734{ 3727{
3735 BCMMSG(wlc->wiphy, "wl%d: bandunit %d\n", 3728 brcms_dbg_info(wlc->hw->d11core, "wl%d: bandunit %d\n",
3736 wlc->pub->unit, wlc->band->bandunit); 3729 wlc->pub->unit, wlc->band->bandunit);
3737 3730
3738 /* write ucode ACK/CTS rate table */ 3731 /* write ucode ACK/CTS rate table */
3739 brcms_c_set_ratetable(wlc); 3732 brcms_c_set_ratetable(wlc);
@@ -3756,7 +3749,8 @@ brcms_c_duty_cycle_set(struct brcms_c_info *wlc, int duty_cycle, bool isOFDM,
3756 isOFDM ? M_TX_IDLE_BUSY_RATIO_X_16_OFDM : 3749 isOFDM ? M_TX_IDLE_BUSY_RATIO_X_16_OFDM :
3757 M_TX_IDLE_BUSY_RATIO_X_16_CCK; 3750 M_TX_IDLE_BUSY_RATIO_X_16_CCK;
3758 if (duty_cycle > 100 || duty_cycle < 0) { 3751 if (duty_cycle > 100 || duty_cycle < 0) {
3759 wiphy_err(wlc->wiphy, "wl%d: duty cycle value off limit\n", 3752 brcms_err(wlc->hw->d11core,
3753 "wl%d: duty cycle value off limit\n",
3760 wlc->pub->unit); 3754 wlc->pub->unit);
3761 return -EINVAL; 3755 return -EINVAL;
3762 } 3756 }
@@ -3930,7 +3924,7 @@ static void brcms_c_set_chanspec(struct brcms_c_info *wlc, u16 chanspec)
3930 u16 old_chanspec = wlc->chanspec; 3924 u16 old_chanspec = wlc->chanspec;
3931 3925
3932 if (!brcms_c_valid_chanspec_db(wlc->cmi, chanspec)) { 3926 if (!brcms_c_valid_chanspec_db(wlc->cmi, chanspec)) {
3933 wiphy_err(wlc->wiphy, "wl%d: %s: Bad channel %d\n", 3927 brcms_err(wlc->hw->d11core, "wl%d: %s: Bad channel %d\n",
3934 wlc->pub->unit, __func__, CHSPEC_CHANNEL(chanspec)); 3928 wlc->pub->unit, __func__, CHSPEC_CHANNEL(chanspec));
3935 return; 3929 return;
3936 } 3930 }
@@ -3941,8 +3935,8 @@ static void brcms_c_set_chanspec(struct brcms_c_info *wlc, u16 chanspec)
3941 if (wlc->band->bandunit != bandunit || wlc->bandinit_pending) { 3935 if (wlc->band->bandunit != bandunit || wlc->bandinit_pending) {
3942 switchband = true; 3936 switchband = true;
3943 if (wlc->bandlocked) { 3937 if (wlc->bandlocked) {
3944 wiphy_err(wlc->wiphy, "wl%d: %s: chspec %d " 3938 brcms_err(wlc->hw->d11core,
3945 "band is locked!\n", 3939 "wl%d: %s: chspec %d band is locked!\n",
3946 wlc->pub->unit, __func__, 3940 wlc->pub->unit, __func__,
3947 CHSPEC_CHANNEL(chanspec)); 3941 CHSPEC_CHANNEL(chanspec));
3948 return; 3942 return;
@@ -4006,6 +4000,10 @@ void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc,
4006 */ 4000 */
4007void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, int val) 4001void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, int val)
4008{ 4002{
4003 /*
4004 * Cannot use brcms_dbg_* here because this function is called
4005 * before wlc is sufficiently initialized.
4006 */
4009 BCMMSG(wlc->wiphy, "idx %d, val %d\n", idx, val); 4007 BCMMSG(wlc->wiphy, "idx %d, val %d\n", idx, val);
4010 4008
4011 switch (idx) { 4009 switch (idx) {
@@ -4078,8 +4076,8 @@ void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
4078 4076
4079 /* Only apply params if the core is out of reset and has clocks */ 4077 /* Only apply params if the core is out of reset and has clocks */
4080 if (!wlc->clk) { 4078 if (!wlc->clk) {
4081 wiphy_err(wlc->wiphy, "wl%d: %s : no-clock\n", wlc->pub->unit, 4079 brcms_err(wlc->hw->d11core, "wl%d: %s : no-clock\n",
4082 __func__); 4080 wlc->pub->unit, __func__);
4083 return; 4081 return;
4084 } 4082 }
4085 4083
@@ -4097,7 +4095,7 @@ void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
4097 4095
4098 if (acp_shm.aifs < EDCF_AIFSN_MIN 4096 if (acp_shm.aifs < EDCF_AIFSN_MIN
4099 || acp_shm.aifs > EDCF_AIFSN_MAX) { 4097 || acp_shm.aifs > EDCF_AIFSN_MAX) {
4100 wiphy_err(wlc->wiphy, "wl%d: edcf_setparams: bad " 4098 brcms_err(wlc->hw->d11core, "wl%d: edcf_setparams: bad "
4101 "aifs %d\n", wlc->pub->unit, acp_shm.aifs); 4099 "aifs %d\n", wlc->pub->unit, acp_shm.aifs);
4102 } else { 4100 } else {
4103 acp_shm.cwmin = params->cw_min; 4101 acp_shm.cwmin = params->cw_min;
@@ -4212,8 +4210,8 @@ static void brcms_c_radio_timer(void *arg)
4212 struct brcms_c_info *wlc = (struct brcms_c_info *) arg; 4210 struct brcms_c_info *wlc = (struct brcms_c_info *) arg;
4213 4211
4214 if (brcms_deviceremoved(wlc)) { 4212 if (brcms_deviceremoved(wlc)) {
4215 wiphy_err(wlc->wiphy, "wl%d: %s: dead chip\n", wlc->pub->unit, 4213 brcms_err(wlc->hw->d11core, "wl%d: %s: dead chip\n",
4216 __func__); 4214 wlc->pub->unit, __func__);
4217 brcms_down(wlc->wl); 4215 brcms_down(wlc->wl);
4218 return; 4216 return;
4219 } 4217 }
@@ -4226,8 +4224,6 @@ static void brcms_b_watchdog(struct brcms_c_info *wlc)
4226{ 4224{
4227 struct brcms_hardware *wlc_hw = wlc->hw; 4225 struct brcms_hardware *wlc_hw = wlc->hw;
4228 4226
4229 BCMMSG(wlc->wiphy, "wl%d\n", wlc_hw->unit);
4230
4231 if (!wlc_hw->up) 4227 if (!wlc_hw->up)
4232 return; 4228 return;
4233 4229
@@ -4246,14 +4242,14 @@ static void brcms_b_watchdog(struct brcms_c_info *wlc)
4246/* common watchdog code */ 4242/* common watchdog code */
4247static void brcms_c_watchdog(struct brcms_c_info *wlc) 4243static void brcms_c_watchdog(struct brcms_c_info *wlc)
4248{ 4244{
4249 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); 4245 brcms_dbg_info(wlc->hw->d11core, "wl%d\n", wlc->pub->unit);
4250 4246
4251 if (!wlc->pub->up) 4247 if (!wlc->pub->up)
4252 return; 4248 return;
4253 4249
4254 if (brcms_deviceremoved(wlc)) { 4250 if (brcms_deviceremoved(wlc)) {
4255 wiphy_err(wlc->wiphy, "wl%d: %s: dead chip\n", wlc->pub->unit, 4251 brcms_err(wlc->hw->d11core, "wl%d: %s: dead chip\n",
4256 __func__); 4252 wlc->pub->unit, __func__);
4257 brcms_down(wlc->wl); 4253 brcms_down(wlc->wl);
4258 return; 4254 return;
4259 } 4255 }
@@ -4425,13 +4421,13 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
4425 struct ssb_sprom *sprom = &core->bus->sprom; 4421 struct ssb_sprom *sprom = &core->bus->sprom;
4426 4422
4427 if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) 4423 if (core->bus->hosttype == BCMA_HOSTTYPE_PCI)
4428 BCMMSG(wlc->wiphy, "wl%d: vendor 0x%x device 0x%x\n", unit, 4424 brcms_dbg_info(core, "wl%d: vendor 0x%x device 0x%x\n", unit,
4429 pcidev->vendor, 4425 pcidev->vendor,
4430 pcidev->device); 4426 pcidev->device);
4431 else 4427 else
4432 BCMMSG(wlc->wiphy, "wl%d: vendor 0x%x device 0x%x\n", unit, 4428 brcms_dbg_info(core, "wl%d: vendor 0x%x device 0x%x\n", unit,
4433 core->bus->boardinfo.vendor, 4429 core->bus->boardinfo.vendor,
4434 core->bus->boardinfo.type); 4430 core->bus->boardinfo.type);
4435 4431
4436 wme = true; 4432 wme = true;
4437 4433
@@ -4703,8 +4699,9 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
4703 goto fail; 4699 goto fail;
4704 } 4700 }
4705 4701
4706 BCMMSG(wlc->wiphy, "deviceid 0x%x nbands %d board 0x%x\n", 4702 brcms_dbg_info(wlc_hw->d11core, "deviceid 0x%x nbands %d board 0x%x\n",
4707 wlc_hw->deviceid, wlc_hw->_nbands, ai_get_boardtype(wlc_hw->sih)); 4703 wlc_hw->deviceid, wlc_hw->_nbands,
4704 ai_get_boardtype(wlc_hw->sih));
4708 4705
4709 return err; 4706 return err;
4710 4707
@@ -4960,7 +4957,7 @@ static void brcms_b_hw_up(struct brcms_hardware *wlc_hw)
4960 if (wlc_hw->wlc->pub->hw_up) 4957 if (wlc_hw->wlc->pub->hw_up)
4961 return; 4958 return;
4962 4959
4963 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); 4960 brcms_dbg_info(wlc_hw->d11core, "wl%d\n", wlc_hw->unit);
4964 4961
4965 /* 4962 /*
4966 * Enable pll and xtal, initialize the power control registers, 4963 * Enable pll and xtal, initialize the power control registers,
@@ -4997,7 +4994,7 @@ static void brcms_b_hw_up(struct brcms_hardware *wlc_hw)
4997 4994
4998static int brcms_b_up_prep(struct brcms_hardware *wlc_hw) 4995static int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
4999{ 4996{
5000 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); 4997 brcms_dbg_info(wlc_hw->d11core, "wl%d\n", wlc_hw->unit);
5001 4998
5002 /* 4999 /*
5003 * Enable pll and xtal, initialize the power control registers, 5000 * Enable pll and xtal, initialize the power control registers,
@@ -5036,8 +5033,6 @@ static int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
5036 5033
5037static int brcms_b_up_finish(struct brcms_hardware *wlc_hw) 5034static int brcms_b_up_finish(struct brcms_hardware *wlc_hw)
5038{ 5035{
5039 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
5040
5041 wlc_hw->up = true; 5036 wlc_hw->up = true;
5042 wlc_phy_hw_state_upd(wlc_hw->band->pi, true); 5037 wlc_phy_hw_state_upd(wlc_hw->band->pi, true);
5043 5038
@@ -5069,7 +5064,7 @@ int brcms_c_up(struct brcms_c_info *wlc)
5069{ 5064{
5070 struct ieee80211_channel *ch; 5065 struct ieee80211_channel *ch;
5071 5066
5072 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); 5067 brcms_dbg_info(wlc->hw->d11core, "wl%d\n", wlc->pub->unit);
5073 5068
5074 /* HW is turned off so don't try to access it */ 5069 /* HW is turned off so don't try to access it */
5075 if (wlc->pub->hw_off || brcms_deviceremoved(wlc)) 5070 if (wlc->pub->hw_off || brcms_deviceremoved(wlc))
@@ -5110,8 +5105,8 @@ int brcms_c_up(struct brcms_c_info *wlc)
5110 WL_RADIO_HW_DISABLE); 5105 WL_RADIO_HW_DISABLE);
5111 5106
5112 if (bsscfg->enable && bsscfg->BSS) 5107 if (bsscfg->enable && bsscfg->BSS)
5113 wiphy_err(wlc->wiphy, "wl%d: up" 5108 brcms_err(wlc->hw->d11core,
5114 ": rfdisable -> " 5109 "wl%d: up: rfdisable -> "
5115 "bsscfg_disable()\n", 5110 "bsscfg_disable()\n",
5116 wlc->pub->unit); 5111 wlc->pub->unit);
5117 } 5112 }
@@ -5171,8 +5166,6 @@ static int brcms_b_bmac_down_prep(struct brcms_hardware *wlc_hw)
5171 bool dev_gone; 5166 bool dev_gone;
5172 uint callbacks = 0; 5167 uint callbacks = 0;
5173 5168
5174 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
5175
5176 if (!wlc_hw->up) 5169 if (!wlc_hw->up)
5177 return callbacks; 5170 return callbacks;
5178 5171
@@ -5199,8 +5192,6 @@ static int brcms_b_down_finish(struct brcms_hardware *wlc_hw)
5199 uint callbacks = 0; 5192 uint callbacks = 0;
5200 bool dev_gone; 5193 bool dev_gone;
5201 5194
5202 BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
5203
5204 if (!wlc_hw->up) 5195 if (!wlc_hw->up)
5205 return callbacks; 5196 return callbacks;
5206 5197
@@ -5249,12 +5240,13 @@ uint brcms_c_down(struct brcms_c_info *wlc)
5249 int i; 5240 int i;
5250 bool dev_gone = false; 5241 bool dev_gone = false;
5251 5242
5252 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); 5243 brcms_dbg_info(wlc->hw->d11core, "wl%d\n", wlc->pub->unit);
5253 5244
5254 /* check if we are already in the going down path */ 5245 /* check if we are already in the going down path */
5255 if (wlc->going_down) { 5246 if (wlc->going_down) {
5256 wiphy_err(wlc->wiphy, "wl%d: %s: Driver going down so return" 5247 brcms_err(wlc->hw->d11core,
5257 "\n", wlc->pub->unit, __func__); 5248 "wl%d: %s: Driver going down so return\n",
5249 wlc->pub->unit, __func__);
5258 return 0; 5250 return 0;
5259 } 5251 }
5260 if (!wlc->pub->up) 5252 if (!wlc->pub->up)
@@ -5367,7 +5359,7 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)
5367 5359
5368 default: 5360 default:
5369 /* Error */ 5361 /* Error */
5370 wiphy_err(wlc->wiphy, "wl%d: %s: invalid gmode %d\n", 5362 brcms_err(wlc->hw->d11core, "wl%d: %s: invalid gmode %d\n",
5371 wlc->pub->unit, __func__, gmode); 5363 wlc->pub->unit, __func__, gmode);
5372 return -ENOTSUPP; 5364 return -ENOTSUPP;
5373 } 5365 }
@@ -6015,7 +6007,7 @@ brcms_c_calc_ba_time(struct brcms_c_info *wlc, u32 rspec,
6015 u8 preamble_type) 6007 u8 preamble_type)
6016{ 6008{
6017 BCMMSG(wlc->wiphy, "wl%d: rspec 0x%x, " 6009 BCMMSG(wlc->wiphy, "wl%d: rspec 0x%x, "
6018 "preamble_type %d\n", wlc->pub->unit, rspec, preamble_type); 6010 "preamble_type %d\n", wlc->pub->unit, rspec, preamble_type);
6019 /* 6011 /*
6020 * Spec 9.6: ack rate is the highest rate in BSSBasicRateSet that 6012 * Spec 9.6: ack rate is the highest rate in BSSBasicRateSet that
6021 * is less than or equal to the rate of the immediately previous 6013 * is less than or equal to the rate of the immediately previous
@@ -6138,7 +6130,7 @@ static bool brcms_c_valid_rate(struct brcms_c_info *wlc, u32 rspec, int band,
6138 return true; 6130 return true;
6139 error: 6131 error:
6140 if (verbose) 6132 if (verbose)
6141 wiphy_err(wlc->wiphy, "wl%d: valid_rate: rate spec 0x%x " 6133 brcms_err(wlc->hw->d11core, "wl%d: valid_rate: rate spec 0x%x "
6142 "not in hw_rateset\n", wlc->pub->unit, rspec); 6134 "not in hw_rateset\n", wlc->pub->unit, rspec);
6143 6135
6144 return false; 6136 return false;
@@ -6148,6 +6140,7 @@ static u32
6148mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band, 6140mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
6149 u32 int_val) 6141 u32 int_val)
6150{ 6142{
6143 struct bcma_device *core = wlc->hw->d11core;
6151 u8 stf = (int_val & NRATE_STF_MASK) >> NRATE_STF_SHIFT; 6144 u8 stf = (int_val & NRATE_STF_MASK) >> NRATE_STF_SHIFT;
6152 u8 rate = int_val & NRATE_RATE_MASK; 6145 u8 rate = int_val & NRATE_RATE_MASK;
6153 u32 rspec; 6146 u32 rspec;
@@ -6164,7 +6157,7 @@ mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
6164 if ((wlc->pub->_n_enab & SUPPORT_11N) && ismcs) { 6157 if ((wlc->pub->_n_enab & SUPPORT_11N) && ismcs) {
6165 /* mcs only allowed when nmode */ 6158 /* mcs only allowed when nmode */
6166 if (stf > PHY_TXC1_MODE_SDM) { 6159 if (stf > PHY_TXC1_MODE_SDM) {
6167 wiphy_err(wlc->wiphy, "wl%d: %s: Invalid stf\n", 6160 brcms_err(core, "wl%d: %s: Invalid stf\n",
6168 wlc->pub->unit, __func__); 6161 wlc->pub->unit, __func__);
6169 bcmerror = -EINVAL; 6162 bcmerror = -EINVAL;
6170 goto done; 6163 goto done;
@@ -6175,8 +6168,8 @@ mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
6175 if (!CHSPEC_IS40(wlc->home_chanspec) || 6168 if (!CHSPEC_IS40(wlc->home_chanspec) ||
6176 ((stf != PHY_TXC1_MODE_SISO) 6169 ((stf != PHY_TXC1_MODE_SISO)
6177 && (stf != PHY_TXC1_MODE_CDD))) { 6170 && (stf != PHY_TXC1_MODE_CDD))) {
6178 wiphy_err(wlc->wiphy, "wl%d: %s: Invalid mcs " 6171 brcms_err(core, "wl%d: %s: Invalid mcs 32\n",
6179 "32\n", wlc->pub->unit, __func__); 6172 wlc->pub->unit, __func__);
6180 bcmerror = -EINVAL; 6173 bcmerror = -EINVAL;
6181 goto done; 6174 goto done;
6182 } 6175 }
@@ -6197,15 +6190,15 @@ mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
6197 if ((stf > PHY_TXC1_MODE_STBC) || 6190 if ((stf > PHY_TXC1_MODE_STBC) ||
6198 (!BRCMS_STBC_CAP_PHY(wlc) 6191 (!BRCMS_STBC_CAP_PHY(wlc)
6199 && (stf == PHY_TXC1_MODE_STBC))) { 6192 && (stf == PHY_TXC1_MODE_STBC))) {
6200 wiphy_err(wlc->wiphy, "wl%d: %s: Invalid STBC" 6193 brcms_err(core, "wl%d: %s: Invalid STBC\n",
6201 "\n", wlc->pub->unit, __func__); 6194 wlc->pub->unit, __func__);
6202 bcmerror = -EINVAL; 6195 bcmerror = -EINVAL;
6203 goto done; 6196 goto done;
6204 } 6197 }
6205 } 6198 }
6206 } else if (is_ofdm_rate(rate)) { 6199 } else if (is_ofdm_rate(rate)) {
6207 if ((stf != PHY_TXC1_MODE_CDD) && (stf != PHY_TXC1_MODE_SISO)) { 6200 if ((stf != PHY_TXC1_MODE_CDD) && (stf != PHY_TXC1_MODE_SISO)) {
6208 wiphy_err(wlc->wiphy, "wl%d: %s: Invalid OFDM\n", 6201 brcms_err(core, "wl%d: %s: Invalid OFDM\n",
6209 wlc->pub->unit, __func__); 6202 wlc->pub->unit, __func__);
6210 bcmerror = -EINVAL; 6203 bcmerror = -EINVAL;
6211 goto done; 6204 goto done;
@@ -6213,20 +6206,20 @@ mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
6213 } else if (is_cck_rate(rate)) { 6206 } else if (is_cck_rate(rate)) {
6214 if ((cur_band->bandtype != BRCM_BAND_2G) 6207 if ((cur_band->bandtype != BRCM_BAND_2G)
6215 || (stf != PHY_TXC1_MODE_SISO)) { 6208 || (stf != PHY_TXC1_MODE_SISO)) {
6216 wiphy_err(wlc->wiphy, "wl%d: %s: Invalid CCK\n", 6209 brcms_err(core, "wl%d: %s: Invalid CCK\n",
6217 wlc->pub->unit, __func__); 6210 wlc->pub->unit, __func__);
6218 bcmerror = -EINVAL; 6211 bcmerror = -EINVAL;
6219 goto done; 6212 goto done;
6220 } 6213 }
6221 } else { 6214 } else {
6222 wiphy_err(wlc->wiphy, "wl%d: %s: Unknown rate type\n", 6215 brcms_err(core, "wl%d: %s: Unknown rate type\n",
6223 wlc->pub->unit, __func__); 6216 wlc->pub->unit, __func__);
6224 bcmerror = -EINVAL; 6217 bcmerror = -EINVAL;
6225 goto done; 6218 goto done;
6226 } 6219 }
6227 /* make sure multiple antennae are available for non-siso rates */ 6220 /* make sure multiple antennae are available for non-siso rates */
6228 if ((stf != PHY_TXC1_MODE_SISO) && (wlc->stf->txstreams == 1)) { 6221 if ((stf != PHY_TXC1_MODE_SISO) && (wlc->stf->txstreams == 1)) {
6229 wiphy_err(wlc->wiphy, "wl%d: %s: SISO antenna but !SISO " 6222 brcms_err(core, "wl%d: %s: SISO antenna but !SISO "
6230 "request\n", wlc->pub->unit, __func__); 6223 "request\n", wlc->pub->unit, __func__);
6231 bcmerror = -EINVAL; 6224 bcmerror = -EINVAL;
6232 goto done; 6225 goto done;
@@ -6295,7 +6288,7 @@ static void brcms_c_cck_plcp_set(struct brcms_c_info *wlc, int rate_500,
6295 break; 6288 break;
6296 6289
6297 default: 6290 default:
6298 wiphy_err(wlc->wiphy, 6291 brcms_err(wlc->hw->d11core,
6299 "brcms_c_cck_plcp_set: unsupported rate %d\n", 6292 "brcms_c_cck_plcp_set: unsupported rate %d\n",
6300 rate_500); 6293 rate_500);
6301 rate_500 = BRCM_RATE_1M; 6294 rate_500 = BRCM_RATE_1M;
@@ -6428,7 +6421,7 @@ static u16 brcms_c_phytxctl1_calc(struct brcms_c_info *wlc, u32 rspec)
6428 bw = rspec_get_bw(rspec); 6421 bw = rspec_get_bw(rspec);
6429 /* 10Mhz is not supported yet */ 6422 /* 10Mhz is not supported yet */
6430 if (bw < PHY_TXC1_BW_20MHZ) { 6423 if (bw < PHY_TXC1_BW_20MHZ) {
6431 wiphy_err(wlc->wiphy, "phytxctl1_calc: bw %d is " 6424 brcms_err(wlc->hw->d11core, "phytxctl1_calc: bw %d is "
6432 "not supported yet, set to 20L\n", bw); 6425 "not supported yet, set to 20L\n", bw);
6433 bw = PHY_TXC1_BW_20MHZ; 6426 bw = PHY_TXC1_BW_20MHZ;
6434 } 6427 }
@@ -6455,7 +6448,7 @@ static u16 brcms_c_phytxctl1_calc(struct brcms_c_info *wlc, u32 rspec)
6455 /* get the phyctl byte from rate phycfg table */ 6448 /* get the phyctl byte from rate phycfg table */
6456 phycfg = brcms_c_rate_legacy_phyctl(rspec2rate(rspec)); 6449 phycfg = brcms_c_rate_legacy_phyctl(rspec2rate(rspec));
6457 if (phycfg == -1) { 6450 if (phycfg == -1) {
6458 wiphy_err(wlc->wiphy, "phytxctl1_calc: wrong " 6451 brcms_err(wlc->hw->d11core, "phytxctl1_calc: wrong "
6459 "legacy OFDM/CCK rate\n"); 6452 "legacy OFDM/CCK rate\n");
6460 phycfg = 0; 6453 phycfg = 0;
6461 } 6454 }
@@ -6535,8 +6528,9 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
6535 if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { 6528 if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
6536 /* non-AP STA should never use BCMC queue */ 6529 /* non-AP STA should never use BCMC queue */
6537 if (queue == TX_BCMC_FIFO) { 6530 if (queue == TX_BCMC_FIFO) {
6538 wiphy_err(wlc->wiphy, "wl%d: %s: ASSERT queue == " 6531 brcms_err(wlc->hw->d11core,
6539 "TX_BCMC!\n", wlc->pub->unit, __func__); 6532 "wl%d: %s: ASSERT queue == TX_BCMC!\n",
6533 wlc->pub->unit, __func__);
6540 frameid = bcmc_fid_generate(wlc, NULL, txh); 6534 frameid = bcmc_fid_generate(wlc, NULL, txh);
6541 } else { 6535 } else {
6542 /* Increment the counter for first fragment */ 6536 /* Increment the counter for first fragment */
@@ -6706,7 +6700,8 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
6706 6700
6707 if ((txrate[k]->flags & IEEE80211_TX_RC_MCS) 6701 if ((txrate[k]->flags & IEEE80211_TX_RC_MCS)
6708 && (!is_mcs_rate(rspec[k]))) { 6702 && (!is_mcs_rate(rspec[k]))) {
6709 wiphy_err(wlc->wiphy, "wl%d: %s: IEEE80211_TX_" 6703 brcms_err(wlc->hw->d11core,
6704 "wl%d: %s: IEEE80211_TX_"
6710 "RC_MCS != is_mcs_rate(rspec)\n", 6705 "RC_MCS != is_mcs_rate(rspec)\n",
6711 wlc->pub->unit, __func__); 6706 wlc->pub->unit, __func__);
6712 } 6707 }
@@ -7100,14 +7095,16 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
7100 wlc->fragthresh[queue] = 7095 wlc->fragthresh[queue] =
7101 (u16) newfragthresh; 7096 (u16) newfragthresh;
7102 } else { 7097 } else {
7103 wiphy_err(wlc->wiphy, "wl%d: %s txop invalid " 7098 brcms_err(wlc->hw->d11core,
7099 "wl%d: %s txop invalid "
7104 "for rate %d\n", 7100 "for rate %d\n",
7105 wlc->pub->unit, fifo_names[queue], 7101 wlc->pub->unit, fifo_names[queue],
7106 rspec2rate(rspec[0])); 7102 rspec2rate(rspec[0]));
7107 } 7103 }
7108 7104
7109 if (dur > wlc->edcf_txop[ac]) 7105 if (dur > wlc->edcf_txop[ac])
7110 wiphy_err(wlc->wiphy, "wl%d: %s: %s txop " 7106 brcms_err(wlc->hw->d11core,
7107 "wl%d: %s: %s txop "
7111 "exceeded phylen %d/%d dur %d/%d\n", 7108 "exceeded phylen %d/%d dur %d/%d\n",
7112 wlc->pub->unit, __func__, 7109 wlc->pub->unit, __func__,
7113 fifo_names[queue], 7110 fifo_names[queue],
@@ -7140,7 +7137,7 @@ static int brcms_c_tx(struct brcms_c_info *wlc, struct sk_buff *skb)
7140 * in the tx ring and the tx queue isn't stopped then 7137 * in the tx ring and the tx queue isn't stopped then
7141 * we've really got a bug; warn loudly if that happens. 7138 * we've really got a bug; warn loudly if that happens.
7142 */ 7139 */
7143 wiphy_warn(wlc->wiphy, 7140 brcms_warn(wlc->hw->d11core,
7144 "Received frame for tx with no space in DMA ring\n"); 7141 "Received frame for tx with no space in DMA ring\n");
7145 WARN_ON(!ieee80211_queue_stopped(wlc->pub->ieee_hw, 7142 WARN_ON(!ieee80211_queue_stopped(wlc->pub->ieee_hw,
7146 skb_get_queue_mapping(skb))); 7143 skb_get_queue_mapping(skb)));
@@ -7392,7 +7389,8 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
7392 rx_status->rate_idx = 11; 7389 rx_status->rate_idx = 11;
7393 break; 7390 break;
7394 default: 7391 default:
7395 wiphy_err(wlc->wiphy, "%s: Unknown rate\n", __func__); 7392 brcms_err(wlc->hw->d11core,
7393 "%s: Unknown rate\n", __func__);
7396 } 7394 }
7397 7395
7398 /* 7396 /*
@@ -7411,7 +7409,7 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
7411 } else if (is_ofdm_rate(rspec)) { 7409 } else if (is_ofdm_rate(rspec)) {
7412 rx_status->flag |= RX_FLAG_SHORTPRE; 7410 rx_status->flag |= RX_FLAG_SHORTPRE;
7413 } else { 7411 } else {
7414 wiphy_err(wlc->wiphy, "%s: Unknown modulation\n", 7412 brcms_err(wlc->hw->d11core, "%s: Unknown modulation\n",
7415 __func__); 7413 __func__);
7416 } 7414 }
7417 } 7415 }
@@ -7421,12 +7419,12 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
7421 7419
7422 if (rxh->RxStatus1 & RXS_DECERR) { 7420 if (rxh->RxStatus1 & RXS_DECERR) {
7423 rx_status->flag |= RX_FLAG_FAILED_PLCP_CRC; 7421 rx_status->flag |= RX_FLAG_FAILED_PLCP_CRC;
7424 wiphy_err(wlc->wiphy, "%s: RX_FLAG_FAILED_PLCP_CRC\n", 7422 brcms_err(wlc->hw->d11core, "%s: RX_FLAG_FAILED_PLCP_CRC\n",
7425 __func__); 7423 __func__);
7426 } 7424 }
7427 if (rxh->RxStatus1 & RXS_FCSERR) { 7425 if (rxh->RxStatus1 & RXS_FCSERR) {
7428 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; 7426 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
7429 wiphy_err(wlc->wiphy, "%s: RX_FLAG_FAILED_FCS_CRC\n", 7427 brcms_err(wlc->hw->d11core, "%s: RX_FLAG_FAILED_FCS_CRC\n",
7430 __func__); 7428 __func__);
7431 } 7429 }
7432} 7430}
@@ -7837,8 +7835,9 @@ static void brcms_c_recv(struct brcms_c_info *wlc, struct sk_buff *p)
7837 /* MAC inserts 2 pad bytes for a4 headers or QoS or A-MSDU subframes */ 7835 /* MAC inserts 2 pad bytes for a4 headers or QoS or A-MSDU subframes */
7838 if (rxh->RxStatus1 & RXS_PBPRES) { 7836 if (rxh->RxStatus1 & RXS_PBPRES) {
7839 if (p->len < 2) { 7837 if (p->len < 2) {
7840 wiphy_err(wlc->wiphy, "wl%d: recv: rcvd runt of " 7838 brcms_err(wlc->hw->d11core,
7841 "len %d\n", wlc->pub->unit, p->len); 7839 "wl%d: recv: rcvd runt of len %d\n",
7840 wlc->pub->unit, p->len);
7842 goto toss; 7841 goto toss;
7843 } 7842 }
7844 skb_pull(p, 2); 7843 skb_pull(p, 2);
@@ -7934,10 +7933,9 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
7934 u32 macintstatus; 7933 u32 macintstatus;
7935 struct brcms_hardware *wlc_hw = wlc->hw; 7934 struct brcms_hardware *wlc_hw = wlc->hw;
7936 struct bcma_device *core = wlc_hw->d11core; 7935 struct bcma_device *core = wlc_hw->d11core;
7937 struct wiphy *wiphy = wlc->wiphy;
7938 7936
7939 if (brcms_deviceremoved(wlc)) { 7937 if (brcms_deviceremoved(wlc)) {
7940 wiphy_err(wiphy, "wl%d: %s: dead chip\n", wlc_hw->unit, 7938 brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit,
7941 __func__); 7939 __func__);
7942 brcms_down(wlc->wl); 7940 brcms_down(wlc->wl);
7943 return false; 7941 return false;
@@ -7958,7 +7956,7 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
7958 if (brcms_b_txstatus(wlc->hw, bounded, &fatal)) 7956 if (brcms_b_txstatus(wlc->hw, bounded, &fatal))
7959 wlc->macintstatus |= MI_TFS; 7957 wlc->macintstatus |= MI_TFS;
7960 if (fatal) { 7958 if (fatal) {
7961 wiphy_err(wiphy, "MI_TFS: fatal\n"); 7959 brcms_err(core, "MI_TFS: fatal\n");
7962 goto fatal; 7960 goto fatal;
7963 } 7961 }
7964 } 7962 }
@@ -7968,7 +7966,7 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
7968 7966
7969 /* ATIM window end */ 7967 /* ATIM window end */
7970 if (macintstatus & MI_ATIMWINEND) { 7968 if (macintstatus & MI_ATIMWINEND) {
7971 BCMMSG(wlc->wiphy, "end of ATIM window\n"); 7969 brcms_dbg_info(core, "end of ATIM window\n");
7972 bcma_set32(core, D11REGOFFS(maccommand), wlc->qvalid); 7970 bcma_set32(core, D11REGOFFS(maccommand), wlc->qvalid);
7973 wlc->qvalid = 0; 7971 wlc->qvalid = 0;
7974 } 7972 }
@@ -7986,7 +7984,7 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
7986 wlc_phy_noise_sample_intr(wlc_hw->band->pi); 7984 wlc_phy_noise_sample_intr(wlc_hw->band->pi);
7987 7985
7988 if (macintstatus & MI_GP0) { 7986 if (macintstatus & MI_GP0) {
7989 wiphy_err(wiphy, "wl%d: PSM microcode watchdog fired at %d " 7987 brcms_err(core, "wl%d: PSM microcode watchdog fired at %d "
7990 "(seconds). Resetting.\n", wlc_hw->unit, wlc_hw->now); 7988 "(seconds). Resetting.\n", wlc_hw->unit, wlc_hw->now);
7991 7989
7992 printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n", 7990 printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n",
@@ -8000,8 +7998,8 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
8000 bcma_write32(core, D11REGOFFS(gptimer), 0); 7998 bcma_write32(core, D11REGOFFS(gptimer), 0);
8001 7999
8002 if (macintstatus & MI_RFDISABLE) { 8000 if (macintstatus & MI_RFDISABLE) {
8003 BCMMSG(wlc->wiphy, "wl%d: BMAC Detected a change on the" 8001 brcms_dbg_info(core, "wl%d: BMAC Detected a change on the"
8004 " RF Disable Input\n", wlc_hw->unit); 8002 " RF Disable Input\n", wlc_hw->unit);
8005 brcms_rfkill_set_hw_state(wlc->wl); 8003 brcms_rfkill_set_hw_state(wlc->wl);
8006 } 8004 }
8007 8005
@@ -8019,7 +8017,7 @@ void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx)
8019 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel; 8017 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel;
8020 u16 chanspec; 8018 u16 chanspec;
8021 8019
8022 BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); 8020 brcms_dbg_info(core, "wl%d\n", wlc->pub->unit);
8023 8021
8024 chanspec = ch20mhz_chspec(ch->hw_value); 8022 chanspec = ch20mhz_chspec(ch->hw_value);
8025 8023