ath6kl: add prefix parameter to ath6kl_dbg_dump()
PATCH 1/4 ath6kl: add prefix parameter to ath6kl_dbg_dump()
Makes it easier to recognise longs dumps.
Obligatory screenshot using "rx" prefix:
ath6kl: ath6kl_rx
rx 00000000: 10 10 00 00 00 00 08 30 00 00 00 00 00 00 f9 0b .......0........ rx 00000010: 2c 44 08 30 00 00 f9 0b 0c a4 02 00 00 00 73 d2 ,D.0..........s. rx 00000020: 94 00 f9 0b 04 8c 01 00 02 00 07 02 02 00 f9 0b ................
--- drivers/net/wireless/ath/ath6kl/debug.h | 14 ++++++++------ drivers/net/wireless/ath/ath6kl/htc.c | 27 ++++++++++++++------------- drivers/net/wireless/ath/ath6kl/txrx.c | 6 ++++-- drivers/net/wireless/ath/ath6kl/wmi.c | 3 ++- 4 files changed, 28 insertions(+), 22 deletions(-)
drivers/net/wireless/ath/ath6kl/debug.h +8 -6
@@ -65,12 +65,14 @@ extern int ath6kl_printk(const char *level, const char *fmt, ...) })static inline void ath6kl_dbg_dump (enum ATH6K_DEBUG_MASK mask, -const char *msg,const void *buf, -size_t len) +const char *msg,const char *prefix, +const void *buf,size_t len) {if (debug_mask & mask) { -ath6kl_dbg (mask,"%s\n" , msg); -print_hex_dump_bytes ("" ,DUMP_PREFIX_OFFSET , buf, len); +if (msg) +ath6kl_dbg (mask,"%s\n" , msg); + +print_hex_dump_bytes (prefix,DUMP_PREFIX_OFFSET , buf, len); } }
@@ -90,8 +92,8 @@ static inline int ath6kl_dbg(enum ATH6K_DEBUG_MASK dbg_mask, }static inline void ath6kl_dbg_dump (enum ATH6K_DEBUG_MASK mask, -const char *msg,const void *buf, -size_t len) +const char *msg,const char *prefix, +const void *buf,size_t len) { }
drivers/net/wireless/ath/ath6kl/htc.c +14 -13
@@ -1192,9 +1192,9 @@ static void htc_ctrl_rx(struct htc_target *context, struct htc_packet *packets) packets->act_len + HTC_HDR_LENGTH);ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES , -"Unexpected ENDPOINT 0 Message" , - packets->buf -HTC_HDR_LENGTH , - packets->act_len +HTC_HDR_LENGTH ); +"Unexpected ENDPOINT 0 Message" ,"" , + packets->buf -HTC_HDR_LENGTH , + packets->act_len +HTC_HDR_LENGTH ); }htc_reclaim_rxbuf (context, packets, &context->endpoint[0 ]);
@@ -1328,7 +1328,7 @@ static int htc_parse_trailer(struct htc_target *target,memcpy ((u8 *)&next_lk_ahds[0 ], lk_ahd->lk_ahd,4 );ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"Next Look Ahead" , - next_lk_ahds,4 ); +"" , next_lk_ahds,4 ); *n_lk_ahds =1 ; }
@@ -1347,7 +1347,7 @@ static int htc_parse_trailer(struct htc_target *target, (struct htc_bundle_lkahd_rpt *) record_buf;ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"Bundle lk_ahd" , - record_buf, record->len); +"" , record_buf, record->len);for (i =0 ; i < len; i++) { memcpy((u8 *)&next_lk_ahds[i],
@@ -1380,7 +1380,8 @@ static int htc_proc_trailer(struct htc_target *target,ath6kl_dbg (ATH6KL_DBG_HTC_RECV ,"+htc_proc_trailer (len:%d)\n" , len); -ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"Recv Trailer" , buf, len); +ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"Recv Trailer" ,"" , + buf, len); orig_buf = buf; orig_len = len;
@@ -1418,7 +1419,7 @@ static int htc_proc_trailer(struct htc_target *target,if (status)ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"BAD Recv Trailer" , - orig_buf, orig_len); +"" , orig_buf, orig_len);return status; }
@@ -1435,8 +1436,8 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,if (n_lkahds !=NULL ) *n_lkahds =0 ; -ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"HTC Recv PKT" , packet->buf, - packet->act_len); +ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"HTC Recv PKT" ,"htc " , + packet->buf, packet->act_len);/* * NOTE: we cannot assume the alignment of buf, so we use the safe
@@ -1480,9 +1481,9 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,ath6kl_err ("%s(): lk_ahd mismatch! (pPkt:0x%p flags:0x%X)\n" , __func__, packet, packet->info.rx.rx_flags);ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"Expected Message lk_ahd" , - &packet->info.rx.exp_hdr,4 ); +"" , &packet->info.rx.exp_hdr,4 );ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"Current Frame Header" , - (u8 *)&lk_ahd,sizeof (lk_ahd)); +"" , (u8 *)&lk_ahd,sizeof (lk_ahd)); status = -ENOMEM ; goto fail_rx; }
@@ -1518,12 +1519,12 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target, fail_rx:if (status)ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"BAD HTC Recv PKT" , - packet->buf, +"" , packet->buf, packet->act_len <256 ? packet->act_len :256 );else {if (packet->act_len >0 )ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES , -"HTC - Application Msg" , +"HTC - Application Msg" ,"" , packet->buf, packet->act_len); }
drivers/net/wireless/ath/ath6kl/txrx.c +4 -2
@@ -322,7 +322,8 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)set_htc_pkt_info (&cookie->htc_pkt, cookie, skb->data, skb->len, eid, htc_tag); -ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES , __func__, skb->data, skb->len); +ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES , __func__,"tx " , + skb->data, skb->len);/* * HTC interface is asynchronous, if this fails, cleanup will
@@ -1050,7 +1051,8 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)skb_put (skb, packet->act_len +HTC_HDR_LENGTH );skb_pull (skb,HTC_HDR_LENGTH ); -ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES , __func__, skb->data, skb->len); +ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES , __func__,"rx " , + skb->data, skb->len); skb->dev = ar->net_dev;
drivers/net/wireless/ath/ath6kl/wmi.c +2 -1
@@ -2850,7 +2850,8 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb) len = skb->len;ath6kl_dbg (ATH6KL_DBG_WMI ,"%s: wmi id: %d\n" , __func__, id); -ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"msg payload " , datap, len); +ath6kl_dbg_dump (ATH6KL_DBG_RAW_BYTES ,"msg payload " ,"wmi rx " , + datap, len);switch (id) {case WMI_GET_BITRATE_CMDID :
PATCH 2/4 ath6kl: add sdio debug messages
Add extensive debug messages to sdio.c. Makes it easier to debug various problems.
--- drivers/net/wireless/ath/ath6kl/debug.h | 2 ++ drivers/net/wireless/ath/ath6kl/sdio.c | 36 +++++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath6kl/debug.h +2 -0
@@ -36,6 +36,8 @@ enum ATH6K_DEBUG_MASK {ATH6KL_DBG_WLAN_CFG =BIT (13 ),/* cfg80211 i/f file tracing */ ATH6KL_DBG_RAW_BYTES =BIT (14 ),/* dump tx/rx and wmi frames */ ATH6KL_DBG_AGGR =BIT (15 ),/* aggregation */ +ATH6KL_DBG_SDIO =BIT (16 ), +ATH6KL_DBG_SDIO_DUMP =BIT (17 ), ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */ };
drivers/net/wireless/ath/ath6kl/sdio.c +27 -9
@@ -135,10 +135,12 @@ static int ath6kl_sdio_io(struct sdio_func *func, u32 request, u32 addr,int ret =0 ;if (request &HIF_WRITE ) { +/* FIXME: looks like ugly workaround for something */ if (addr >=HIF_MBOX_BASE_ADDR && addr <=HIF_MBOX_END_ADDR ) addr += (HIF_MBOX_WIDTH - len); +/* FIXME: this also looks like ugly workaround */ if (addr ==HIF_MBOX0_EXT_BASE_ADDR ) addr +=HIF_MBOX0_EXT_WIDTH - len;
@@ -153,6 +155,11 @@ static int ath6kl_sdio_io(struct sdio_func *func, u32 request, u32 addr, ret =sdio_memcpy_fromio (func, buf, addr, len); } +ath6kl_dbg (ATH6KL_DBG_SDIO ,"%s addr 0x%x%s buf 0x%p len %d\n" , + request &HIF_WRITE ?"wr" :"rd" , addr, + request &HIF_FIXED_ADDRESS ?" (fixed)" :"" , buf, len); +ath6kl_dbg_dump (ATH6KL_DBG_SDIO_DUMP ,NULL ,"sdio " , buf, len); +return ret; }
@@ -173,7 +180,8 @@ static struct bus_request *ath6kl_sdio_alloc_busreq(struct ath6kl_sdio *ar_sdio)list_del (&bus_req->list);spin_unlock_irqrestore (&ar_sdio->lock, flag); -ath6kl_dbg (ATH6KL_DBG_TRC ,"%s: bus request 0x%p\n" , __func__, bus_req); +ath6kl_dbg (ATH6KL_DBG_SCATTER ,"%s: bus request 0x%p\n" , + __func__, bus_req);return bus_req; }
@@ -183,7 +191,8 @@ static void ath6kl_sdio_free_bus_req(struct ath6kl_sdio *ar_sdio, {unsigned long flag; -ath6kl_dbg (ATH6KL_DBG_TRC ,"%s: bus request 0x%p\n" , __func__, bus_req); +ath6kl_dbg (ATH6KL_DBG_SCATTER ,"%s: bus request 0x%p\n" , + __func__, bus_req);spin_lock_irqsave (&ar_sdio->lock, flag);list_add_tail (&bus_req->list, &ar_sdio->bus_req_freeq);
@@ -438,6 +447,8 @@ static void ath6kl_sdio_irq_handler(struct sdio_func *func)int status;struct ath6kl_sdio *ar_sdio; +ath6kl_dbg (ATH6KL_DBG_SDIO ,"irq\n" ); + ar_sdio =sdio_get_drvdata (func);atomic_set (&ar_sdio->irq_handling,1 );
@@ -675,7 +686,7 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar) MAX_SCATTER_REQUESTS, virt_scat);if (!ret) { -ath6kl_dbg (ATH6KL_DBG_ANY , +ath6kl_dbg (ATH6KL_DBG_SCATTER ,"hif-scatter enabled: max scatter req : %d entries: %d\n" ,MAX_SCATTER_REQUESTS ,MAX_SCATTER_ENTRIES_PER_REQ );
@@ -700,7 +711,7 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar)return ret; } -ath6kl_dbg (ATH6KL_DBG_ANY , +ath6kl_dbg (ATH6KL_DBG_SCATTER ,"Vitual scatter enabled, max_scat_req:%d, entries:%d\n" ,ATH6KL_SCATTER_REQS ,ATH6KL_SCATTER_ENTRIES_PER_REQ );
@@ -723,6 +734,9 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar)if (!(flags &MMC_PM_KEEP_POWER ))/* as host doesn't support keep power we need to bail out */ +ath6kl_dbg (ATH6KL_DBG_SDIO , +"func %d doesn't support MMC_PM_KEEP_POWER\n" , + func->num);return -EINVAL ; ret =sdio_set_host_pm_flags (func,MMC_PM_KEEP_POWER );
@@ -758,10 +772,10 @@ static int ath6kl_sdio_probe(struct sdio_func *func,struct ath6kl *ar;int count; -ath6kl_dbg (ATH6KL_DBG_TRC , -"%s: func: 0x%X, vendor id: 0x%X, dev id: 0x%X, block size: 0x%X/0x%X\n" , - __func__, func->num, func->vendor, - func->device, func->max_blksize, func->cur_blksize); +ath6kl_dbg (ATH6KL_DBG_SDIO , +"new func %d vendor 0x%x device 0x%x block 0x%x/0x%x\n" , + func->num, func->vendor, func->device, + func->max_blksize, func->cur_blksize); ar_sdio =kzalloc (sizeof (struct ath6kl_sdio ),GFP_KERNEL );if (!ar_sdio)
@@ -820,7 +834,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func, goto err_cfg80211; } -ath6kl_dbg (ATH6KL_DBG_TRC ,"4-bit async irq mode enabled\n" ); +ath6kl_dbg (ATH6KL_DBG_SDIO ,"4-bit async irq mode enabled\n" ); }/* give us some time to enable, in ms */
@@ -868,6 +882,10 @@ static void ath6kl_sdio_remove(struct sdio_func *func) {struct ath6kl_sdio *ar_sdio; +ath6kl_dbg (ATH6KL_DBG_SDIO , +"removed func %d vendor 0x%x device 0x%x\n" , + func->num, func->vendor, func->device); + ar_sdio =sdio_get_drvdata (func);ath6kl_stop_txrx (ar_sdio->ar);
PATCH 3/4 ath6kl: add debug logs for booting
In reply to Kalle ValoJust to make it easier to find out why boot fails.
--- drivers/net/wireless/ath/ath6kl/debug.h | 1 drivers/net/wireless/ath/ath6kl/init.c | 71 +++++++++++++++++++++++++++---- 2 files changed, 63 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath6kl/debug.h +1 -0
@@ -38,6 +38,7 @@ enum ATH6K_DEBUG_MASK {ATH6KL_DBG_AGGR =BIT (15 ),/* aggregation */ ATH6KL_DBG_SDIO =BIT (16 ),ATH6KL_DBG_SDIO_DUMP =BIT (17 ), +ATH6KL_DBG_BOOT =BIT (18 ),/* driver init and fw boot */ ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */ };
drivers/net/wireless/ath/ath6kl/init.c +62 -9
184 lines not on this page · raw message
PATCH 4/4 ath6kl: improve wmi debug messages
In reply to Kalle ValoAdd a new debug level ATH6KL_DBG_WMI_DUMP and other minor improvements to the wmi debug messages.
--- drivers/net/wireless/ath/ath6kl/debug.h | 3 +- drivers/net/wireless/ath/ath6kl/wmi.c | 44 +++++++++++++++++++++++++------ 2 files changed, 37 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath6kl/debug.h +2 -1
@@ -34,11 +34,12 @@ enum ATH6K_DEBUG_MASK {ATH6KL_DBG_TRC =BIT (11 ),/* generic func tracing */ ATH6KL_DBG_SCATTER =BIT (12 ),/* hif scatter tracing */ ATH6KL_DBG_WLAN_CFG =BIT (13 ),/* cfg80211 i/f file tracing */ -ATH6KL_DBG_RAW_BYTES =BIT (14 ),/* dump tx/rx and wmi frames */ +ATH6KL_DBG_RAW_BYTES =BIT (14 ),/* dump tx/rx frames */ ATH6KL_DBG_AGGR =BIT (15 ),/* aggregation */ ATH6KL_DBG_SDIO =BIT (16 ),ATH6KL_DBG_SDIO_DUMP =BIT (17 ),ATH6KL_DBG_BOOT =BIT (18 ),/* driver init and fw boot */ +ATH6KL_DBG_WMI_DUMP =BIT (19 ),ATH6KL_DBG_ANY =0xffffffff /* enable all logs */ };
drivers/net/wireless/ath/ath6kl/wmi.c +35 -9
112 lines not on this page · raw message
Quoted 8 lines · Kalle Valo
Makes it easier to recognise longs dumps.
Obligatory screenshot using "rx" prefix:
ath6kl:
ath6kl_rx
rx 00000000: 10 10 00 00 00 00 08 30 00 00 00 00 00 00 f9 0b .......0........ rx 00000010: 2c 44 08 30 00 00 f9 0b 0c a4 02 00 00 00 73 d2 ,D.0..........s. rx 00000020: 94 00 f9 0b 04 8c 01 00 02 00 07 02 02 00 f9 0b ................
All four applied.
Kalle