diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-06-01 20:57:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-03 14:14:41 -0400 |
commit | 2826bcd844e05dcbef9b9284bddb7fe88e8d314f (patch) | |
tree | a95085b75ba4299c77571e024e37e84da54f9db3 /net/mac80211/debugfs_sta.c | |
parent | 84642d6bdde9164b7905fba03c0691a806788e0c (diff) |
mac80211: reduce debugfs code size
This patch reduces the binary size by around 25k (measured on MIPS,
with CONFIG_MAC80211_DEBUG_COUNTERS enabled).
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/debugfs_sta.c')
-rw-r--r-- | net/mac80211/debugfs_sta.c | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c index 9f140612224a..576e024715e3 100644 --- a/net/mac80211/debugfs_sta.c +++ b/net/mac80211/debugfs_sta.c | |||
@@ -30,7 +30,6 @@ static ssize_t sta_ ##name## _read(struct file *file, \ | |||
30 | } | 30 | } |
31 | #define STA_READ_D(name, field) STA_READ(name, 20, field, "%d\n") | 31 | #define STA_READ_D(name, field) STA_READ(name, 20, field, "%d\n") |
32 | #define STA_READ_U(name, field) STA_READ(name, 20, field, "%u\n") | 32 | #define STA_READ_U(name, field) STA_READ(name, 20, field, "%u\n") |
33 | #define STA_READ_LU(name, field) STA_READ(name, 20, field, "%lu\n") | ||
34 | #define STA_READ_S(name, field) STA_READ(name, 20, field, "%s\n") | 33 | #define STA_READ_S(name, field) STA_READ(name, 20, field, "%s\n") |
35 | 34 | ||
36 | #define STA_OPS(name) \ | 35 | #define STA_OPS(name) \ |
@@ -52,19 +51,7 @@ static const struct file_operations sta_ ##name## _ops = { \ | |||
52 | 51 | ||
53 | STA_FILE(aid, sta.aid, D); | 52 | STA_FILE(aid, sta.aid, D); |
54 | STA_FILE(dev, sdata->name, S); | 53 | STA_FILE(dev, sdata->name, S); |
55 | STA_FILE(rx_packets, rx_packets, LU); | ||
56 | STA_FILE(tx_packets, tx_packets, LU); | ||
57 | STA_FILE(rx_bytes, rx_bytes, LU); | ||
58 | STA_FILE(tx_bytes, tx_bytes, LU); | ||
59 | STA_FILE(rx_duplicates, num_duplicates, LU); | ||
60 | STA_FILE(rx_fragments, rx_fragments, LU); | ||
61 | STA_FILE(rx_dropped, rx_dropped, LU); | ||
62 | STA_FILE(tx_fragments, tx_fragments, LU); | ||
63 | STA_FILE(tx_filtered, tx_filtered_count, LU); | ||
64 | STA_FILE(tx_retry_failed, tx_retry_failed, LU); | ||
65 | STA_FILE(tx_retry_count, tx_retry_count, LU); | ||
66 | STA_FILE(last_signal, last_signal, D); | 54 | STA_FILE(last_signal, last_signal, D); |
67 | STA_FILE(wep_weak_iv_count, wep_weak_iv_count, LU); | ||
68 | 55 | ||
69 | static ssize_t sta_flags_read(struct file *file, char __user *userbuf, | 56 | static ssize_t sta_flags_read(struct file *file, char __user *userbuf, |
70 | size_t count, loff_t *ppos) | 57 | size_t count, loff_t *ppos) |
@@ -306,6 +293,13 @@ STA_OPS(ht_capa); | |||
306 | debugfs_create_file(#name, 0400, \ | 293 | debugfs_create_file(#name, 0400, \ |
307 | sta->debugfs.dir, sta, &sta_ ##name## _ops); | 294 | sta->debugfs.dir, sta, &sta_ ##name## _ops); |
308 | 295 | ||
296 | #define DEBUGFS_ADD_COUNTER(name, field) \ | ||
297 | if (sizeof(sta->field) == sizeof(u32)) \ | ||
298 | debugfs_create_u32(#name, 0400, sta->debugfs.dir, \ | ||
299 | (u32 *) &sta->field); \ | ||
300 | else \ | ||
301 | debugfs_create_u64(#name, 0400, sta->debugfs.dir, \ | ||
302 | (u64 *) &sta->field); | ||
309 | 303 | ||
310 | void ieee80211_sta_debugfs_add(struct sta_info *sta) | 304 | void ieee80211_sta_debugfs_add(struct sta_info *sta) |
311 | { | 305 | { |
@@ -338,20 +332,21 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta) | |||
338 | DEBUGFS_ADD(last_seq_ctrl); | 332 | DEBUGFS_ADD(last_seq_ctrl); |
339 | DEBUGFS_ADD(agg_status); | 333 | DEBUGFS_ADD(agg_status); |
340 | DEBUGFS_ADD(dev); | 334 | DEBUGFS_ADD(dev); |
341 | DEBUGFS_ADD(rx_packets); | ||
342 | DEBUGFS_ADD(tx_packets); | ||
343 | DEBUGFS_ADD(rx_bytes); | ||
344 | DEBUGFS_ADD(tx_bytes); | ||
345 | DEBUGFS_ADD(rx_duplicates); | ||
346 | DEBUGFS_ADD(rx_fragments); | ||
347 | DEBUGFS_ADD(rx_dropped); | ||
348 | DEBUGFS_ADD(tx_fragments); | ||
349 | DEBUGFS_ADD(tx_filtered); | ||
350 | DEBUGFS_ADD(tx_retry_failed); | ||
351 | DEBUGFS_ADD(tx_retry_count); | ||
352 | DEBUGFS_ADD(last_signal); | 335 | DEBUGFS_ADD(last_signal); |
353 | DEBUGFS_ADD(wep_weak_iv_count); | ||
354 | DEBUGFS_ADD(ht_capa); | 336 | DEBUGFS_ADD(ht_capa); |
337 | |||
338 | DEBUGFS_ADD_COUNTER(rx_packets, rx_packets); | ||
339 | DEBUGFS_ADD_COUNTER(tx_packets, tx_packets); | ||
340 | DEBUGFS_ADD_COUNTER(rx_bytes, rx_bytes); | ||
341 | DEBUGFS_ADD_COUNTER(tx_bytes, tx_bytes); | ||
342 | DEBUGFS_ADD_COUNTER(rx_duplicates, num_duplicates); | ||
343 | DEBUGFS_ADD_COUNTER(rx_fragments, rx_fragments); | ||
344 | DEBUGFS_ADD_COUNTER(rx_dropped, rx_dropped); | ||
345 | DEBUGFS_ADD_COUNTER(tx_fragments, tx_fragments); | ||
346 | DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count); | ||
347 | DEBUGFS_ADD_COUNTER(tx_retry_failed, tx_retry_failed); | ||
348 | DEBUGFS_ADD_COUNTER(tx_retry_count, tx_retry_count); | ||
349 | DEBUGFS_ADD_COUNTER(wep_weak_iv_count, wep_weak_iv_count); | ||
355 | } | 350 | } |
356 | 351 | ||
357 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) | 352 | void ieee80211_sta_debugfs_remove(struct sta_info *sta) |