diff options
author | Victor Goldenshtein <victorg@ti.com> | 2013-09-09 05:24:33 -0400 |
---|---|---|
committer | Luciano Coelho <luciano.coelho@intel.com> | 2013-10-23 02:47:39 -0400 |
commit | bbd74557e5711e3d5f4d94d050ae05987c4fd0be (patch) | |
tree | eec96f9b558c78449db3441632dc9ae576ac9bac | |
parent | 50e4c905a0c782b8a5717ed0d907c53d82c16ce2 (diff) |
wlcore: print active channel in the driver_state
Print current active channel/s and a role type for
that channel in the driver_state debugfs.
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/ti/wlcore/debugfs.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c index e17630c2a849..89893c717025 100644 --- a/drivers/net/wireless/ti/wlcore/debugfs.c +++ b/drivers/net/wireless/ti/wlcore/debugfs.c | |||
@@ -437,6 +437,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf, | |||
437 | int res = 0; | 437 | int res = 0; |
438 | ssize_t ret; | 438 | ssize_t ret; |
439 | char *buf; | 439 | char *buf; |
440 | struct wl12xx_vif *wlvif; | ||
440 | 441 | ||
441 | #define DRIVER_STATE_BUF_LEN 1024 | 442 | #define DRIVER_STATE_BUF_LEN 1024 |
442 | 443 | ||
@@ -450,12 +451,28 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf, | |||
450 | (res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,\ | 451 | (res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,\ |
451 | #x " = " fmt "\n", wl->x)) | 452 | #x " = " fmt "\n", wl->x)) |
452 | 453 | ||
454 | #define DRIVER_STATE_PRINT_GENERIC(x, fmt, args...) \ | ||
455 | (res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,\ | ||
456 | #x " = " fmt "\n", args)) | ||
457 | |||
453 | #define DRIVER_STATE_PRINT_LONG(x) DRIVER_STATE_PRINT(x, "%ld") | 458 | #define DRIVER_STATE_PRINT_LONG(x) DRIVER_STATE_PRINT(x, "%ld") |
454 | #define DRIVER_STATE_PRINT_INT(x) DRIVER_STATE_PRINT(x, "%d") | 459 | #define DRIVER_STATE_PRINT_INT(x) DRIVER_STATE_PRINT(x, "%d") |
455 | #define DRIVER_STATE_PRINT_STR(x) DRIVER_STATE_PRINT(x, "%s") | 460 | #define DRIVER_STATE_PRINT_STR(x) DRIVER_STATE_PRINT(x, "%s") |
456 | #define DRIVER_STATE_PRINT_LHEX(x) DRIVER_STATE_PRINT(x, "0x%lx") | 461 | #define DRIVER_STATE_PRINT_LHEX(x) DRIVER_STATE_PRINT(x, "0x%lx") |
457 | #define DRIVER_STATE_PRINT_HEX(x) DRIVER_STATE_PRINT(x, "0x%x") | 462 | #define DRIVER_STATE_PRINT_HEX(x) DRIVER_STATE_PRINT(x, "0x%x") |
458 | 463 | ||
464 | wl12xx_for_each_wlvif_sta(wl, wlvif) { | ||
465 | if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) | ||
466 | continue; | ||
467 | |||
468 | DRIVER_STATE_PRINT_GENERIC(channel, "%d (%s)", wlvif->channel, | ||
469 | wlvif->p2p ? "P2P-CL" : "STA"); | ||
470 | } | ||
471 | |||
472 | wl12xx_for_each_wlvif_ap(wl, wlvif) | ||
473 | DRIVER_STATE_PRINT_GENERIC(channel, "%d (%s)", wlvif->channel, | ||
474 | wlvif->p2p ? "P2P-GO" : "AP"); | ||
475 | |||
459 | DRIVER_STATE_PRINT_INT(tx_blocks_available); | 476 | DRIVER_STATE_PRINT_INT(tx_blocks_available); |
460 | DRIVER_STATE_PRINT_INT(tx_allocated_blocks); | 477 | DRIVER_STATE_PRINT_INT(tx_allocated_blocks); |
461 | DRIVER_STATE_PRINT_INT(tx_allocated_pkts[0]); | 478 | DRIVER_STATE_PRINT_INT(tx_allocated_pkts[0]); |
@@ -474,7 +491,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf, | |||
474 | DRIVER_STATE_PRINT_INT(tx_blocks_freed); | 491 | DRIVER_STATE_PRINT_INT(tx_blocks_freed); |
475 | DRIVER_STATE_PRINT_INT(rx_counter); | 492 | DRIVER_STATE_PRINT_INT(rx_counter); |
476 | DRIVER_STATE_PRINT_INT(state); | 493 | DRIVER_STATE_PRINT_INT(state); |
477 | DRIVER_STATE_PRINT_INT(channel); | ||
478 | DRIVER_STATE_PRINT_INT(band); | 494 | DRIVER_STATE_PRINT_INT(band); |
479 | DRIVER_STATE_PRINT_INT(power_level); | 495 | DRIVER_STATE_PRINT_INT(power_level); |
480 | DRIVER_STATE_PRINT_INT(sg_enabled); | 496 | DRIVER_STATE_PRINT_INT(sg_enabled); |