brcm80211: Logging cleanups
Subsystems (3)
cover brcm80211: Logging cleanups
Joe Perches (8):
brcm80211: Use normal DEBUG define
brcmfmac: Convert printk(KERN_DEBUG to pr_debug
brcm80211: Add and use brcmX_dbg_dump_hex
brcmfmac: Remove useless #ifdef DEBUG
brcm80211: Convert printk(KERN_DEBUG to pr_debug
brcm80211: Use brcmu_dbg_hex_dump
brcm80211: Use pr_fmt and pr_<level>
brcmfmac: Trivial typo of "couldn" to "could" fix
drivers/net/wireless/brcm80211/Makefile | 2 +- drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 2 + .../net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 3 + drivers/net/wireless/brcm80211/brcmfmac/dhd.h | 4 +- drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c | 2 + .../net/wireless/brcm80211/brcmfmac/dhd_common.c | 17 +- drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h | 20 ++- .../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 6 +- drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 216 ++++++++------------ .../net/wireless/brcm80211/brcmfmac/sdio_chip.c | 2 + .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 6 +- .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.h | 36 ++-- drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 4 +- drivers/net/wireless/brcm80211/brcmsmac/ampdu.c | 2 +- drivers/net/wireless/brcm80211/brcmsmac/dma.c | 8 +- .../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 24 +- .../net/wireless/brcm80211/brcmsmac/mac80211_if.h | 2 +- drivers/net/wireless/brcm80211/brcmsmac/main.c | 194 ++++++++---------- drivers/net/wireless/brcm80211/brcmsmac/main.h | 6 +- .../net/wireless/brcm80211/brcmsmac/phy/phy_n.c | 5 +- drivers/net/wireless/brcm80211/brcmutil/utils.c | 26 ++- .../net/wireless/brcm80211/include/brcmu_utils.h | 15 ++- 22 files changed, 298 insertions(+), 304 deletions(-)
Signature · 6 lines
1.7.8.111.gad25c.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/8 brcm80211: Use normal DEBUG define
Current CONFIG_BRCMDBG flag when enabled does not
necessarily enable proper pr_debug output when
DEBUG is not also enabled.
Remove BCMDBG define and just use DEBUG instead.
--- drivers/net/wireless/brcm80211/Makefile | 2 +- drivers/net/wireless/brcm80211/brcmfmac/dhd.h | 4 +- .../net/wireless/brcm80211/brcmfmac/dhd_common.c | 10 +- drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h | 6 +- .../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 4 +- drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 86 ++++++++++---------- .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.h | 6 +- drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 4 +- drivers/net/wireless/brcm80211/brcmsmac/ampdu.c | 2 +- drivers/net/wireless/brcm80211/brcmsmac/dma.c | 8 +- .../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 18 ++-- .../net/wireless/brcm80211/brcmsmac/mac80211_if.h | 2 +- drivers/net/wireless/brcm80211/brcmsmac/main.c | 42 +++++----- drivers/net/wireless/brcm80211/brcmsmac/main.h | 2 +- drivers/net/wireless/brcm80211/brcmutil/utils.c | 4 +- .../net/wireless/brcm80211/include/brcmu_utils.h | 4 +- 16 files changed, 102 insertions(+), 102 deletions(-)
drivers/net/wireless/brcm80211/Makefile +1 -1
@@ -16,7 +16,7 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # common flags -subdir-ccflags-$(CONFIG_BRCMDBG) += -DBCMDBG +subdir-ccflags-$(CONFIG_BRCMDBG) += -DDEBUG obj-$(CONFIG_BRCMUTIL) += brcmutil/ obj-$(CONFIG_BRCMFMAC) += brcmfmac/
drivers/net/wireless/brcm80211/brcmfmac/dhd.h +2 -2
@@ -644,9 +644,9 @@ extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);extern int brcmf_proto_cdc_query_dcmd (struct brcmf_pub *drvr,int ifidx,uint cmd,void *buf,uint len); -#ifdef BCMDBG +#ifdef DEBUG extern int brcmf_write_to_file (struct brcmf_pub *drvr,const u8 *buf,int size); -#endif /* BCMDBG */ +#endif /* DEBUG */ extern int brcmf_ifname2idx (struct brcmf_pub *drvr,char *name); extern int brcmf_c_host_event(struct brcmf_pub *drvr, int *idx,
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +5 -5
@@ -38,7 +38,7 @@#define BRCMF_PKT_FILTER_PATTERN_FIXED_LEN \ offsetof(struct brcmf_pkt_filter_pattern_le, mask_and_pattern) -#ifdef BCMDBG +#ifdef DEBUG static const char brcmf_version[] ="Dongle Host Driver, version " BRCMF_VERSION_STR "\nCompiled on " __DATE__" at " __TIME__;
@@ -133,7 +133,7 @@ bool brcmf_c_prec_enq(struct device *dev, struct pktq *q,return p !=NULL ; } -#ifdef BCMDBG +#ifdef DEBUG static void brcmf_c_show_host_event (struct brcmf_event_msg *event,void *event_data) {
@@ -430,7 +430,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data) brcmf_dbg(EVENT, "\n"); } } -#endif /* BCMDBG */ +#endif /* DEBUG */ int brcmf_c_host_event(struct brcmf_pub *drvr, int *ifidx, void *pktdata,
@@ -518,9 +518,9 @@ brcmf_c_host_event(struct brcmf_pub *drvr, int *ifidx, void *pktdata,break ; } -#ifdef BCMDBG +#ifdef DEBUG brcmf_c_show_host_event (event, event_data); -#endif /* BCMDBG */ +#endif /* DEBUG */ return 0 ; }
drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h +3 -3
@@ -32,7 +32,7 @@#define BRCMF_BTA_VAL 0x1000#define BRCMF_ISCAN_VAL 0x2000 -#if defined(BCMDBG ) +#if defined(DEBUG )#define brcmf_dbg (level, fmt, ...) \ do { \
@@ -56,7 +56,7 @@ do { \#define BRCMF_BYTES_ON () (brcmf_msg_level & BRCMF_BYTES_VAL)#define BRCMF_GLOM_ON () (brcmf_msg_level & BRCMF_GLOM_VAL) -#else /* (defined BCMDBG) || (defined BCMDBG) */ +#else /* (defined DEBUG) || (defined DEBUG) */ #define brcmf_dbg (level, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
@@ -66,7 +66,7 @@ do { \#define BRCMF_BYTES_ON () 0#define BRCMF_GLOM_ON () 0 -#endif /* defined(BCMDBG) */ +#endif /* defined(DEBUG) */ extern int brcmf_msg_level;
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +2 -2
@@ -1146,7 +1146,7 @@ int brcmf_netdev_wait_pend8021x(struct net_device *ndev)return pend; } -#ifdef BCMDBG +#ifdef DEBUG int brcmf_write_to_file (struct brcmf_pub *drvr,const u8 *buf,int size) {int ret =0 ;
@@ -1180,4 +1180,4 @@ exit: return ret; } -#endif /* BCMDBG */ +#endif /* DEBUG */
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +43 -43
311 lines not on this page · raw message
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h +3 -3
@@ -42,7 +42,7 @@ do { \ } \ } while (0) -#if (definedBCMDBG ) +#if (definedDEBUG ) #define WL_INFO(fmt, args...) \ do { \ if (brcmf_dbg_level & WL_DBG_INFO) { \
@@ -83,12 +83,12 @@ do { \ } \ } while (0) -#else /* (defined BCMDBG) */ +#else /* (defined DEBUG) */ #define WL_INFO(fmt, args...) #define WL_TRACE(fmt, args...) #define WL_SCAN(fmt, args...) #define WL_CONN(fmt, args...) -#endif /* (defined BCMDBG) */ +#endif /* (defined DEBUG) */ #define WL_NUM_SCAN_MAX 1#define WL_NUM_PMKIDS_MAX MAXPMKID/* will be used
drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +2 -2
@@ -326,11 +326,11 @@#define PCI_FORCEHT (sih) (PCIE(sih) && (ai_get_chip_id(sih) == BCM4716_CHIP_ID)) -#ifdef BCMDBG +#ifdef DEBUG #define SI_MSG (fmt, ...) pr_debug(fmt, ##__VA_ARGS__)#else #define SI_MSG (fmt, ...) no_printk(fmt, ##__VA_ARGS__) -#endif /* BCMDBG */ +#endif /* DEBUG */ #define GOODCOREADDR (x, b) \ (((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
drivers/net/wireless/brcm80211/brcmsmac/ampdu.c +1 -1
@@ -915,7 +915,7 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,struct ieee80211_tx_info *tx_info =IEEE80211_SKB_CB (p);struct wiphy *wiphy = wlc->wiphy; -#ifdef BCMDBG +#ifdef DEBUG u8 hole[AMPDU_MAX_MPDU ];memset (hole,0 ,sizeof (hole));#endif
drivers/net/wireless/brcm80211/brcmsmac/dma.c +4 -4
@@ -177,7 +177,7 @@#define BCMEXTRAHDROOM 172/* debug/trace */ -#ifdef BCMDBG +#ifdef DEBUG #define DMA_ERROR (fmt, ...) \ do { \ if (*di->msg_level & 1) \
@@ -193,7 +193,7 @@ do { \ no_printk(fmt, ##__VA_ARGS__)#define DMA_TRACE (fmt, ...) \ no_printk(fmt, ##__VA_ARGS__) -#endif /* BCMDBG */ +#endif /* DEBUG */ #define DMA_NONE (fmt, ...) \ no_printk(fmt, ##__VA_ARGS__)
@@ -968,7 +968,7 @@ int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list) pktcnt++; } -#ifdef BCMDBG +#ifdef DEBUG if (resid >0 ) {uint cur; cur =
@@ -979,7 +979,7 @@ int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list)DMA_ERROR ("rxin %d rxout %d, hw_curr %d\n" , di->rxin, di->rxout, cur); } -#endif /* BCMDBG */ +#endif /* DEBUG */ if ((di->dma.dmactrlflags &DMA_CTRL_RXMULTI ) ==0 ) { DMA_ERROR("%s: bad frame length (%d)\n",
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +9 -9
@@ -96,10 +96,10 @@ static struct bcma_device_id brcms_coreid_table[] = { };MODULE_DEVICE_TABLE (bcma, brcms_coreid_table); -#ifdef BCMDBG +#ifdef DEBUG static int msglevel =0xdeadbeef ;module_param (msglevel, int,0 ); -#endif /* BCMDBG */ +#endif /* DEBUG */ static struct ieee80211_channel brcms_2ghz_chantable[] = {CHAN2GHZ (1 ,2412 ,IEEE80211_CHAN_NO_HT40MINUS ),
@@ -857,7 +857,7 @@ static void brcms_free(struct brcms_info *wl)/* free timers */ for (t = wl->timers; t; t = next) { next = t->next; -#ifdef BCMDBG +#ifdef DEBUG kfree (t->name);#endif kfree (t);
@@ -1209,10 +1209,10 @@ static int __init brcms_module_init(void) {int error = -ENODEV ; -#ifdef BCMDBG +#ifdef DEBUG if (msglevel !=0xdeadbeef ) brcm_msg_level = msglevel; -#endif /* BCMDBG */ +#endif /* DEBUG */ error =bcma_driver_register (&brcms_bcma_driver);printk (KERN_ERR "%s: register returned %d\n" , __func__, error);
@@ -1399,7 +1399,7 @@ struct brcms_timer *brcms_init_timer(struct brcms_info *wl, t->next = wl->timers; wl->timers = t; -#ifdef BCMDBG +#ifdef DEBUG t->name =kmalloc (strlen (name) +1 ,GFP_ATOMIC );if (t->name)strcpy (t->name, name);
@@ -1418,7 +1418,7 @@ void brcms_add_timer(struct brcms_timer *t, uint ms, int periodic) {struct ieee80211_hw *hw = t->wl->pub->ieee_hw; -#ifdef BCMDBG +#ifdef DEBUG if (t->set)wiphy_err (hw->wiphy,"%s: Already set. Name: %s, per %d\n" , __func__, t->name, periodic);
@@ -1463,7 +1463,7 @@ void brcms_free_timer(struct brcms_timer *t)if (wl->timers == t) { wl->timers = wl->timers->next; -#ifdef BCMDBG +#ifdef DEBUG kfree (t->name);#endif kfree (t);
@@ -1475,7 +1475,7 @@ void brcms_free_timer(struct brcms_timer *t)while (tmp) {if (tmp->next == t) { tmp->next = t->next; -#ifdef BCMDBG +#ifdef DEBUG kfree (t->name);#endif kfree (t);
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h +1 -1
@@ -40,7 +40,7 @@ struct brcms_timer {bool periodic;bool set;/* indicates if timer is active */ struct brcms_timer *next;/* for freeing on unload */ -#ifdef BCMDBG +#ifdef DEBUG char *name;/* Description of the timer */ #endif };
drivers/net/wireless/brcm80211/brcmsmac/main.c +21 -21
147 lines not on this page · raw message
drivers/net/wireless/brcm80211/brcmsmac/main.h +1 -1
@@ -648,7 +648,7 @@ extern void brcms_c_print_txstatus(struct tx_status *txs);extern int brcms_b_xmtfifo_sz_get (struct brcms_hardware *wlc_hw,uint fifo,uint *blocks); -#if defined(BCMDBG ) +#if defined(DEBUG )extern void brcms_c_print_txdesc (struct d11txh *txh);#else #define brcms_c_print_txdesc (a)
drivers/net/wireless/brcm80211/brcmutil/utils.c +2 -2
@@ -240,7 +240,7 @@ struct sk_buff *brcmu_pktq_mdeq(struct pktq *pq, uint prec_bmp, }EXPORT_SYMBOL (brcmu_pktq_mdeq); -#if defined(BCMDBG ) +#if defined(DEBUG )/* pretty hex print a pkt buffer chain */ void brcmu_prpkt (const char *msg,struct sk_buff *p0) {
@@ -253,4 +253,4 @@ void brcmu_prpkt(const char *msg, struct sk_buff *p0) print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, p->data, p->len); }EXPORT_SYMBOL (brcmu_prpkt); -#endif /* defined(BCMDBG) */ +#endif /* defined(DEBUG) */
drivers/net/wireless/brcm80211/include/brcmu_utils.h +2 -2
@@ -176,10 +176,10 @@ struct ipv4_addr;/* externs */ /* format/print */ -#ifdef BCMDBG +#ifdef DEBUG extern void brcmu_prpkt (const char *msg,struct sk_buff *p0);#else #define brcmu_prpkt (a, b) -#endif /* BCMDBG */ +#endif /* DEBUG */ #endif /* _BRCMU_UTILS_H_ */
Signature · 6 lines
1.7.8.111.gad25c.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 2/8 brcmfmac: Convert printk(KERN_DEBUG to pr_debug
In reply to Joe PerchesAllow dynamic debugging.
--- drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h +4 -4
@@ -39,13 +39,13 @@ do { \ if (BRCMF_ERROR_VAL == BRCMF_##level##_VAL) { \ if (brcmf_msg_level & BRCMF_##level##_VAL) { \ if (net_ratelimit()) \ - printk(KERN_DEBUG "%s: " fmt, \ - __func__, ##__VA_ARGS__); \ + pr_debug("%s: " fmt, \ + __func__, ##__VA_ARGS__); \ } \ } else { \ if (brcmf_msg_level & BRCMF_##level##_VAL) { \ - printk(KERN_DEBUG "%s: " fmt, \ - __func__, ##__VA_ARGS__); \ + pr_debug("%s: " fmt, \ + __func__, ##__VA_ARGS__); \ } \ } \ } while (0)
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 3/8 brcm80211: Add and use brcmX_dbg_dump_hex
In reply to Joe PerchesReduce the number of #ifdef DEBUG uses by
adding a dbg_hex_dump routine which has the
appropriate #ifdef DEBUG test.
--- drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h | 6 + drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 141 +++++++------------- drivers/net/wireless/brcm80211/brcmutil/utils.c | 18 +++ .../net/wireless/brcm80211/include/brcmu_utils.h | 11 ++ 4 files changed, 84 insertions(+), 92 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h +6 -0
@@ -68,6 +68,12 @@ do { \#endif /* defined(DEBUG) */ +#define brcmf_dbg_hex_dump (test, data, len, fmt, ...) \ +do { \ + if (test) \ + brcmu_dbg_hex_dump(data, len, fmt, ##__VA_ARGS__); \ +} while (0) +extern int brcmf_msg_level;#endif /* _BRCMF_DBG_H_ */
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +49 -92
207 lines not on this page · raw message
drivers/net/wireless/brcm80211/brcmutil/utils.c +18 -0
@@ -253,4 +253,22 @@ void brcmu_prpkt(const char *msg, struct sk_buff *p0) print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, p->data, p->len); }EXPORT_SYMBOL (brcmu_prpkt); + +void brcmu_dbg_hex_dump (const void *data,size_t size,const char *fmt, ...) +{ +struct va_format vaf; +va_list args; + +va_start (args, fmt); + + vaf.fmt = fmt; + vaf.va = &args; + +pr_debug ("%pV" , &vaf); + +va_end (args); + +print_hex_dump_bytes ("" ,DUMP_PREFIX_OFFSET , data, size); +} +EXPORT_SYMBOL (brcmu_dbg_hex_dump);#endif /* defined(DEBUG) */
drivers/net/wireless/brcm80211/include/brcmu_utils.h +11 -0
@@ -182,4 +182,15 @@ extern void brcmu_prpkt(const char *msg, struct sk_buff *p0);#define brcmu_prpkt (a, b)#endif /* DEBUG */ +#ifdef DEBUG +extern __printf(3, 4) +void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...); +#else +__printf(3, 4) +static inline +void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...) +{ +} +#endif +#endif /* _BRCMU_UTILS_H_ */
Signature · 1 line
1.7.8.111.gad25c.dirty
Re: [PATCH 3/8] brcm80211: Add and use brcmX_dbg_dump_hex
drivers/net/wireless/brcm80211/include/brcmu_utils.h extern void brcmu_prpkt(const char *msg, struct sk_buff *p0); · line 186
Quoted 2 lines · Joe Perches
drivers/net/wireless/brcm80211/include/brcmu_utils.h +2
-0+#ifdef DEBUG +extern __printf(3, 4)
Just curious if I can learn something here. What does the __printf(3, 4) do?
drivers/net/wireless/brcm80211/include/brcmu_utils.h extern void brcmu_prpkt(const char *msg, struct sk_buff *p0); · line 196
Quoted 10 lines
drivers/net/wireless/brcm80211/include/brcmu_utils.h +9
-0+void brcmu_dbg_hex_dump (const void *data,size_t size,const char *fmt, ...); +#else +__printf(3, 4) +static inline +void brcmu_dbg_hex_dump (const void *data,size_t size,const char *fmt, ...) +{ +} +#endif +#endif /* _BRCMU_UTILS_H_ */
Gr. AvS
Re: [PATCH 3/8] brcm80211: Add and use brcmX_dbg_dump_hex
Quoted 6 lines · Arend van Spriel
drivers/net/wireless/brcm80211/include/brcmu_utils.h extern void brcmu_prpkt(const char *msg, struct sk_buff *p0); · line 186
Quoted 2 lines · Joe Perches
drivers/net/wireless/brcm80211/include/brcmu_utils.h +2
-0+#ifdef DEBUG +extern __printf(3, 4)Just curious if I can learn something here. What does the
__printf(3, 4)do?
It's a #define for gcc __attribute__((format (printf, ...))) It makes gcc validate the printf format and arguments.
PATCH 4/8 brcmfmac: Remove useless #ifdef DEBUG
In reply to Joe PerchesThis doesn't do anything anymore.
--- drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +0 -2
@@ -2039,13 +2039,11 @@ deliver:down (&bus->sdsem); } rxcount = maxframes - rxleft; -#ifdef DEBUG /* Message if we hit the limit */ if (!rxleft)brcmf_dbg (DATA ,"hit rx limit of %d frames\n" , maxframes);else -#endif /* DEBUG */ brcmf_dbg (DATA ,"processed %d frames\n" , rxcount);/* Back off rxseq if awaiting rtx, update rx_seq */ if (bus->rxskip)
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 5/8 brcm80211: Convert printk(KERN_DEBUG to pr_debug
In reply to Joe PerchesUse pr_debug to allow dynamic debugging to work.
Move an #endif to allow brcmf_dbg_hex_dump to be outside the #if/#endif block.
Move a const char* declaration to be inside a pr_debug so the function doesn't need a #if/#endif block.
Don't use temporaries in debugging functions so the code can be optimized away.
--- .../net/wireless/brcm80211/brcmfmac/dhd_common.c | 4 +- drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 11 +- drivers/net/wireless/brcm80211/brcmsmac/main.c | 147 +++++++++----------- drivers/net/wireless/brcm80211/brcmsmac/main.h | 4 +- .../net/wireless/brcm80211/brcmsmac/phy/phy_n.c | 3 +- drivers/net/wireless/brcm80211/brcmutil/utils.c | 2 +- 6 files changed, 78 insertions(+), 93 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +2 -2
@@ -399,10 +399,10 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data) p = (char *)&buf[sizeof (struct msgtrace_hdr )];while ((s =strstr (p,"\n" )) !=NULL ) { *s ='\0' ; -printk (KERN_DEBUG "%s\n" , p); +pr_debug ("%s\n" , p); p = s +1 ; } -printk (KERN_DEBUG "%s\n" , p); +pr_debug ("%s\n" , p);/* Reset datalen to avoid display below */ datalen =0 ;
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +4 -7
@@ -2137,6 +2137,7 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,#ifdef DEBUG tx_packets[pkt->priority]++; +#endif brcmf_dbg_hex_dump(BRCMF_BYTES_ON() && ((BRCMF_CTL_ON() && chan == SDPCM_CONTROL_CHANNEL) ||
@@ -2149,7 +2150,6 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt, chan != SDPCM_CONTROL_CHANNEL))) &&BRCMF_HDRS_ON (), frame, min_t(u16, len, 16), "TxHdr:\n"); -#endif /* Raise len to next SDIO block to eliminate tail command */ if (bus->roundup && bus->blocksize && (len > bus->blocksize)) {
@@ -2806,7 +2806,7 @@ static int brcmf_sdbrcm_readconsole(struct brcmf_sdio *bus)if (line[n -1 ] =='\r' ) n--; line[n] =0 ; -printk (KERN_DEBUG "CONSOLE: %s\n" , line); +pr_debug ("CONSOLE: %s\n" , line); } } break2:
@@ -3676,11 +3676,8 @@ brcmf_sdbrcm_probe_attach(struct brcmf_sdio *bus, u32 regsva)if (brcmf_sdcard_set_sbaddr_window (bus->sdiodev,SI_ENUM_BASE ))brcmf_dbg (ERROR ,"FAILED to return to SI_ENUM_BASE\n" ); -#ifdef DEBUG -printk (KERN_DEBUG "F1 signature read @0x18000000=0x%4x\n" , -brcmf_sdcard_reg_read (bus->sdiodev,SI_ENUM_BASE ,4 )); - -#endif /* DEBUG */ +pr_debug ("F1 signature read @0x18000000=0x%4x\n" , +brcmf_sdcard_reg_read (bus->sdiodev,SI_ENUM_BASE ,4 ));/* * Force PLL off until brcmf_sdio_chip_attach()
drivers/net/wireless/brcm80211/brcmsmac/main.c +67 -80
197 lines not on this page · raw message
drivers/net/wireless/brcm80211/brcmsmac/main.h +3 -1
@@ -651,7 +651,9 @@ extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,#if defined(DEBUG )extern void brcms_c_print_txdesc (struct d11txh *txh);#else -#define brcms_c_print_txdesc (a) +static inline void brcms_c_print_txdesc (struct d11txh *txh) +{ +}#endif extern int brcms_c_set_gmode (struct brcms_c_info *wlc,u8 gmode,bool config);
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +1 -2
@@ -26434,8 +26434,7 @@ cal_try: }if (bcmerror !=0 ) { -printk (KERN_DEBUG "%s: Failed, cnt = %d\n" , __func__, - cal_retry); +pr_debug ("%s: Failed, cnt = %d\n" , __func__, cal_retry);if (cal_retry <CAL_RETRY_CNT ) { cal_retry++;
drivers/net/wireless/brcm80211/brcmutil/utils.c +1 -1
@@ -247,7 +247,7 @@ void brcmu_prpkt(const char *msg, struct sk_buff *p0)struct sk_buff *p;if (msg && (msg[0 ] !='\0' )) -printk (KERN_DEBUG "%s:\n" , msg); +pr_debug ("%s:\n" , msg);for (p = p0; p; p = p->next)print_hex_dump_bytes ("" ,DUMP_PREFIX_OFFSET , p->data, p->len);
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 6/8 brcm80211: Use brcmu_dbg_hex_dump
In reply to Joe PerchesConvert a couple of pr_debug/print_hex_dump to
the standard utility.
--- drivers/net/wireless/brcm80211/brcmsmac/main.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
drivers/net/wireless/brcm80211/brcmsmac/main.c +3 -6
@@ -5858,9 +5858,8 @@ void brcms_c_print_txdesc(struct d11txh *txh)struct ieee80211_rts rts = txh->rts_frame;/* add plcp header along with txh descriptor */ -pr_debug ("Raw TxDesc + plcp header:\n" ); -print_hex_dump_bytes ("" ,DUMP_PREFIX_OFFSET , - txh,sizeof (struct d11txh ) +48 ); +brcmu_dbg_hex_dump (txh,sizeof (struct d11txh ) +48 , +"Raw TxDesc + plcp header:\n" );pr_debug ("TxCtlLow: %04x " , mtcl);pr_debug ("TxCtlHigh: %04x " , mtch);
@@ -5986,9 +5985,7 @@ void brcms_c_print_rxh(struct d11rxhdr *rxh) {0, NULL} }; -pr_debug ("Raw RxDesc:\n" ); -print_hex_dump_bytes ("" ,DUMP_PREFIX_OFFSET , rxh, -sizeof (struct d11rxhdr )); +brcmu_dbg_hex_dump (rxh,sizeof (struct d11rxhdr ),"Raw RxDesc:\n" );brcms_c_format_flags (macstat_flags, macstatus1, flagstr,64 );
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 7/8 brcm80211: Use pr_fmt and pr_<level>
In reply to Joe PerchesConvert printks to pr_<level>
Prefix logging with pr_fmt.
Use ##__VA_ARGS__ in some WL_ logging macros.
--- drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 2 + .../net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 3 ++ drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c | 2 + .../net/wireless/brcm80211/brcmfmac/dhd_common.c | 3 ++ .../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 2 + drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 8 ++-- .../net/wireless/brcm80211/brcmfmac/sdio_chip.c | 2 + .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 + .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.h | 30 ++++++++++---------- .../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 6 ++-- drivers/net/wireless/brcm80211/brcmsmac/main.c | 6 ++- .../net/wireless/brcm80211/brcmsmac/phy/phy_n.c | 2 + drivers/net/wireless/brcm80211/brcmutil/utils.c | 2 + 13 files changed, 46 insertions(+), 24 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +2 -0
@@ -15,6 +15,8 @@*/ /* ****************** SDIO CARD Interface Functions **************************/ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/types.h> #include <linux/netdevice.h> #include <linux/export.h>
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +3 -0
@@ -13,6 +13,9 @@* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/types.h> #include <linux/netdevice.h> #include <linux/mmc/sdio.h>
drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c +2 -0
@@ -19,6 +19,8 @@* For certain dcmd codes, the dongle interprets string data from the host. ******************************************************************************/ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/types.h> #include <linux/netdevice.h> #include <linux/sched.h>
drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +3 -0
@@ -13,6 +13,9 @@* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/string.h> #include <linux/sched.h>
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +2 -0
@@ -14,6 +14,8 @@* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/init.h> #include <linux/kernel.h> #include <linux/kthread.h>
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +4 -4
@@ -14,6 +14,8 @@* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/types.h> #include <linux/kernel.h> #include <linux/kthread.h>
@@ -3896,8 +3898,7 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev) bus->watchdog_tsk =kthread_run (brcmf_sdbrcm_watchdog_thread, bus,"brcmf_watchdog" );if (IS_ERR (bus->watchdog_tsk)) { -printk (KERN_WARNING -"brcmf_watchdog thread failed to start\n" ); +pr_warn ("brcmf_watchdog thread failed to start\n" ); bus->watchdog_tsk =NULL ; }/* Initialize DPC thread */
@@ -3905,8 +3906,7 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev) bus->dpc_tsk =kthread_run (brcmf_sdbrcm_dpc_thread, bus,"brcmf_dpc" );if (IS_ERR (bus->dpc_tsk)) { -printk (KERN_WARNING -"brcmf_dpc thread failed to start\n" ); +pr_warn ("brcmf_dpc thread failed to start\n" ); bus->dpc_tsk =NULL ; }
drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c +2 -0
@@ -15,6 +15,8 @@*/ /* ***** SDIO interface chip backplane handle functions ***** */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/types.h> #include <linux/netdevice.h> #include <linux/mmc/card.h>
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +2 -0
@@ -16,6 +16,8 @@/* Toplevel file. Relies on dhd_linux.c to send commands to the dongle. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/if_arp.h> #include <linux/sched.h>
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h +15 -15
@@ -32,53 +32,53 @@ struct brcmf_cfg80211_ibss;#define WL_DBG_MASK ((WL_DBG_INFO | WL_DBG_ERR | WL_DBG_TRACE) | \ (WL_DBG_SCAN) | (WL_DBG_CONN)) -#define WL_ERR(fmt, args...) \ +#define WL_ERR (fmt, ...) \ do { \ if (brcmf_dbg_level & WL_DBG_ERR) { \ if (net_ratelimit()) { \ - printk(KERN_ERR "ERROR @%s : " fmt, \ - __func__, ##args); \ + pr_err("ERROR @%s : " fmt, \ + __func__, ##__VA_ARGS__); \ } \ } \ } while (0)#if (definedDEBUG ) -#define WL_INFO(fmt, args...) \ +#define WL_INFO (fmt, ...) \ do { \ if (brcmf_dbg_level & WL_DBG_INFO) { \ if (net_ratelimit()) { \ - printk(KERN_ERR "INFO @%s : " fmt, \ - __func__, ##args); \ + pr_err("INFO @%s : " fmt, \ + __func__, ##__VA_ARGS__); \ } \ } \ } while (0) -#define WL_TRACE(fmt, args...) \ +#define WL_TRACE (fmt, ...) \ do { \ if (brcmf_dbg_level & WL_DBG_TRACE) { \ if (net_ratelimit()) { \ - printk(KERN_ERR "TRACE @%s : " fmt, \ - __func__, ##args); \ + pr_err("TRACE @%s : " fmt, \ + __func__, ##__VA_ARGS__); \ } \ } \ } while (0) -#define WL_SCAN(fmt, args...) \ +#define WL_SCAN (fmt, ...) \ do { \ if (brcmf_dbg_level & WL_DBG_SCAN) { \ if (net_ratelimit()) { \ - printk(KERN_ERR "SCAN @%s : " fmt, \ - __func__, ##args); \ + pr_err("SCAN @%s : " fmt, \ + __func__, ##__VA_ARGS__); \ } \ } \ } while (0) -#define WL_CONN(fmt, args...) \ +#define WL_CONN (fmt, ...) \ do { \ if (brcmf_dbg_level & WL_DBG_CONN) { \ if (net_ratelimit()) { \ - printk(KERN_ERR "CONN @%s : " fmt, \ - __func__, ##args); \ + pr_err("CONN @%s : " fmt, \ + __func__, ##__VA_ARGS__); \ } \ } \ } while (0)
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +3 -3
@@ -15,6 +15,7 @@*/ #define __UNDEF_NO_VERSION__ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt#include <linux/etherdevice.h> #include <linux/sched.h>
@@ -1121,8 +1122,7 @@ static int __devinit brcms_bcma_probe(struct bcma_device *pdev) wl =brcms_attach (pdev);if (!wl) { -pr_err ("%s: %s: brcms_attach failed!\n" ,KBUILD_MODNAME , - __func__); +pr_err ("%s: brcms_attach failed!\n" , __func__);return -ENODEV ; }return 0 ;
@@ -1215,7 +1215,7 @@ static int __init brcms_module_init(void)#endif /* DEBUG */ error =bcma_driver_register (&brcms_bcma_driver); -printk (KERN_ERR "%s: register returned %d\n" , __func__, error); +pr_err ("%s: register returned %d\n" , __func__, error);if (!error)return 0 ;
drivers/net/wireless/brcm80211/brcmsmac/main.c +4 -2
@@ -14,6 +14,8 @@* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/pci_ids.h> #include <linux/if_ether.h> #include <net/mac80211.h>
@@ -5807,7 +5809,7 @@ void brcms_c_print_txstatus(struct tx_status *txs)bool brcms_c_chipmatch (u16 vendor,u16 device) {if (vendor !=PCI_VENDOR_ID_BROADCOM ) { -pr_err ("chipmatch: unknown vendor id %04x\n" , vendor); +pr_err ("unknown vendor id %04x\n" , vendor);return false; }
@@ -5820,7 +5822,7 @@ bool brcms_c_chipmatch(u16 vendor, u16 device)if ((device ==BCM43236_D11N_ID ) || (device ==BCM43236_D11N2G_ID ))return true; -pr_err ("chipmatch: unknown device id %04x\n" , device); +pr_err ("unknown device id %04x\n" , device);return false; }
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +2 -0
@@ -14,6 +14,8 @@* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/kernel.h> #include <linux/delay.h> #include <linux/cordic.h>
drivers/net/wireless/brcm80211/brcmutil/utils.c +2 -0
@@ -14,6 +14,8 @@* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/netdevice.h> #include <linux/module.h>
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 8/8 brcmfmac: Trivial typo of "couldn" to "could" fix
In reply to Joe Perches--- .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +2 -2
@@ -2785,7 +2785,7 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,wiphy_new (&wl_cfg80211_ops,sizeof (struct brcmf_cfg80211_priv ) + sizeof_iface);if (!wdev->wiphy) { -WL_ERR ("Couldn not allocate wiphy device\n" ); +WL_ERR ("Could not allocate wiphy device\n" ); err = -ENOMEM ; goto wiphy_new_out; }
@@ -2811,7 +2811,7 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,*/ err =wiphy_register (wdev->wiphy);if (err <0 ) { -WL_ERR ("Couldn not register wiphy device (%d)\n" , err); +WL_ERR ("Could not register wiphy device (%d)\n" , err); goto wiphy_register_out; }return wdev;
Signature · 1 line
1.7.8.111.gad25c.dirty