From 0bef7748e1327f72b006ea699e8725be50685f0e Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Thu, 10 Feb 2011 12:03:44 +0100 Subject: [PATCH] staging: brcm80211: remove usage of printf (macro) from driver The driver contained several calls to printf which was mapped to printk using a macro. These have been changed to explicit call to printk or use an appropropriate macro. Reviewed-by: Roland Vossen Reviewed-by: Brett Rudley Reviewed-by: Henry Ptasinski Signed-off-by: Arend van Spriel Signed-off-by: Greg Kroah-Hartman --- .../staging/brcm80211/brcmfmac/bcmsdh_linux.c | 2 +- .../staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 36 +++++- .../staging/brcm80211/brcmfmac/dhd_common.c | 17 +-- drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 28 ++-- .../staging/brcm80211/brcmfmac/dhd_linux.c | 4 +- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 20 +-- drivers/staging/brcm80211/brcmfmac/wl_iw.c | 8 +- .../staging/brcm80211/brcmsmac/wl_mac80211.c | 24 ++-- .../staging/brcm80211/brcmsmac/wlc_channel.c | 120 ++++++++++-------- .../staging/brcm80211/brcmsmac/wlc_mac80211.c | 119 ++++++++--------- drivers/staging/brcm80211/include/bcmsdh.h | 12 +- drivers/staging/brcm80211/include/osl.h | 1 - drivers/staging/brcm80211/include/siutils.h | 2 +- drivers/staging/brcm80211/util/bcmutils.c | 8 +- drivers/staging/brcm80211/util/hnddma.c | 6 +- drivers/staging/brcm80211/util/hndpmu.c | 2 +- 16 files changed, 229 insertions(+), 180 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c index 143e8604a596..deb5f46542ae 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c @@ -114,7 +114,7 @@ bool bcmsdh_chipmatch(u16 vendor, u16 device) #ifdef BCMSDIOH_SPI /* This is the PciSpiHost. */ if (device == SPIH_FPGA_ID && vendor == VENDOR_BROADCOM) { - printf("Found PCI SPI Host Controller\n"); + WL_NONE("Found PCI SPI Host Controller\n"); return true; } #endif /* BCMSDIOH_SPI */ diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h index 4d671ddb3af1..50470f6c92fa 100644 --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h @@ -18,12 +18,36 @@ #define __BCMSDH_SDMMC_H__ #ifdef BCMDBG -#define sd_err(x) do { if ((sd_msglevel & SDH_ERROR_VAL) && net_ratelimit()) printf x; } while (0) -#define sd_trace(x) do { if ((sd_msglevel & SDH_TRACE_VAL) && net_ratelimit()) printf x; } while (0) -#define sd_info(x) do { if ((sd_msglevel & SDH_INFO_VAL) && net_ratelimit()) printf x; } while (0) -#define sd_debug(x) do { if ((sd_msglevel & SDH_DEBUG_VAL) && net_ratelimit()) printf x; } while (0) -#define sd_data(x) do { if ((sd_msglevel & SDH_DATA_VAL) && net_ratelimit()) printf x; } while (0) -#define sd_ctrl(x) do { if ((sd_msglevel & SDH_CTRL_VAL) && net_ratelimit()) printf x; } while (0) +#define sd_err(x) \ + do { \ + if ((sd_msglevel & SDH_ERROR_VAL) && net_ratelimit()) \ + printk x; \ + } while (0) +#define sd_trace(x) \ + do { \ + if ((sd_msglevel & SDH_TRACE_VAL) && net_ratelimit()) \ + printk x; \ + } while (0) +#define sd_info(x) \ + do { \ + if ((sd_msglevel & SDH_INFO_VAL) && net_ratelimit()) \ + printk x; \ + } while (0) +#define sd_debug(x) \ + do { \ + if ((sd_msglevel & SDH_DEBUG_VAL) && net_ratelimit()) \ + printk x; \ + } while (0) +#define sd_data(x) \ + do { \ + if ((sd_msglevel & SDH_DATA_VAL) && net_ratelimit()) \ + printk x; \ + } while (0) +#define sd_ctrl(x) \ + do { \ + if ((sd_msglevel & SDH_CTRL_VAL) && net_ratelimit()) \ + printk x; \ + } while (0) #else #define sd_err(x) #define sd_trace(x) diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c index eeabbc3334d4..ad4a00871d85 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c @@ -739,10 +739,11 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data) memcpy(&hdr, buf, MSGTRACE_HDRLEN); if (hdr.version != MSGTRACE_VERSION) { - printf + DHD_ERROR( ("\nMACEVENT: %s [unsupported version --> " "dhd version:%d dongle version:%d]\n", - event_name, MSGTRACE_VERSION, hdr.version); + event_name, MSGTRACE_VERSION, hdr.version) + ); /* Reset datalen to avoid display below */ datalen = 0; break; @@ -753,18 +754,18 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data) if (ntoh32(hdr.discarded_bytes) || ntoh32(hdr.discarded_printf)) { - printf + DHD_ERROR( ("\nWLC_E_TRACE: [Discarded traces in dongle -->" "discarded_bytes %d discarded_printf %d]\n", ntoh32(hdr.discarded_bytes), - ntoh32(hdr.discarded_printf)); + ntoh32(hdr.discarded_printf))); } nblost = ntoh32(hdr.seqnum) - seqnum_prev - 1; if (nblost > 0) { - printf + DHD_ERROR( ("\nWLC_E_TRACE: [Event lost --> seqnum %d nblost %d\n", - ntoh32(hdr.seqnum), nblost); + ntoh32(hdr.seqnum), nblost)); } seqnum_prev = ntoh32(hdr.seqnum); @@ -775,10 +776,10 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data) p = (char *)&buf[MSGTRACE_HDRLEN]; while ((s = strstr(p, "\n")) != NULL) { *s = '\0'; - printf("%s\n", p); + printk(KERN_DEBUG"%s\n", p); p = s + 1; } - printf("%s\n", p); + printk(KERN_DEBUG "%s\n", p); /* Reset datalen to avoid display below */ datalen = 0; diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h index cd2578ad3552..0817f1348e09 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h +++ b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h @@ -21,31 +21,31 @@ #define DHD_ERROR(args) \ do {if ((dhd_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \ - printf args; } while (0) + printk args; } while (0) #define DHD_TRACE(args) do {if (dhd_msg_level & DHD_TRACE_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_INFO(args) do {if (dhd_msg_level & DHD_INFO_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_DATA(args) do {if (dhd_msg_level & DHD_DATA_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_CTL(args) do {if (dhd_msg_level & DHD_CTL_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_TIMER(args) do {if (dhd_msg_level & DHD_TIMER_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_HDRS(args) do {if (dhd_msg_level & DHD_HDRS_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_BYTES(args) do {if (dhd_msg_level & DHD_BYTES_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_INTR(args) do {if (dhd_msg_level & DHD_INTR_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_GLOM(args) do {if (dhd_msg_level & DHD_GLOM_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_EVENT(args) do {if (dhd_msg_level & DHD_EVENT_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_BTA(args) do {if (dhd_msg_level & DHD_BTA_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_ISCAN(args) do {if (dhd_msg_level & DHD_ISCAN_VAL) \ - printf args; } while (0) + printk args; } while (0) #define DHD_ERROR_ON() (dhd_msg_level & DHD_ERROR_VAL) #define DHD_TRACE_ON() (dhd_msg_level & DHD_TRACE_VAL) @@ -63,7 +63,7 @@ #else /* (defined BCMDBG) || (defined DHD_DEBUG) */ -#define DHD_ERROR(args) do {if (net_ratelimit()) printf args; } while (0) +#define DHD_ERROR(args) do {if (net_ratelimit()) printk args; } while (0) #define DHD_TRACE(args) #define DHD_INFO(args) #define DHD_DATA(args) diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c index 7100d815163c..2426a616807e 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c @@ -2299,7 +2299,7 @@ int dhd_net_attach(dhd_pub_t *dhdp, int ifidx) goto fail; } - printf("%s: Broadcom Dongle Host Driver\n", net->name); + DHD_INFO(("%s: Broadcom Dongle Host Driver\n", net->name)); return 0; @@ -2934,7 +2934,7 @@ int write_to_file(dhd_pub_t *dhd, u8 *buf, int size) /* open file to write */ fp = filp_open("/tmp/mem_dump", O_WRONLY | O_CREAT, 0640); if (!fp) { - printf("%s: open file error\n", __func__); + DHD_ERROR(("%s: open file error\n", __func__)); ret = -1; goto exit; } diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c index 383416d5a750..159c45928e74 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c @@ -1951,34 +1951,34 @@ static int dhdsdio_mem_dump(dhd_bus_t *bus) size = bus->ramsize; buf = kmalloc(size, GFP_ATOMIC); if (!buf) { - printf("%s: Out of memory (%d bytes)\n", __func__, size); + DHD_ERROR(("%s: Out of memory (%d bytes)\n", __func__, size)); return -1; } /* Read mem content */ - printf("Dump dongle memory"); + printk(KERN_DEBUG "Dump dongle memory"); databuf = buf; while (size) { read_size = min(MEMBLOCK, size); ret = dhdsdio_membytes(bus, false, start, databuf, read_size); if (ret) { - printf("%s: Error membytes %d\n", __func__, ret); + DHD_ERROR(("%s: Error membytes %d\n", __func__, ret)); if (buf) kfree(buf); return -1; } - printf("."); + printk("."); /* Decrement size and increment start address */ size -= read_size; start += read_size; databuf += read_size; } - printf("Done\n"); + printk(KERN_DEBUG "Done\n"); /* free buf before return !!! */ if (write_to_file(bus->dhd, buf, bus->ramsize)) { - printf("%s: Error writing to files\n", __func__); + DHD_ERROR(("%s: Error writing to files\n", __func__)); return -1; } @@ -2056,7 +2056,7 @@ static int dhdsdio_readconsole(dhd_bus_t *bus) if (line[n - 1] == '\r') n--; line[n] = 0; - printf("CONSOLE: %s\n", line); + printk(KERN_DEBUG "CONSOLE: %s\n", line); } } break2: @@ -4500,7 +4500,7 @@ clkwait: if (ret == 0) bus->tx_seq = (bus->tx_seq + 1) % SDPCM_SEQUENCE_WRAP; - printf("Return_dpc value is : %d\n", ret); + DHD_INFO(("Return_dpc value is : %d\n", ret)); bus->ctrl_frame_stat = false; dhd_wait_event_wakeup(bus->dhd); } @@ -4640,7 +4640,7 @@ static void dhdsdio_pktgen(dhd_bus_t *bus) /* Display current count if appropriate */ if (bus->pktgen_print && (++bus->pktgen_ptick >= bus->pktgen_print)) { bus->pktgen_ptick = 0; - printf("%s: send attempts %d rcvd %d\n", + printk(KERN_DEBUG "%s: send attempts %d rcvd %d\n", __func__, bus->pktgen_sent, bus->pktgen_rcvd); } @@ -5237,7 +5237,7 @@ dhdsdio_probe_attach(struct dhd_bus *bus, struct osl_info *osh, void *sdh, DHD_ERROR(("%s: FAILED to return to SI_ENUM_BASE\n", __func__)); #ifdef DHD_DEBUG - printf("F1 signature read @0x18000000=0x%4x\n", + printk(KERN_DEBUG "F1 signature read @0x18000000=0x%4x\n", bcmsdh_reg_read(bus->sdh, SI_ENUM_BASE, 4)); #endif /* DHD_DEBUG */ diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c index f4b1b4ecab82..1dbc94a98a47 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c @@ -3444,10 +3444,10 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data) wrqu.data.length = sizeof(status) + 1; extra[0] = WLC_E_ACTION_FRAME_COMPLETE; memcpy(&extra[1], &status, sizeof(status)); - printf("wl_iw_event status %d PacketId %d\n", status, - toto); - printf("WLC_E_ACTION_FRAME_COMPLETE len %d\n", - wrqu.data.length); + WL_TRACE("wl_iw_event status %d PacketId %d\n", status, + toto); + WL_TRACE("WLC_E_ACTION_FRAME_COMPLETE len %d\n", + wrqu.data.length); } break; #endif /* WIRELESS_EXT > 14 */ diff --git a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c index ce115f29d79a..c1d66995bdcb 100644 --- a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +++ b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c @@ -711,8 +711,8 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs, /* prepare ucode */ if (wl_request_fw(wl, (struct pci_dev *)btparam)) { - printf("%s: Failed to find firmware usually in %s\n", - KBUILD_MODNAME, "/lib/firmware/brcm"); + WL_ERROR("%s: Failed to find firmware usually in %s\n", + KBUILD_MODNAME, "/lib/firmware/brcm"); wl_release_fw(wl); wl_remove((struct pci_dev *)btparam); goto fail1; @@ -723,8 +723,8 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs, wl->regsva, wl->bcm_bustype, btparam, &err); wl_release_fw(wl); if (!wl->wlc) { - printf("%s: wlc_attach() failed with code %d\n", - KBUILD_MODNAME, err); + WL_ERROR("%s: wlc_attach() failed with code %d\n", + KBUILD_MODNAME, err); goto fail; } wl->pub = wlc_pub(wl->wlc); @@ -1705,15 +1705,15 @@ int wl_ucode_init_buf(struct wl_info *wl, void **pbuf, u32 idx) pdata = wl->fw.fw_bin[i]->data + hdr->offset; *pbuf = kmalloc(hdr->len, GFP_ATOMIC); if (*pbuf == NULL) { - printf("fail to alloc %d bytes\n", - hdr->len); + WL_ERROR("fail to alloc %d bytes\n", + hdr->len); } bcopy(pdata, *pbuf, hdr->len); return 0; } } } - printf("ERROR: ucode buf tag:%d can not be found!\n", idx); + WL_ERROR("ERROR: ucode buf tag:%d can not be found!\n", idx); *pbuf = NULL; return -1; } @@ -1735,7 +1735,7 @@ int wl_ucode_init_uint(struct wl_info *wl, u32 *data, u32 idx) } } } - printf("ERROR: ucode tag:%d can not be found!\n", idx); + WL_ERROR("ERROR: ucode tag:%d can not be found!\n", idx); return -1; } @@ -1755,8 +1755,8 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev) WL_NONE("request fw %s\n", fw_name); status = request_firmware(&wl->fw.fw_bin[i], fw_name, device); if (status) { - printf("%s: fail to load firmware %s\n", - KBUILD_MODNAME, fw_name); + WL_ERROR("%s: fail to load firmware %s\n", + KBUILD_MODNAME, fw_name); wl_release_fw(wl); return status; } @@ -1765,8 +1765,8 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev) UCODE_LOADER_API_VER); status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device); if (status) { - printf("%s: fail to load firmware %s\n", - KBUILD_MODNAME, fw_name); + WL_ERROR("%s: fail to load firmware %s\n", + KBUILD_MODNAME, fw_name); wl_release_fw(wl); return status; } diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_channel.c b/drivers/staging/brcm80211/brcmsmac/wlc_channel.c index 2e30d9223052..06b31a0364f4 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_channel.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_channel.c @@ -1144,100 +1144,114 @@ wlc_channel_set_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chanspec, static void wlc_phy_txpower_limits_dump(txpwr_limits_t *txpwr) { int i; + char buf[80]; char fraction[4][4] = { " ", ".25", ".5 ", ".75" }; - printf("CCK "); + sprintf(buf, "CCK "); for (i = 0; i < WLC_NUM_RATES_CCK; i++) { - printf(" %2d%s", txpwr->cck[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->cck[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->cck[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->cck[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("20 MHz OFDM SISO "); + sprintf(buf, "20 MHz OFDM SISO "); for (i = 0; i < WLC_NUM_RATES_OFDM; i++) { - printf(" %2d%s", txpwr->ofdm[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->ofdm[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->ofdm[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->ofdm[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("20 MHz OFDM CDD "); + sprintf(buf, "20 MHz OFDM CDD "); for (i = 0; i < WLC_NUM_RATES_OFDM; i++) { - printf(" %2d%s", txpwr->ofdm_cdd[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->ofdm_cdd[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->ofdm_cdd[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->ofdm_cdd[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("40 MHz OFDM SISO "); + sprintf(buf, "40 MHz OFDM SISO "); for (i = 0; i < WLC_NUM_RATES_OFDM; i++) { - printf(" %2d%s", txpwr->ofdm_40_siso[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->ofdm_40_siso[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->ofdm_40_siso[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->ofdm_40_siso[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("40 MHz OFDM CDD "); + sprintf(buf, "40 MHz OFDM CDD "); for (i = 0; i < WLC_NUM_RATES_OFDM; i++) { - printf(" %2d%s", txpwr->ofdm_40_cdd[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->ofdm_40_cdd[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->ofdm_40_cdd[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->ofdm_40_cdd[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("20 MHz MCS0-7 SISO "); + sprintf(buf, "20 MHz MCS0-7 SISO "); for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) { - printf(" %2d%s", txpwr->mcs_20_siso[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->mcs_20_siso[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->mcs_20_siso[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->mcs_20_siso[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("20 MHz MCS0-7 CDD "); + sprintf(buf, "20 MHz MCS0-7 CDD "); for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) { - printf(" %2d%s", txpwr->mcs_20_cdd[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->mcs_20_cdd[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->mcs_20_cdd[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->mcs_20_cdd[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("20 MHz MCS0-7 STBC "); + sprintf(buf, "20 MHz MCS0-7 STBC "); for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) { - printf(" %2d%s", txpwr->mcs_20_stbc[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->mcs_20_stbc[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->mcs_20_stbc[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->mcs_20_stbc[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("20 MHz MCS8-15 SDM "); + sprintf(buf, "20 MHz MCS8-15 SDM "); for (i = 0; i < WLC_NUM_RATES_MCS_2_STREAM; i++) { - printf(" %2d%s", txpwr->mcs_20_mimo[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->mcs_20_mimo[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->mcs_20_mimo[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->mcs_20_mimo[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("40 MHz MCS0-7 SISO "); + sprintf(buf, "40 MHz MCS0-7 SISO "); for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) { - printf(" %2d%s", txpwr->mcs_40_siso[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->mcs_40_siso[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->mcs_40_siso[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->mcs_40_siso[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("40 MHz MCS0-7 CDD "); + sprintf(buf, "40 MHz MCS0-7 CDD "); for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) { - printf(" %2d%s", txpwr->mcs_40_cdd[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->mcs_40_cdd[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->mcs_40_cdd[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->mcs_40_cdd[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("40 MHz MCS0-7 STBC "); + sprintf(buf, "40 MHz MCS0-7 STBC "); for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) { - printf(" %2d%s", txpwr->mcs_40_stbc[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->mcs_40_stbc[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->mcs_40_stbc[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->mcs_40_stbc[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("40 MHz MCS8-15 SDM "); + sprintf(buf, "40 MHz MCS8-15 SDM "); for (i = 0; i < WLC_NUM_RATES_MCS_2_STREAM; i++) { - printf(" %2d%s", txpwr->mcs_40_mimo[i] / WLC_TXPWR_DB_FACTOR, - fraction[txpwr->mcs_40_mimo[i] % WLC_TXPWR_DB_FACTOR]); + sprintf(buf[strlen(buf)], " %2d%s", + txpwr->mcs_40_mimo[i] / WLC_TXPWR_DB_FACTOR, + fraction[txpwr->mcs_40_mimo[i] % WLC_TXPWR_DB_FACTOR]); } - printf("\n"); + printk(KERN_DEBUG "%s\n", buf); - printf("MCS32 %2d%s\n", + printk(KERN_DEBUG "MCS32 %2d%s\n", txpwr->mcs32 / WLC_TXPWR_DB_FACTOR, fraction[txpwr->mcs32 % WLC_TXPWR_DB_FACTOR]); } diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c b/drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c index 1909bdf556c0..5a6a01614116 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c @@ -4703,19 +4703,21 @@ static const char *supr_reason[] = { static void wlc_print_txs_status(u16 s) { - printf("[15:12] %d frame attempts\n", (s & TX_STATUS_FRM_RTX_MASK) >> - TX_STATUS_FRM_RTX_SHIFT); - printf(" [11:8] %d rts attempts\n", (s & TX_STATUS_RTS_RTX_MASK) >> - TX_STATUS_RTS_RTX_SHIFT); - printf(" [7] %d PM mode indicated\n", + printk(KERN_DEBUG "[15:12] %d frame attempts\n", + (s & TX_STATUS_FRM_RTX_MASK) >> TX_STATUS_FRM_RTX_SHIFT); + printk(KERN_DEBUG " [11:8] %d rts attempts\n", + (s & TX_STATUS_RTS_RTX_MASK) >> TX_STATUS_RTS_RTX_SHIFT); + printk(KERN_DEBUG " [7] %d PM mode indicated\n", ((s & TX_STATUS_PMINDCTD) ? 1 : 0)); - printf(" [6] %d intermediate status\n", + printk(KERN_DEBUG " [6] %d intermediate status\n", ((s & TX_STATUS_INTERMEDIATE) ? 1 : 0)); - printf(" [5] %d AMPDU\n", (s & TX_STATUS_AMPDU) ? 1 : 0); - printf(" [4:2] %d Frame Suppressed Reason (%s)\n", + printk(KERN_DEBUG " [5] %d AMPDU\n", + (s & TX_STATUS_AMPDU) ? 1 : 0); + printk(KERN_DEBUG " [4:2] %d Frame Suppressed Reason (%s)\n", ((s & TX_STATUS_SUPR_MASK) >> TX_STATUS_SUPR_SHIFT), supr_reason[(s & TX_STATUS_SUPR_MASK) >> TX_STATUS_SUPR_SHIFT]); - printf(" [1] %d acked\n", ((s & TX_STATUS_ACK_RCV) ? 1 : 0)); + printk(KERN_DEBUG " [1] %d acked\n", + ((s & TX_STATUS_ACK_RCV) ? 1 : 0)); } #endif /* BCMDBG */ @@ -4725,21 +4727,22 @@ void wlc_print_txstatus(tx_status_t *txs) u16 s = txs->status; u16 ackphyrxsh = txs->ackphyrxsh; - printf("\ntxpkt (MPDU) Complete\n"); + printk(KERN_DEBUG "\ntxpkt (MPDU) Complete\n"); + + printk(KERN_DEBUG "FrameID: %04x ", txs->frameid); + printk(KERN_DEBUG "TxStatus: %04x", s); + printk(KERN_DEBUG "\n"); - printf("FrameID: %04x ", txs->frameid); - printf("TxStatus: %04x", s); - printf("\n"); -#ifdef BCMDBG wlc_print_txs_status(s); -#endif - printf("LastTxTime: %04x ", txs->lasttxtime); - printf("Seq: %04x ", txs->sequence); - printf("PHYTxStatus: %04x ", txs->phyerr); - printf("RxAckRSSI: %04x ", + + printk(KERN_DEBUG "LastTxTime: %04x ", txs->lasttxtime); + printk(KERN_DEBUG "Seq: %04x ", txs->sequence); + printk(KERN_DEBUG "PHYTxStatus: %04x ", txs->phyerr); + printk(KERN_DEBUG "RxAckRSSI: %04x ", (ackphyrxsh & PRXS1_JSSI_MASK) >> PRXS1_JSSI_SHIFT); - printf("RxAckSQ: %04x", (ackphyrxsh & PRXS1_SQ_MASK) >> PRXS1_SQ_SHIFT); - printf("\n"); + printk(KERN_DEBUG "RxAckSQ: %04x", + (ackphyrxsh & PRXS1_SQ_MASK) >> PRXS1_SQ_SHIFT); + printk(KERN_DEBUG "\n"); #endif /* defined(BCMDBG) */ } @@ -4884,51 +4887,50 @@ void wlc_print_txdesc(d11txh_t *txh) /* add plcp header along with txh descriptor */ prhex("Raw TxDesc + plcp header", (unsigned char *) txh, sizeof(d11txh_t) + 48); - printf("TxCtlLow: %04x ", mtcl); - printf("TxCtlHigh: %04x ", mtch); - printf("FC: %04x ", mfc); - printf("FES Time: %04x\n", tfest); - printf("PhyCtl: %04x%s ", ptcw, + printk(KERN_DEBUG "TxCtlLow: %04x ", mtcl); + printk(KERN_DEBUG "TxCtlHigh: %04x ", mtch); + printk(KERN_DEBUG "FC: %04x ", mfc); + printk(KERN_DEBUG "FES Time: %04x\n", tfest); + printk(KERN_DEBUG "PhyCtl: %04x%s ", ptcw, (ptcw & PHY_TXC_SHORT_HDR) ? " short" : ""); - printf("PhyCtl_1: %04x ", ptcw_1); - printf("PhyCtl_1_Fbr: %04x\n", ptcw_1_Fbr); - printf("PhyCtl_1_Rts: %04x ", ptcw_1_Rts); - printf("PhyCtl_1_Fbr_Rts: %04x\n", ptcw_1_FbrRts); - printf("MainRates: %04x ", mainrates); - printf("XtraFrameTypes: %04x ", xtraft); - printf("\n"); + printk(KERN_DEBUG "PhyCtl_1: %04x ", ptcw_1); + printk(KERN_DEBUG "PhyCtl_1_Fbr: %04x\n", ptcw_1_Fbr); + printk(KERN_DEBUG "PhyCtl_1_Rts: %04x ", ptcw_1_Rts); + printk(KERN_DEBUG "PhyCtl_1_Fbr_Rts: %04x\n", ptcw_1_FbrRts); + printk(KERN_DEBUG "MainRates: %04x ", mainrates); + printk(KERN_DEBUG "XtraFrameTypes: %04x ", xtraft); + printk(KERN_DEBUG "\n"); bcm_format_hex(hexbuf, iv, sizeof(txh->IV)); - printf("SecIV: %s\n", hexbuf); + printk(KERN_DEBUG "SecIV: %s\n", hexbuf); bcm_format_hex(hexbuf, ra, sizeof(txh->TxFrameRA)); - printf("RA: %s\n", hexbuf); + printk(KERN_DEBUG "RA: %s\n", hexbuf); - printf("Fb FES Time: %04x ", tfestfb); + printk(KERN_DEBUG "Fb FES Time: %04x ", tfestfb); bcm_format_hex(hexbuf, rtspfb, sizeof(txh->RTSPLCPFallback)); - printf("RTS PLCP: %s ", hexbuf); - printf("RTS DUR: %04x ", rtsdfb); + printk(KERN_DEBUG "RTS PLCP: %s ", hexbuf); + printk(KERN_DEBUG "RTS DUR: %04x ", rtsdfb); bcm_format_hex(hexbuf, fragpfb, sizeof(txh->FragPLCPFallback)); - printf("PLCP: %s ", hexbuf); - printf("DUR: %04x", fragdfb); - printf("\n"); + printk(KERN_DEBUG "PLCP: %s ", hexbuf); + printk(KERN_DEBUG "DUR: %04x", fragdfb); + printk(KERN_DEBUG "\n"); - printf("MModeLen: %04x ", mmodelen); - printf("MModeFbrLen: %04x\n", mmodefbrlen); + printk(KERN_DEBUG "MModeLen: %04x ", mmodelen); + printk(KERN_DEBUG "MModeFbrLen: %04x\n", mmodefbrlen); - printf("FrameID: %04x\n", tfid); - printf("TxStatus: %04x\n", txs); + printk(KERN_DEBUG "FrameID: %04x\n", tfid); + printk(KERN_DEBUG "TxStatus: %04x\n", txs); - printf("MaxNumMpdu: %04x\n", mnmpdu); - printf("MaxAggbyte: %04x\n", mabyte); - printf("MaxAggbyte_fb: %04x\n", mabyte_f); - printf("MinByte: %04x\n", mmbyte); + printk(KERN_DEBUG "MaxNumMpdu: %04x\n", mnmpdu); + printk(KERN_DEBUG "MaxAggbyte: %04x\n", mabyte); + printk(KERN_DEBUG "MaxAggbyte_fb: %04x\n", mabyte_f); + printk(KERN_DEBUG "MinByte: %04x\n", mmbyte); bcm_format_hex(hexbuf, rtsph, sizeof(txh->RTSPhyHeader)); - printf("RTS PLCP: %s ", hexbuf); + printk(KERN_DEBUG "RTS PLCP: %s ", hexbuf); bcm_format_hex(hexbuf, (u8 *) &rts, sizeof(txh->rts_frame)); - printf("RTS Frame: %s", hexbuf); - printf("\n"); - + printk(KERN_DEBUG "RTS Frame: %s", hexbuf); + printk(KERN_DEBUG "\n"); } #endif /* defined(BCMDBG) */ @@ -4960,13 +4962,14 @@ void wlc_print_rxh(d11rxhdr_t *rxh) snprintf(lenbuf, sizeof(lenbuf), "0x%x", len); - printf("RxFrameSize: %6s (%d)%s\n", lenbuf, len, + printk(KERN_DEBUG "RxFrameSize: %6s (%d)%s\n", lenbuf, len, (rxh->PhyRxStatus_0 & PRXS0_SHORTH) ? " short preamble" : ""); - printf("RxPHYStatus: %04x %04x %04x %04x\n", + printk(KERN_DEBUG "RxPHYStatus: %04x %04x %04x %04x\n", phystatus_0, phystatus_1, phystatus_2, phystatus_3); - printf("RxMACStatus: %x %s\n", macstatus1, flagstr); - printf("RXMACaggtype: %x\n", (macstatus2 & RXS_AGGTYPE_MASK)); - printf("RxTSFTime: %04x\n", rxh->RxTSFTime); + printk(KERN_DEBUG "RxMACStatus: %x %s\n", macstatus1, flagstr); + printk(KERN_DEBUG "RXMACaggtype: %x\n", + (macstatus2 & RXS_AGGTYPE_MASK)); + printk(KERN_DEBUG "RxTSFTime: %04x\n", rxh->RxTSFTime); } #endif /* defined(BCMDBG) */ diff --git a/drivers/staging/brcm80211/include/bcmsdh.h b/drivers/staging/brcm80211/include/bcmsdh.h index aa5f372d58cc..96c629267f14 100644 --- a/drivers/staging/brcm80211/include/bcmsdh.h +++ b/drivers/staging/brcm80211/include/bcmsdh.h @@ -23,8 +23,16 @@ extern const uint bcmsdh_msglevel; #ifdef BCMDBG -#define BCMSDH_ERROR(x) do { if ((bcmsdh_msglevel & BCMSDH_ERROR_VAL) && net_ratelimit()) printf x; } while (0) -#define BCMSDH_INFO(x) do { if ((bcmsdh_msglevel & BCMSDH_INFO_VAL) && net_ratelimit()) printf x; } while (0) +#define BCMSDH_ERROR(x) \ + do { \ + if ((bcmsdh_msglevel & BCMSDH_ERROR_VAL) && net_ratelimit()) \ + printk x; \ + } while (0) +#define BCMSDH_INFO(x) \ + do { \ + if ((bcmsdh_msglevel & BCMSDH_INFO_VAL) && net_ratelimit()) \ + printk x; \ + } while (0) #else /* BCMDBG */ #define BCMSDH_ERROR(x) #define BCMSDH_INFO(x) diff --git a/drivers/staging/brcm80211/include/osl.h b/drivers/staging/brcm80211/include/osl.h index b28235618d8b..919b12af0c81 100644 --- a/drivers/staging/brcm80211/include/osl.h +++ b/drivers/staging/brcm80211/include/osl.h @@ -106,7 +106,6 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size, #define PKTBUFSZ 2048 #define OSL_SYSUPTIME() ((u32)jiffies * (1000 / HZ)) -#define printf(fmt, args...) printk(fmt , ## args) #ifdef BRCM_FULLMAC #include /* for vsn/printf's */ #include /* for mem*, str* */ diff --git a/drivers/staging/brcm80211/include/siutils.h b/drivers/staging/brcm80211/include/siutils.h index 47b6a3090960..e681d40655b9 100644 --- a/drivers/staging/brcm80211/include/siutils.h +++ b/drivers/staging/brcm80211/include/siutils.h @@ -188,7 +188,7 @@ extern void si_sprom_init(si_t *sih); #define SI_ERROR(args) #ifdef BCMDBG -#define SI_MSG(args) printf args +#define SI_MSG(args) printk args #else #define SI_MSG(args) #endif /* BCMDBG */ diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c index 258fd90d9152..35c1b6d6b50e 100644 --- a/drivers/staging/brcm80211/util/bcmutils.c +++ b/drivers/staging/brcm80211/util/bcmutils.c @@ -414,7 +414,7 @@ void prpkt(const char *msg, struct osl_info *osh, struct sk_buff *p0) struct sk_buff *p; if (msg && (msg[0] != '\0')) - printf("%s:\n", msg); + printk(KERN_DEBUG "%s:\n", msg); for (p = p0; p; p = p->next) prhex(NULL, p->data, p->len); @@ -865,7 +865,7 @@ void prhex(const char *msg, unsigned char *buf, uint nbytes) uint i; if (msg && (msg[0] != '\0')) - printf("%s:\n", msg); + printk(KERN_DEBUG "%s:\n", msg); p = line; for (i = 0; i < nbytes; i++) { @@ -881,7 +881,7 @@ void prhex(const char *msg, unsigned char *buf, uint nbytes) } if (i % 16 == 15) { - printf("%s\n", line); /* flush line */ + printk(KERN_DEBUG "%s\n", line); /* flush line */ p = line; len = sizeof(line); } @@ -889,7 +889,7 @@ void prhex(const char *msg, unsigned char *buf, uint nbytes) /* flush last partial line */ if (p != line) - printf("%s\n", line); + printk(KERN_DEBUG "%s\n", line); } char *bcm_chipname(uint chipid, char *buf, uint len) diff --git a/drivers/staging/brcm80211/util/hnddma.c b/drivers/staging/brcm80211/util/hnddma.c index 2fc916624807..47dceb302447 100644 --- a/drivers/staging/brcm80211/util/hnddma.c +++ b/drivers/staging/brcm80211/util/hnddma.c @@ -40,14 +40,14 @@ if (!(*di->msg_level & 1)) \ ; \ else \ - printf args; \ + printk args; \ } while (0) #define DMA_TRACE(args) \ do { \ if (!(*di->msg_level & 2)) \ ; \ else \ - printf args; \ + printk args; \ } while (0) #else #define DMA_ERROR(args) @@ -287,7 +287,7 @@ struct hnddma_pub *dma_attach(struct osl_info *osh, char *name, si_t *sih, di = kzalloc(sizeof(dma_info_t), GFP_ATOMIC); if (di == NULL) { #ifdef BCMDBG - printf("dma_attach: out of memory\n"); + printk(KERN_ERR "dma_attach: out of memory\n"); #endif return NULL; } diff --git a/drivers/staging/brcm80211/util/hndpmu.c b/drivers/staging/brcm80211/util/hndpmu.c index 2678d799f7fd..5240341cbad8 100644 --- a/drivers/staging/brcm80211/util/hndpmu.c +++ b/drivers/staging/brcm80211/util/hndpmu.c @@ -31,7 +31,7 @@ #define PMU_ERROR(args) #ifdef BCMDBG -#define PMU_MSG(args) printf args +#define PMU_MSG(args) printk args /* debug-only definitions */ /* #define BCMDBG_FORCEHT */ -- 2.20.1