aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-04-22 15:07:39 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-05-05 08:21:55 -0400
commit56ff51084eadf61a93941e9a2a20608d8dd45711 (patch)
tree3a6816dfc13a4d3b14b3aa0bddb19ef5b276761a /net/mac80211
parentf83f1c129a6f29830de74a47521dd68e57914579 (diff)
mac80211: clean up station debugfs
Remove items that can be retrieved through nl80211. This also removes two items (tx_packets and tx_bytes) where only the VO counter was exposed since they are split up per AC but in the debugfs file only the first AC was shown. Also remove the useless "dev" file - the stations have long been in a sub-directory of the netdev so there's no need for that any more. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/debugfs_sta.c84
1 files changed, 0 insertions, 84 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 7ca601414000..06d52935036d 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -29,8 +29,6 @@ static ssize_t sta_ ##name## _read(struct file *file, \
29 format_string, sta->field); \ 29 format_string, sta->field); \
30} 30}
31#define STA_READ_D(name, field) STA_READ(name, field, "%d\n") 31#define STA_READ_D(name, field) STA_READ(name, field, "%d\n")
32#define STA_READ_U(name, field) STA_READ(name, field, "%u\n")
33#define STA_READ_S(name, field) STA_READ(name, field, "%s\n")
34 32
35#define STA_OPS(name) \ 33#define STA_OPS(name) \
36static const struct file_operations sta_ ##name## _ops = { \ 34static const struct file_operations sta_ ##name## _ops = { \
@@ -52,10 +50,7 @@ static const struct file_operations sta_ ##name## _ops = { \
52 STA_OPS(name) 50 STA_OPS(name)
53 51
54STA_FILE(aid, sta.aid, D); 52STA_FILE(aid, sta.aid, D);
55STA_FILE(dev, sdata->name, S);
56STA_FILE(last_signal, last_signal, D);
57STA_FILE(last_ack_signal, last_ack_signal, D); 53STA_FILE(last_ack_signal, last_ack_signal, D);
58STA_FILE(beacon_loss_count, beacon_loss_count, D);
59 54
60static ssize_t sta_flags_read(struct file *file, char __user *userbuf, 55static ssize_t sta_flags_read(struct file *file, char __user *userbuf,
61 size_t count, loff_t *ppos) 56 size_t count, loff_t *ppos)
@@ -101,40 +96,6 @@ static ssize_t sta_num_ps_buf_frames_read(struct file *file,
101} 96}
102STA_OPS(num_ps_buf_frames); 97STA_OPS(num_ps_buf_frames);
103 98
104static ssize_t sta_inactive_ms_read(struct file *file, char __user *userbuf,
105 size_t count, loff_t *ppos)
106{
107 struct sta_info *sta = file->private_data;
108 return mac80211_format_buffer(userbuf, count, ppos, "%d\n",
109 jiffies_to_msecs(jiffies - sta->last_rx));
110}
111STA_OPS(inactive_ms);
112
113
114static ssize_t sta_connected_time_read(struct file *file, char __user *userbuf,
115 size_t count, loff_t *ppos)
116{
117 struct sta_info *sta = file->private_data;
118 struct timespec uptime;
119 struct tm result;
120 long connected_time_secs;
121 char buf[100];
122 int res;
123 ktime_get_ts(&uptime);
124 connected_time_secs = uptime.tv_sec - sta->last_connected;
125 time_to_tm(connected_time_secs, 0, &result);
126 result.tm_year -= 70;
127 result.tm_mday -= 1;
128 res = scnprintf(buf, sizeof(buf),
129 "years - %ld\nmonths - %d\ndays - %d\nclock - %d:%d:%d\n\n",
130 result.tm_year, result.tm_mon, result.tm_mday,
131 result.tm_hour, result.tm_min, result.tm_sec);
132 return simple_read_from_buffer(userbuf, count, ppos, buf, res);
133}
134STA_OPS(connected_time);
135
136
137
138static ssize_t sta_last_seq_ctrl_read(struct file *file, char __user *userbuf, 99static ssize_t sta_last_seq_ctrl_read(struct file *file, char __user *userbuf,
139 size_t count, loff_t *ppos) 100 size_t count, loff_t *ppos)
140{ 101{
@@ -359,37 +320,6 @@ static ssize_t sta_vht_capa_read(struct file *file, char __user *userbuf,
359} 320}
360STA_OPS(vht_capa); 321STA_OPS(vht_capa);
361 322
362static ssize_t sta_current_tx_rate_read(struct file *file, char __user *userbuf,
363 size_t count, loff_t *ppos)
364{
365 struct sta_info *sta = file->private_data;
366 struct rate_info rinfo;
367 u16 rate;
368 sta_set_rate_info_tx(sta, &sta->last_tx_rate, &rinfo);
369 rate = cfg80211_calculate_bitrate(&rinfo);
370
371 return mac80211_format_buffer(userbuf, count, ppos,
372 "%d.%d MBit/s\n",
373 rate/10, rate%10);
374}
375STA_OPS(current_tx_rate);
376
377static ssize_t sta_last_rx_rate_read(struct file *file, char __user *userbuf,
378 size_t count, loff_t *ppos)
379{
380 struct sta_info *sta = file->private_data;
381 struct rate_info rinfo;
382 u16 rate;
383
384 sta_set_rate_info_rx(sta, &rinfo);
385
386 rate = cfg80211_calculate_bitrate(&rinfo);
387
388 return mac80211_format_buffer(userbuf, count, ppos,
389 "%d.%d MBit/s\n",
390 rate/10, rate%10);
391}
392STA_OPS(last_rx_rate);
393 323
394#define DEBUGFS_ADD(name) \ 324#define DEBUGFS_ADD(name) \
395 debugfs_create_file(#name, 0400, \ 325 debugfs_create_file(#name, 0400, \
@@ -432,29 +362,15 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
432 362
433 DEBUGFS_ADD(flags); 363 DEBUGFS_ADD(flags);
434 DEBUGFS_ADD(num_ps_buf_frames); 364 DEBUGFS_ADD(num_ps_buf_frames);
435 DEBUGFS_ADD(inactive_ms);
436 DEBUGFS_ADD(connected_time);
437 DEBUGFS_ADD(last_seq_ctrl); 365 DEBUGFS_ADD(last_seq_ctrl);
438 DEBUGFS_ADD(agg_status); 366 DEBUGFS_ADD(agg_status);
439 DEBUGFS_ADD(dev);
440 DEBUGFS_ADD(last_signal);
441 DEBUGFS_ADD(beacon_loss_count);
442 DEBUGFS_ADD(ht_capa); 367 DEBUGFS_ADD(ht_capa);
443 DEBUGFS_ADD(vht_capa); 368 DEBUGFS_ADD(vht_capa);
444 DEBUGFS_ADD(last_ack_signal); 369 DEBUGFS_ADD(last_ack_signal);
445 DEBUGFS_ADD(current_tx_rate);
446 DEBUGFS_ADD(last_rx_rate);
447 370
448 DEBUGFS_ADD_COUNTER(rx_packets, rx_packets);
449 DEBUGFS_ADD_COUNTER(tx_packets, tx_packets);
450 DEBUGFS_ADD_COUNTER(rx_bytes, rx_bytes);
451 DEBUGFS_ADD_COUNTER(tx_bytes, tx_bytes);
452 DEBUGFS_ADD_COUNTER(rx_duplicates, num_duplicates); 371 DEBUGFS_ADD_COUNTER(rx_duplicates, num_duplicates);
453 DEBUGFS_ADD_COUNTER(rx_fragments, rx_fragments); 372 DEBUGFS_ADD_COUNTER(rx_fragments, rx_fragments);
454 DEBUGFS_ADD_COUNTER(rx_dropped, rx_dropped);
455 DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count); 373 DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count);
456 DEBUGFS_ADD_COUNTER(tx_retry_failed, tx_retry_failed);
457 DEBUGFS_ADD_COUNTER(tx_retry_count, tx_retry_count);
458 374
459 if (sizeof(sta->driver_buffered_tids) == sizeof(u32)) 375 if (sizeof(sta->driver_buffered_tids) == sizeof(u32))
460 debugfs_create_x32("driver_buffered_tids", 0400, 376 debugfs_create_x32("driver_buffered_tids", 0400,