Linux wireless drivers development
 help / color / mirror / Atom feed
From: Eliad Peller <eliad@wizery.com>
To: Luciano Coelho <luca@coelho.fi>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH 02/13] wlcore: print active channel in the driver_state
Date: Mon,  9 Sep 2013 12:24:33 +0300	[thread overview]
Message-ID: <1378718684-14430-2-git-send-email-eliad@wizery.com> (raw)
In-Reply-To: <1378718684-14430-1-git-send-email-eliad@wizery.com>

From: Victor Goldenshtein <victorg@ti.com>

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>
---
 drivers/net/wireless/ti/wlcore/debugfs.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c
index e17630c..89893c7 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,
 	int res = 0;
 	ssize_t ret;
 	char *buf;
+	struct wl12xx_vif *wlvif;
 
 #define DRIVER_STATE_BUF_LEN 1024
 
@@ -450,12 +451,28 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
 	(res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,\
 			  #x " = " fmt "\n", wl->x))
 
+#define DRIVER_STATE_PRINT_GENERIC(x, fmt, args...)   \
+	(res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,\
+			  #x " = " fmt "\n", args))
+
 #define DRIVER_STATE_PRINT_LONG(x) DRIVER_STATE_PRINT(x, "%ld")
 #define DRIVER_STATE_PRINT_INT(x)  DRIVER_STATE_PRINT(x, "%d")
 #define DRIVER_STATE_PRINT_STR(x)  DRIVER_STATE_PRINT(x, "%s")
 #define DRIVER_STATE_PRINT_LHEX(x) DRIVER_STATE_PRINT(x, "0x%lx")
 #define DRIVER_STATE_PRINT_HEX(x)  DRIVER_STATE_PRINT(x, "0x%x")
 
+	wl12xx_for_each_wlvif_sta(wl, wlvif) {
+		if (!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
+			continue;
+
+		DRIVER_STATE_PRINT_GENERIC(channel, "%d (%s)", wlvif->channel,
+					   wlvif->p2p ? "P2P-CL" : "STA");
+	}
+
+	wl12xx_for_each_wlvif_ap(wl, wlvif)
+		DRIVER_STATE_PRINT_GENERIC(channel, "%d (%s)", wlvif->channel,
+					   wlvif->p2p ? "P2P-GO" : "AP");
+
 	DRIVER_STATE_PRINT_INT(tx_blocks_available);
 	DRIVER_STATE_PRINT_INT(tx_allocated_blocks);
 	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,
 	DRIVER_STATE_PRINT_INT(tx_blocks_freed);
 	DRIVER_STATE_PRINT_INT(rx_counter);
 	DRIVER_STATE_PRINT_INT(state);
-	DRIVER_STATE_PRINT_INT(channel);
 	DRIVER_STATE_PRINT_INT(band);
 	DRIVER_STATE_PRINT_INT(power_level);
 	DRIVER_STATE_PRINT_INT(sg_enabled);
-- 
1.8.3.rc1.35.g9b79519


  reply	other threads:[~2013-09-09  9:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09  9:24 [PATCH 01/13] wl18xx: default config alignment with phy defaults Eliad Peller
2013-09-09  9:24 ` Eliad Peller [this message]
2013-09-09  9:24 ` [PATCH 03/13] wlcore: add ap_event_mask Eliad Peller
2013-09-09  9:24 ` [PATCH 04/13] wlcore: fix interrogate command length Eliad Peller
2013-09-09  9:24 ` [PATCH 05/13] wlcore: fwlog dynamic mem_block control Eliad Peller
2013-09-09  9:24 ` [PATCH 06/13] wl12xx/wl18xx: update default fw logger's settings Eliad Peller
2013-09-09  9:24 ` [PATCH 07/13] wlcore/wl18xx/wl12xx: FW log params per chip arch Eliad Peller
2013-09-09  9:24 ` [PATCH 08/13] wlcore: read fw panic log only in host mode Eliad Peller
2013-09-09  9:24 ` [PATCH 09/13] wlcore: Allow stopping fw log in recovery Eliad Peller
2013-09-09  9:24 ` [PATCH 10/13] wlcore: wakeup from ELP before starting recovery Eliad Peller
2013-09-09  9:24 ` [PATCH 11/13] wlcore: memset wl->rx_filter_enabled to zero after recovery Eliad Peller
2013-10-23  5:23   ` Luca Coelho
2013-10-23  7:37     ` Eliad Peller
2013-09-09  9:24 ` [PATCH 12/13] wlcore: fix started_vifs calculation Eliad Peller
2013-09-09  9:24 ` [PATCH 13/13] wlcore: save last regdom configuration on stop Eliad Peller
2013-10-23  7:07 ` [PATCH 01/13] wl18xx: default config alignment with phy defaults Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378718684-14430-2-git-send-email-eliad@wizery.com \
    --to=eliad@wizery.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luca@coelho.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox