aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2011-09-27 07:30:45 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-09-28 12:27:30 -0400
commitef094103233344271990d15045d6a776386c3784 (patch)
tree2efaa6a118f9fa343a5b4522c4e6e10f61720740 /drivers
parent9a7308341b71f3c5e88e6a30f9d6a1cfb3bc2b4f (diff)
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 ................ Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath6kl/debug.h14
-rw-r--r--drivers/net/wireless/ath/ath6kl/htc.c27
-rw-r--r--drivers/net/wireless/ath/ath6kl/txrx.c6
-rw-r--r--drivers/net/wireless/ath/ath6kl/wmi.c3
4 files changed, 28 insertions, 22 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 91f4bc35f968..9f906c2d3f65 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -69,12 +69,14 @@ enum ath6kl_war {
69 }) 69 })
70 70
71static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask, 71static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
72 const char *msg, const void *buf, 72 const char *msg, const char *prefix,
73 size_t len) 73 const void *buf, size_t len)
74{ 74{
75 if (debug_mask & mask) { 75 if (debug_mask & mask) {
76 ath6kl_dbg(mask, "%s\n", msg); 76 if (msg)
77 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len); 77 ath6kl_dbg(mask, "%s\n", msg);
78
79 print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len);
78 } 80 }
79} 81}
80 82
@@ -95,8 +97,8 @@ static inline int ath6kl_dbg(enum ATH6K_DEBUG_MASK dbg_mask,
95} 97}
96 98
97static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask, 99static inline void ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask,
98 const char *msg, const void *buf, 100 const char *msg, const char *prefix,
99 size_t len) 101 const void *buf, size_t len)
100{ 102{
101} 103}
102 104
diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c
index feed98535c9f..f88a7c9e4148 100644
--- a/drivers/net/wireless/ath/ath6kl/htc.c
+++ b/drivers/net/wireless/ath/ath6kl/htc.c
@@ -1192,9 +1192,9 @@ static void htc_ctrl_rx(struct htc_target *context, struct htc_packet *packets)
1192 packets->act_len + HTC_HDR_LENGTH); 1192 packets->act_len + HTC_HDR_LENGTH);
1193 1193
1194 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, 1194 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES,
1195 "Unexpected ENDPOINT 0 Message", 1195 "Unexpected ENDPOINT 0 Message", "",
1196 packets->buf - HTC_HDR_LENGTH, 1196 packets->buf - HTC_HDR_LENGTH,
1197 packets->act_len + HTC_HDR_LENGTH); 1197 packets->act_len + HTC_HDR_LENGTH);
1198 } 1198 }
1199 1199
1200 htc_reclaim_rxbuf(context, packets, &context->endpoint[0]); 1200 htc_reclaim_rxbuf(context, packets, &context->endpoint[0]);
@@ -1328,7 +1328,7 @@ static int htc_parse_trailer(struct htc_target *target,
1328 memcpy((u8 *)&next_lk_ahds[0], lk_ahd->lk_ahd, 4); 1328 memcpy((u8 *)&next_lk_ahds[0], lk_ahd->lk_ahd, 4);
1329 1329
1330 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Next Look Ahead", 1330 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Next Look Ahead",
1331 next_lk_ahds, 4); 1331 "", next_lk_ahds, 4);
1332 1332
1333 *n_lk_ahds = 1; 1333 *n_lk_ahds = 1;
1334 } 1334 }
@@ -1347,7 +1347,7 @@ static int htc_parse_trailer(struct htc_target *target,
1347 (struct htc_bundle_lkahd_rpt *) record_buf; 1347 (struct htc_bundle_lkahd_rpt *) record_buf;
1348 1348
1349 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Bundle lk_ahd", 1349 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Bundle lk_ahd",
1350 record_buf, record->len); 1350 "", record_buf, record->len);
1351 1351
1352 for (i = 0; i < len; i++) { 1352 for (i = 0; i < len; i++) {
1353 memcpy((u8 *)&next_lk_ahds[i], 1353 memcpy((u8 *)&next_lk_ahds[i],
@@ -1380,7 +1380,8 @@ static int htc_proc_trailer(struct htc_target *target,
1380 1380
1381 ath6kl_dbg(ATH6KL_DBG_HTC_RECV, "+htc_proc_trailer (len:%d)\n", len); 1381 ath6kl_dbg(ATH6KL_DBG_HTC_RECV, "+htc_proc_trailer (len:%d)\n", len);
1382 1382
1383 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Recv Trailer", buf, len); 1383 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Recv Trailer", "",
1384 buf, len);
1384 1385
1385 orig_buf = buf; 1386 orig_buf = buf;
1386 orig_len = len; 1387 orig_len = len;
@@ -1418,7 +1419,7 @@ static int htc_proc_trailer(struct htc_target *target,
1418 1419
1419 if (status) 1420 if (status)
1420 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "BAD Recv Trailer", 1421 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "BAD Recv Trailer",
1421 orig_buf, orig_len); 1422 "", orig_buf, orig_len);
1422 1423
1423 return status; 1424 return status;
1424} 1425}
@@ -1435,8 +1436,8 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
1435 if (n_lkahds != NULL) 1436 if (n_lkahds != NULL)
1436 *n_lkahds = 0; 1437 *n_lkahds = 0;
1437 1438
1438 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "HTC Recv PKT", packet->buf, 1439 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "HTC Recv PKT", "htc ",
1439 packet->act_len); 1440 packet->buf, packet->act_len);
1440 1441
1441 /* 1442 /*
1442 * NOTE: we cannot assume the alignment of buf, so we use the safe 1443 * 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,
1480 ath6kl_err("%s(): lk_ahd mismatch! (pPkt:0x%p flags:0x%X)\n", 1481 ath6kl_err("%s(): lk_ahd mismatch! (pPkt:0x%p flags:0x%X)\n",
1481 __func__, packet, packet->info.rx.rx_flags); 1482 __func__, packet, packet->info.rx.rx_flags);
1482 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Expected Message lk_ahd", 1483 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Expected Message lk_ahd",
1483 &packet->info.rx.exp_hdr, 4); 1484 "", &packet->info.rx.exp_hdr, 4);
1484 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Current Frame Header", 1485 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "Current Frame Header",
1485 (u8 *)&lk_ahd, sizeof(lk_ahd)); 1486 "", (u8 *)&lk_ahd, sizeof(lk_ahd));
1486 status = -ENOMEM; 1487 status = -ENOMEM;
1487 goto fail_rx; 1488 goto fail_rx;
1488 } 1489 }
@@ -1518,12 +1519,12 @@ static int ath6kl_htc_rx_process_hdr(struct htc_target *target,
1518fail_rx: 1519fail_rx:
1519 if (status) 1520 if (status)
1520 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "BAD HTC Recv PKT", 1521 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "BAD HTC Recv PKT",
1521 packet->buf, 1522 "", packet->buf,
1522 packet->act_len < 256 ? packet->act_len : 256); 1523 packet->act_len < 256 ? packet->act_len : 256);
1523 else { 1524 else {
1524 if (packet->act_len > 0) 1525 if (packet->act_len > 0)
1525 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, 1526 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES,
1526 "HTC - Application Msg", 1527 "HTC - Application Msg", "",
1527 packet->buf, packet->act_len); 1528 packet->buf, packet->act_len);
1528 } 1529 }
1529 1530
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index 0869ff396b57..a7117074f81c 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -340,7 +340,8 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
340 set_htc_pkt_info(&cookie->htc_pkt, cookie, skb->data, skb->len, 340 set_htc_pkt_info(&cookie->htc_pkt, cookie, skb->data, skb->len,
341 eid, htc_tag); 341 eid, htc_tag);
342 342
343 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, __func__, skb->data, skb->len); 343 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, __func__, "tx ",
344 skb->data, skb->len);
344 345
345 /* 346 /*
346 * HTC interface is asynchronous, if this fails, cleanup will 347 * HTC interface is asynchronous, if this fails, cleanup will
@@ -1068,7 +1069,8 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
1068 skb_put(skb, packet->act_len + HTC_HDR_LENGTH); 1069 skb_put(skb, packet->act_len + HTC_HDR_LENGTH);
1069 skb_pull(skb, HTC_HDR_LENGTH); 1070 skb_pull(skb, HTC_HDR_LENGTH);
1070 1071
1071 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, __func__, skb->data, skb->len); 1072 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, __func__, "rx ",
1073 skb->data, skb->len);
1072 1074
1073 skb->dev = ar->net_dev; 1075 skb->dev = ar->net_dev;
1074 1076
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index 47fbb8e7686b..785a8c72541b 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -2850,7 +2850,8 @@ int ath6kl_wmi_control_rx(struct wmi *wmi, struct sk_buff *skb)
2850 len = skb->len; 2850 len = skb->len;
2851 2851
2852 ath6kl_dbg(ATH6KL_DBG_WMI, "%s: wmi id: %d\n", __func__, id); 2852 ath6kl_dbg(ATH6KL_DBG_WMI, "%s: wmi id: %d\n", __func__, id);
2853 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "msg payload ", datap, len); 2853 ath6kl_dbg_dump(ATH6KL_DBG_RAW_BYTES, "msg payload ", "wmi rx ",
2854 datap, len);
2854 2855
2855 switch (id) { 2856 switch (id) {
2856 case WMI_GET_BITRATE_CMDID: 2857 case WMI_GET_BITRATE_CMDID: