All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ath9k: Print the negotiated HT capabilities
@ 2013-02-04 10:08 Sujith Manoharan
  2013-02-04 10:08 ` [PATCH 2/3] ath9k: Fix ATH9K_HW_CAP_HT usage Sujith Manoharan
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sujith Manoharan @ 2013-02-04 10:08 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Also, reduce the memory allocated for each row.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/rc.c | 12 +++++++++++-
 drivers/net/wireless/ath/ath9k/rc.h |  6 ++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 714558d..62abd70 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1364,7 +1364,7 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
 	if (rc->rate_table == NULL)
 		return 0;
 
-	max = 80 + rc->rate_table_size * 1024 + 1;
+	max = 80 + rc->rate_table_size * 256 + 1;
 	buf = kmalloc(max, GFP_KERNEL);
 	if (buf == NULL)
 		return -ENOMEM;
@@ -1410,6 +1410,16 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
 			stats->per);
 	}
 
+	if (rc->ht_cap & WLAN_RC_HT_FLAG) {
+		len += snprintf(buf + len, max - len, "\nNegotiated HT caps: ");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_HT_FLAG), "[HT20]");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_40_FLAG), "[HT40]");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_DS_FLAG), "[2-Stream]");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_TS_FLAG), "[3-Stream]");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_SGI_FLAG), "[SGI]");
+		len += snprintf(buf + len, max - len, "\n");
+	}
+
 	if (len > max)
 		len = max;
 
diff --git a/drivers/net/wireless/ath/ath9k/rc.h b/drivers/net/wireless/ath/ath9k/rc.h
index 267dbfc..d9089b9 100644
--- a/drivers/net/wireless/ath/ath9k/rc.h
+++ b/drivers/net/wireless/ath/ath9k/rc.h
@@ -131,6 +131,12 @@ enum {
 #define WLAN_RC_SGI_FLAG        (0x08)
 #define WLAN_RC_HT_FLAG         (0x10)
 
+#define PR_HT_CAP(_cond, _str)						\
+	do {								\
+		if (_cond)						\
+			len += snprintf(buf + len, max - len, _str);	\
+	} while (0)
+
 /**
  * struct ath_rate_table - Rate Control table
  * @rate_cnt: total number of rates for the given wireless mode
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-12  9:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-04 10:08 [PATCH 1/3] ath9k: Print the negotiated HT capabilities Sujith Manoharan
2013-02-04 10:08 ` [PATCH 2/3] ath9k: Fix ATH9K_HW_CAP_HT usage Sujith Manoharan
2013-02-04 10:08 ` [PATCH 3/3] ath9k: Fix IBSS joiner mode Sujith Manoharan
2013-02-12  9:24   ` Nicolas Cavallari
2013-02-12  9:55     ` Sujith Manoharan
2013-02-08 14:08 ` [PATCH 1/3] ath9k: Print the negotiated HT capabilities Sujith Manoharan
2013-02-08 19:45   ` John W. Linville
2013-02-09  2:27     ` Sujith Manoharan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.