]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: brcm80211: remove usage of printf (macro) from driver
authorArend van Spriel <arend@broadcom.com>
Thu, 10 Feb 2011 11:03:44 +0000 (12:03 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Feb 2011 20:47:41 +0000 (12:47 -0800)
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 <rvossen@broadcom.com>
Reviewed-by: Brett Rudley <brudley@broadcom.com>
Reviewed-by: Henry Ptasinski <henryp@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 files changed:
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
drivers/staging/brcm80211/brcmfmac/dhd_common.c
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
drivers/staging/brcm80211/brcmfmac/dhd_linux.c
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
drivers/staging/brcm80211/brcmfmac/wl_iw.c
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
drivers/staging/brcm80211/brcmsmac/wlc_channel.c
drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c
drivers/staging/brcm80211/include/bcmsdh.h
drivers/staging/brcm80211/include/osl.h
drivers/staging/brcm80211/include/siutils.h
drivers/staging/brcm80211/util/bcmutils.c
drivers/staging/brcm80211/util/hnddma.c
drivers/staging/brcm80211/util/hndpmu.c

index 143e8604a5964b57993efe8b5fb9e1c4928fbc21..deb5f46542aed815757cf9f039cb615312de64f0 100644 (file)
@@ -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 */
index 4d671ddb3af16eb31534f68ac812fe40b410a651..50470f6c92fa50f9f5b3d703d69d717f88dc34c5 100644 (file)
 #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)
index eeabbc3334d4ab5230c1636ecfd354966940b9bb..ad4a00871d851bfc42184f877d328aa56e09592b 100644 (file)
@@ -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;
index cd2578ad35520b6d0e0956a1bdcf6c6d43fbdc70..0817f1348e09957c0e9d5ffae06a55db189d30aa 100644 (file)
 
 #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)
index 7100d815163c23e805ae91c20872d9035a03f20c..2426a616807e507bd7967166a3bc120ca47f9d94 100644 (file)
@@ -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;
        }
index 383416d5a75024ff03d55c6c85872daef809f19b..159c45928e74b1503c7e1b091c052458bf40ecb6 100644 (file)
@@ -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 */
index f4b1b4ecab8279b2781547faf3769d763b9c8410..1dbc94a98a47d65243b0ce9b63bc3b1f9392e28e 100644 (file)
@@ -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 */
index ce115f29d79ab871a9e451982864cf30cbe00a6a..c1d66995bdcbbac7b77d777c18fc810dcbf36d01 100644 (file)
@@ -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;
                }
index 2e30d92230526b5f8d6caf2829f68bbac5ad1d96..06b31a0364f41ea62e1598a9e5c7172308579b71 100644 (file)
@@ -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]);
 }
index 1909bdf556c0f8fa5106920ce028207f20d35a16..5a6a016141169867968121ed0b27c6f8c11dd43e 100644 (file)
@@ -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) */
 
index aa5f372d58ccc568a4688604676719da40a16ba0..96c629267f14d7cb96f942a67d51593f56ae4311 100644 (file)
 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)
index b28235618d8b9e7599bb691f8802b0007769590e..919b12af0c81fdc2f10e3e15ca58acb4d7654f88 100644 (file)
@@ -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 <linux/kernel.h>      /* for vsn/printf's */
 #include <linux/string.h>      /* for mem*, str* */
index 47b6a3090960a48b8b382c43828dc45cd73799ba..e681d40655b9840637021a9b49ca65b0765083cc 100644 (file)
@@ -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 */
index 258fd90d915264dd4b9c947db9028b5b1a781b0c..35c1b6d6b50efa393fba20fdafce579b9465a7c4 100644 (file)
@@ -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)
index 2fc91662480740742b31356495f430b1508cd1ac..47dceb30244737896e35f21fd232cdeb722aa1f7 100644 (file)
                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;
        }
index 2678d799f7fd9cf725042b186516fab9ce92a319..5240341cbad8b0e99ae541ea3eed99166c513bc7 100644 (file)
@@ -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 */