summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-09-29 16:04:37 +0200
committerJohn W. Linville <linville@tuxdriver.com>2011-09-30 15:57:20 -0400
commit5bade101eceedb716e39bd35b2928c465e3fbd10 (patch)
tree2edd9bdbae839a2baee5a27c8a368912e64dddb8 /net
parentc2c98fdeb5c897499644eb247285c8e3dacc6450 (diff)
downloadlinux-3.10-5bade101eceedb716e39bd35b2928c465e3fbd10.tar.gz
linux-3.10-5bade101eceedb716e39bd35b2928c465e3fbd10.tar.bz2
linux-3.10-5bade101eceedb716e39bd35b2928c465e3fbd10.zip
mac80211: add missing station flags to debugfs
My work and some previous work didn't add all the flags, add them now and while at it simplify the code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/debugfs_sta.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 56bb68b9c42..c5f341798c1 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -56,19 +56,22 @@ STA_FILE(last_signal, last_signal, D);
static ssize_t sta_flags_read(struct file *file, char __user *userbuf,
size_t count, loff_t *ppos)
{
- char buf[100];
+ char buf[121];
struct sta_info *sta = file->private_data;
- int res = scnprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s",
- test_sta_flag(sta, WLAN_STA_AUTH) ? "AUTH\n" : "",
- test_sta_flag(sta, WLAN_STA_ASSOC) ? "ASSOC\n" : "",
- test_sta_flag(sta, WLAN_STA_PS_STA) ? "PS (sta)\n" : "",
- test_sta_flag(sta, WLAN_STA_PS_DRIVER) ? "PS (driver)\n" : "",
- test_sta_flag(sta, WLAN_STA_AUTHORIZED) ? "AUTHORIZED\n" : "",
- test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE) ? "SHORT PREAMBLE\n" : "",
- test_sta_flag(sta, WLAN_STA_WME) ? "WME\n" : "",
- test_sta_flag(sta, WLAN_STA_WDS) ? "WDS\n" : "",
- test_sta_flag(sta, WLAN_STA_MFP) ? "MFP\n" : "");
+#define TEST(flg) \
+ test_sta_flag(sta, WLAN_STA_##flg) ? #flg "\n" : ""
+
+ int res = scnprintf(buf, sizeof(buf),
+ "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
+ TEST(AUTH), TEST(ASSOC), TEST(PS_STA),
+ TEST(PS_DRIVER), TEST(AUTHORIZED),
+ TEST(SHORT_PREAMBLE), TEST(ASSOC_AP),
+ TEST(WME), TEST(WDS), TEST(CLEAR_PS_FILT),
+ TEST(MFP), TEST(BLOCK_BA), TEST(PSPOLL),
+ TEST(UAPSD), TEST(SP), TEST(TDLS_PEER),
+ TEST(TDLS_PEER_AUTH));
+#undef TEST
return simple_read_from_buffer(userbuf, count, ppos, buf, res);
}
STA_OPS(flags);