aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/debugfs_netdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/debugfs_netdev.c')
-rw-r--r--net/mac80211/debugfs_netdev.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 059bbb82e84f..14abcf44f974 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -124,6 +124,15 @@ static ssize_t ieee80211_if_fmt_##name( \
124 return scnprintf(buf, buflen, "%d\n", sdata->field / 16); \ 124 return scnprintf(buf, buflen, "%d\n", sdata->field / 16); \
125} 125}
126 126
127#define IEEE80211_IF_FMT_JIFFIES_TO_MS(name, field) \
128static ssize_t ieee80211_if_fmt_##name( \
129 const struct ieee80211_sub_if_data *sdata, \
130 char *buf, int buflen) \
131{ \
132 return scnprintf(buf, buflen, "%d\n", \
133 jiffies_to_msecs(sdata->field)); \
134}
135
127#define __IEEE80211_IF_FILE(name, _write) \ 136#define __IEEE80211_IF_FILE(name, _write) \
128static ssize_t ieee80211_if_read_##name(struct file *file, \ 137static ssize_t ieee80211_if_read_##name(struct file *file, \
129 char __user *userbuf, \ 138 char __user *userbuf, \
@@ -197,6 +206,7 @@ IEEE80211_IF_FILE(bssid, u.mgd.bssid, MAC);
197IEEE80211_IF_FILE(aid, u.mgd.aid, DEC); 206IEEE80211_IF_FILE(aid, u.mgd.aid, DEC);
198IEEE80211_IF_FILE(last_beacon, u.mgd.last_beacon_signal, DEC); 207IEEE80211_IF_FILE(last_beacon, u.mgd.last_beacon_signal, DEC);
199IEEE80211_IF_FILE(ave_beacon, u.mgd.ave_beacon_signal, DEC_DIV_16); 208IEEE80211_IF_FILE(ave_beacon, u.mgd.ave_beacon_signal, DEC_DIV_16);
209IEEE80211_IF_FILE(beacon_timeout, u.mgd.beacon_timeout, JIFFIES_TO_MS);
200 210
201static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata, 211static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata,
202 enum ieee80211_smps_mode smps_mode) 212 enum ieee80211_smps_mode smps_mode)
@@ -521,7 +531,7 @@ IEEE80211_IF_FILE(dot11MeshAwakeWindowDuration,
521#endif 531#endif
522 532
523#define DEBUGFS_ADD_MODE(name, mode) \ 533#define DEBUGFS_ADD_MODE(name, mode) \
524 debugfs_create_file(#name, mode, sdata->debugfs.dir, \ 534 debugfs_create_file(#name, mode, sdata->vif.debugfs_dir, \
525 sdata, &name##_ops); 535 sdata, &name##_ops);
526 536
527#define DEBUGFS_ADD(name) DEBUGFS_ADD_MODE(name, 0400) 537#define DEBUGFS_ADD(name) DEBUGFS_ADD_MODE(name, 0400)
@@ -542,6 +552,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata)
542 DEBUGFS_ADD(aid); 552 DEBUGFS_ADD(aid);
543 DEBUGFS_ADD(last_beacon); 553 DEBUGFS_ADD(last_beacon);
544 DEBUGFS_ADD(ave_beacon); 554 DEBUGFS_ADD(ave_beacon);
555 DEBUGFS_ADD(beacon_timeout);
545 DEBUGFS_ADD_MODE(smps, 0600); 556 DEBUGFS_ADD_MODE(smps, 0600);
546 DEBUGFS_ADD_MODE(tkip_mic_test, 0200); 557 DEBUGFS_ADD_MODE(tkip_mic_test, 0200);
547 DEBUGFS_ADD_MODE(uapsd_queues, 0600); 558 DEBUGFS_ADD_MODE(uapsd_queues, 0600);
@@ -577,7 +588,7 @@ static void add_mesh_files(struct ieee80211_sub_if_data *sdata)
577static void add_mesh_stats(struct ieee80211_sub_if_data *sdata) 588static void add_mesh_stats(struct ieee80211_sub_if_data *sdata)
578{ 589{
579 struct dentry *dir = debugfs_create_dir("mesh_stats", 590 struct dentry *dir = debugfs_create_dir("mesh_stats",
580 sdata->debugfs.dir); 591 sdata->vif.debugfs_dir);
581#define MESHSTATS_ADD(name)\ 592#define MESHSTATS_ADD(name)\
582 debugfs_create_file(#name, 0400, dir, sdata, &name##_ops); 593 debugfs_create_file(#name, 0400, dir, sdata, &name##_ops);
583 594
@@ -594,7 +605,7 @@ static void add_mesh_stats(struct ieee80211_sub_if_data *sdata)
594static void add_mesh_config(struct ieee80211_sub_if_data *sdata) 605static void add_mesh_config(struct ieee80211_sub_if_data *sdata)
595{ 606{
596 struct dentry *dir = debugfs_create_dir("mesh_config", 607 struct dentry *dir = debugfs_create_dir("mesh_config",
597 sdata->debugfs.dir); 608 sdata->vif.debugfs_dir);
598 609
599#define MESHPARAMS_ADD(name) \ 610#define MESHPARAMS_ADD(name) \
600 debugfs_create_file(#name, 0600, dir, sdata, &name##_ops); 611 debugfs_create_file(#name, 0600, dir, sdata, &name##_ops);
@@ -631,7 +642,7 @@ static void add_mesh_config(struct ieee80211_sub_if_data *sdata)
631 642
632static void add_files(struct ieee80211_sub_if_data *sdata) 643static void add_files(struct ieee80211_sub_if_data *sdata)
633{ 644{
634 if (!sdata->debugfs.dir) 645 if (!sdata->vif.debugfs_dir)
635 return; 646 return;
636 647
637 DEBUGFS_ADD(flags); 648 DEBUGFS_ADD(flags);
@@ -673,21 +684,21 @@ void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata)
673 char buf[10+IFNAMSIZ]; 684 char buf[10+IFNAMSIZ];
674 685
675 sprintf(buf, "netdev:%s", sdata->name); 686 sprintf(buf, "netdev:%s", sdata->name);
676 sdata->debugfs.dir = debugfs_create_dir(buf, 687 sdata->vif.debugfs_dir = debugfs_create_dir(buf,
677 sdata->local->hw.wiphy->debugfsdir); 688 sdata->local->hw.wiphy->debugfsdir);
678 if (sdata->debugfs.dir) 689 if (sdata->vif.debugfs_dir)
679 sdata->debugfs.subdir_stations = debugfs_create_dir("stations", 690 sdata->debugfs.subdir_stations = debugfs_create_dir("stations",
680 sdata->debugfs.dir); 691 sdata->vif.debugfs_dir);
681 add_files(sdata); 692 add_files(sdata);
682} 693}
683 694
684void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata) 695void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata)
685{ 696{
686 if (!sdata->debugfs.dir) 697 if (!sdata->vif.debugfs_dir)
687 return; 698 return;
688 699
689 debugfs_remove_recursive(sdata->debugfs.dir); 700 debugfs_remove_recursive(sdata->vif.debugfs_dir);
690 sdata->debugfs.dir = NULL; 701 sdata->vif.debugfs_dir = NULL;
691} 702}
692 703
693void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata) 704void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
@@ -695,7 +706,7 @@ void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata)
695 struct dentry *dir; 706 struct dentry *dir;
696 char buf[10 + IFNAMSIZ]; 707 char buf[10 + IFNAMSIZ];
697 708
698 dir = sdata->debugfs.dir; 709 dir = sdata->vif.debugfs_dir;
699 710
700 if (!dir) 711 if (!dir)
701 return; 712 return;