diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-02-27 09:20:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-28 14:33:28 -0500 |
commit | 3a85543e9f9f6821d27d33d436f2bad96e5166df (patch) | |
tree | a0241a232a2989deb54408b7139dc48a1ed5b6fe /drivers/net/wireless/ath/wil6210/debugfs.c | |
parent | 1647f12f1b511c2629b9b8d23061aa54ad8a9795 (diff) |
wil6210: [DEBUG] allow to query Rx and all Tx VRING descriptors
Expand debug capabilities to query all Tx/Rx descriptors. Usefull to analyse
various hardware/software stall situations. Printed is whole descriptor content
and the frame itself.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/debugfs.c')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/debugfs.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index 1caa31992a7e..74bb427ce303 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c | |||
@@ -26,6 +26,8 @@ | |||
26 | /* Nasty hack. Better have per device instances */ | 26 | /* Nasty hack. Better have per device instances */ |
27 | static u32 mem_addr; | 27 | static u32 mem_addr; |
28 | static u32 dbg_txdesc_index; | 28 | static u32 dbg_txdesc_index; |
29 | static u32 dbg_vring_index; /* 25 for Rx, 0..24 for Tx */ | ||
30 | #define WIL_DBG_VRING_INDEX_RX (WIL6210_MAX_TX_RINGS + 1) | ||
29 | 31 | ||
30 | static void wil_print_vring(struct seq_file *s, struct wil6210_priv *wil, | 32 | static void wil_print_vring(struct seq_file *s, struct wil6210_priv *wil, |
31 | const char *name, struct vring *vring) | 33 | const char *name, struct vring *vring) |
@@ -390,25 +392,39 @@ static const struct file_operations fops_reset = { | |||
390 | .write = wil_write_file_reset, | 392 | .write = wil_write_file_reset, |
391 | .open = simple_open, | 393 | .open = simple_open, |
392 | }; | 394 | }; |
393 | /*---------Tx descriptor------------*/ | ||
394 | 395 | ||
396 | /*---------Tx/Rx descriptor------------*/ | ||
395 | static int wil_txdesc_debugfs_show(struct seq_file *s, void *data) | 397 | static int wil_txdesc_debugfs_show(struct seq_file *s, void *data) |
396 | { | 398 | { |
397 | struct wil6210_priv *wil = s->private; | 399 | struct wil6210_priv *wil = s->private; |
398 | struct vring *vring = &(wil->vring_tx[0]); | 400 | struct vring *vring; |
401 | if (dbg_vring_index <= WIL6210_MAX_TX_RINGS) | ||
402 | vring = &(wil->vring_tx[dbg_vring_index]); | ||
403 | else | ||
404 | vring = &wil->vring_rx; | ||
399 | 405 | ||
400 | if (!vring->va) { | 406 | if (!vring->va) { |
401 | seq_printf(s, "No Tx VRING\n"); | 407 | if (dbg_vring_index <= WIL6210_MAX_TX_RINGS) |
408 | seq_printf(s, "No Tx[%2d] VRING\n", dbg_vring_index); | ||
409 | else | ||
410 | seq_puts(s, "No Rx VRING\n"); | ||
402 | return 0; | 411 | return 0; |
403 | } | 412 | } |
404 | 413 | ||
405 | if (dbg_txdesc_index < vring->size) { | 414 | if (dbg_txdesc_index < vring->size) { |
415 | /* use struct vring_tx_desc for Rx as well, | ||
416 | * only field used, .dma.length, is the same | ||
417 | */ | ||
406 | volatile struct vring_tx_desc *d = | 418 | volatile struct vring_tx_desc *d = |
407 | &(vring->va[dbg_txdesc_index].tx); | 419 | &(vring->va[dbg_txdesc_index].tx); |
408 | volatile u32 *u = (volatile u32 *)d; | 420 | volatile u32 *u = (volatile u32 *)d; |
409 | struct sk_buff *skb = vring->ctx[dbg_txdesc_index].skb; | 421 | struct sk_buff *skb = vring->ctx[dbg_txdesc_index].skb; |
410 | 422 | ||
411 | seq_printf(s, "Tx[%3d] = {\n", dbg_txdesc_index); | 423 | if (dbg_vring_index <= WIL6210_MAX_TX_RINGS) |
424 | seq_printf(s, "Tx[%2d][%3d] = {\n", dbg_vring_index, | ||
425 | dbg_txdesc_index); | ||
426 | else | ||
427 | seq_printf(s, "Rx[%3d] = {\n", dbg_txdesc_index); | ||
412 | seq_printf(s, " MAC = 0x%08x 0x%08x 0x%08x 0x%08x\n", | 428 | seq_printf(s, " MAC = 0x%08x 0x%08x 0x%08x 0x%08x\n", |
413 | u[0], u[1], u[2], u[3]); | 429 | u[0], u[1], u[2], u[3]); |
414 | seq_printf(s, " DMA = 0x%08x 0x%08x 0x%08x 0x%08x\n", | 430 | seq_printf(s, " DMA = 0x%08x 0x%08x 0x%08x 0x%08x\n", |
@@ -439,8 +455,13 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, void *data) | |||
439 | } | 455 | } |
440 | seq_printf(s, "}\n"); | 456 | seq_printf(s, "}\n"); |
441 | } else { | 457 | } else { |
442 | seq_printf(s, "TxDesc index (%d) >= size (%d)\n", | 458 | if (dbg_vring_index <= WIL6210_MAX_TX_RINGS) |
443 | dbg_txdesc_index, vring->size); | 459 | seq_printf(s, "[%2d] TxDesc index (%d) >= size (%d)\n", |
460 | dbg_vring_index, dbg_txdesc_index, | ||
461 | vring->size); | ||
462 | else | ||
463 | seq_printf(s, "RxDesc index (%d) >= size (%d)\n", | ||
464 | dbg_txdesc_index, vring->size); | ||
444 | } | 465 | } |
445 | 466 | ||
446 | return 0; | 467 | return 0; |
@@ -581,9 +602,12 @@ int wil6210_debugfs_init(struct wil6210_priv *wil) | |||
581 | 602 | ||
582 | debugfs_create_file("mbox", S_IRUGO, dbg, wil, &fops_mbox); | 603 | debugfs_create_file("mbox", S_IRUGO, dbg, wil, &fops_mbox); |
583 | debugfs_create_file("vrings", S_IRUGO, dbg, wil, &fops_vring); | 604 | debugfs_create_file("vrings", S_IRUGO, dbg, wil, &fops_vring); |
584 | debugfs_create_file("txdesc", S_IRUGO, dbg, wil, &fops_txdesc); | 605 | debugfs_create_file("desc", S_IRUGO, dbg, wil, &fops_txdesc); |
585 | debugfs_create_u32("txdesc_index", S_IRUGO | S_IWUSR, dbg, | 606 | debugfs_create_u32("desc_index", S_IRUGO | S_IWUSR, dbg, |
586 | &dbg_txdesc_index); | 607 | &dbg_txdesc_index); |
608 | debugfs_create_u32("vring_index", S_IRUGO | S_IWUSR, dbg, | ||
609 | &dbg_vring_index); | ||
610 | |||
587 | debugfs_create_file("bf", S_IRUGO, dbg, wil, &fops_bf); | 611 | debugfs_create_file("bf", S_IRUGO, dbg, wil, &fops_bf); |
588 | debugfs_create_file("ssid", S_IRUGO | S_IWUSR, dbg, wil, &fops_ssid); | 612 | debugfs_create_file("ssid", S_IRUGO | S_IWUSR, dbg, wil, &fops_ssid); |
589 | debugfs_create_u32("secure_pcp", S_IRUGO | S_IWUSR, dbg, | 613 | debugfs_create_u32("secure_pcp", S_IRUGO | S_IWUSR, dbg, |