From: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
To: <johannes@sipsolutions.net>
Cc: <linux-wireless@vger.kernel.org>, <rmanohar@qti.qualcomm.com>,
<vthiagar@qti.qualcomm.com>,
Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
Subject: [PATCH] cfg80211: add debugfs VHT80 allow map
Date: Fri, 6 Feb 2015 12:05:46 +0530 [thread overview]
Message-ID: <1423204546-22872-1-git-send-email-arnagara@qti.qualcomm.com> (raw)
Here is a output of this debugfs entry
root@OpenWrt:/# cat /sys/kernel/debug/ieee80211/phy0/vht80allow_map
2412 VHT80 N
2417 VHT80 N
2422 VHT80 N
2427 VHT80 N
2432 VHT80 N
2437 VHT80 N
2442 VHT80 N
2447 VHT80 N
2452 VHT80 N
2457 VHT80 N
2462 VHT80 N
2467 Disabled
2472 Disabled
2484 Disabled
5180 VHT80 Y
5200 VHT80 Y
5220 VHT80 Y
5240 VHT80 Y
5260 VHT80 Y
5280 VHT80 Y
5300 VHT80 Y
5320 VHT80 Y
5500 VHT80 Y
5520 VHT80 Y
5540 VHT80 Y
5560 VHT80 Y
5580 VHT80 Y
5600 Disabled
5620 Disabled
5640 Disabled
5660 VHT80 Y
5680 VHT80 Y
5700 VHT80 Y
5745 VHT80 Y
5765 VHT80 Y
5785 VHT80 Y
5805 VHT80 Y
5825 VHT80 Y
Signed-off-by: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
---
net/wireless/debugfs.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/net/wireless/debugfs.c b/net/wireless/debugfs.c
index 4541577..0349dcd 100644
--- a/net/wireless/debugfs.c
+++ b/net/wireless/debugfs.c
@@ -102,6 +102,66 @@ static const struct file_operations ht40allow_map_ops = {
.llseek = default_llseek,
};
+static int vht80_print_chan(struct ieee80211_channel *chan,
+ char *buf, int buf_size, int offset)
+{
+ if (WARN_ON(offset > buf_size))
+ return 0;
+
+ if (chan->flags & IEEE80211_CHAN_DISABLED)
+ return scnprintf(buf + offset,
+ buf_size - offset,
+ "%d Disabled\n",
+ chan->center_freq);
+
+ return scnprintf(buf + offset,
+ buf_size - offset,
+ "%d VHT80 %c\n",
+ chan->center_freq,
+ (chan->flags & IEEE80211_CHAN_NO_80MHZ) ?
+ 'N' : 'Y');
+}
+
+static ssize_t vht80allow_map_read(struct file *file,
+ char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct wiphy *wiphy = file->private_data;
+ char *buf;
+ unsigned int offset = 0, buf_size = PAGE_SIZE, i, r;
+ enum ieee80211_band band;
+ struct ieee80211_supported_band *sband;
+
+ buf = kzalloc(buf_size, GFP_KERNEL);
+ if (!buf)
+ return -ENOMEM;
+
+ rtnl_lock();
+
+ for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
+ sband = wiphy->bands[band];
+ if (!sband)
+ continue;
+ for (i = 0; i < sband->n_channels; i++)
+ offset += vht80_print_chan(&sband->channels[i],
+ buf, buf_size, offset);
+ }
+
+ rtnl_unlock();
+
+ r = simple_read_from_buffer(user_buf, count, ppos, buf, offset);
+
+ kfree(buf);
+
+ return r;
+}
+
+static const struct file_operations vht80allow_map_ops = {
+ .read = vht80allow_map_read,
+ .open = simple_open,
+ .llseek = default_llseek,
+};
+
#define DEBUGFS_ADD(name) \
debugfs_create_file(#name, S_IRUGO, phyd, &rdev->wiphy, &name## _ops);
@@ -114,4 +174,5 @@ void cfg80211_debugfs_rdev_add(struct cfg80211_registered_device *rdev)
DEBUGFS_ADD(short_retry_limit);
DEBUGFS_ADD(long_retry_limit);
DEBUGFS_ADD(ht40allow_map);
+ DEBUGFS_ADD(vht80allow_map);
}
--
1.7.9.5
next reply other threads:[~2015-02-06 6:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 6:35 Ashok Raj Nagarajan [this message]
2015-02-06 19:11 ` [PATCH] cfg80211: add debugfs VHT80 allow map Johannes Berg
2015-02-09 7:16 ` Nagarajan, Ashok Raj
2015-02-09 10:16 ` Johannes Berg
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=1423204546-22872-1-git-send-email-arnagara@qti.qualcomm.com \
--to=arnagara@qti.qualcomm.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=rmanohar@qti.qualcomm.com \
--cc=vthiagar@qti.qualcomm.com \
/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;
as well as URLs for NNTP newsgroup(s).