Search Linux Wireless

[PATCH v2 5/5] mac80211: expose HT channel flags through debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we are not going to be exporting HT40-/+
flags for now through nl80211 we supply the channel
flags as a whole through debugfs so users/testers can
see whether or not HT40-/+ is allowed.

Screenshot on channel 1 (2.412 GHz):

[root@pogo ~]# mount -t debugfs debugfs /debug/
[root@pogo ~]# cat /debug/ieee80211/phy0/ht40minusallowed
0
[root@pogo ~]# cat /debug/ieee80211/phy0/ht40plusallowed
1
[root@pogo ~]# umount /debug

Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---
 net/mac80211/debugfs.c     |   10 ++++++++++
 net/mac80211/ieee80211_i.h |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 210b9b6..fa15a88 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -51,6 +51,12 @@ static const struct file_operations name## _ops = {			\
 
 DEBUGFS_READONLY_FILE(frequency, 20, "%d",
 		      local->hw.conf.channel->center_freq);
+DEBUGFS_READONLY_FILE(ht40plusallowed, 20, "%d",
+		      !(local->hw.conf.channel->flags &
+		      IEEE80211_CHAN_NO_HT40PLUS));
+DEBUGFS_READONLY_FILE(ht40minusallowed, 20, "%d",
+		      !(local->hw.conf.channel->flags &
+		      IEEE80211_CHAN_NO_HT40MINUS));
 DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
 		      local->rts_threshold);
 DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d",
@@ -269,6 +275,8 @@ void debugfs_hw_add(struct ieee80211_local *local)
 	local->debugfs.keys = debugfs_create_dir("keys", phyd);
 
 	DEBUGFS_ADD(frequency);
+	DEBUGFS_ADD(ht40plusallowed);
+	DEBUGFS_ADD(ht40minusallowed);
 	DEBUGFS_ADD(rts_threshold);
 	DEBUGFS_ADD(fragmentation_threshold);
 	DEBUGFS_ADD(short_retry_limit);
@@ -324,6 +332,8 @@ void debugfs_hw_add(struct ieee80211_local *local)
 void debugfs_hw_del(struct ieee80211_local *local)
 {
 	DEBUGFS_DEL(frequency);
+	DEBUGFS_DEL(ht40plusallowed);
+	DEBUGFS_DEL(ht40minusallowed);
 	DEBUGFS_DEL(rts_threshold);
 	DEBUGFS_DEL(fragmentation_threshold);
 	DEBUGFS_DEL(short_retry_limit);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index e6ed78c..f7b192a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -750,6 +750,8 @@ struct ieee80211_local {
 		struct dentry *rcdir;
 		struct dentry *rcname;
 		struct dentry *frequency;
+		struct dentry *ht40plusallowed;
+		struct dentry *ht40minusallowed;
 		struct dentry *rts_threshold;
 		struct dentry *fragmentation_threshold;
 		struct dentry *short_retry_limit;
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux