diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-05-12 16:05:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-13 15:44:53 -0400 |
commit | d3707d9918d47c0997a6b1e4ae24e7ab55e43796 (patch) | |
tree | dd05505563ae8b02bfd1a5db5d5bdde6e6750798 /net/mac80211/debugfs.c | |
parent | b59066a291ca7c12a1e5b58f3ada5ab6e32cb6bd (diff) |
mac80211: make noack test available
There's this internal wifi_wme_noack_test variable that
we use to set the QoS control if set. For one, it is
unlikely that it is set. Secondly, if set it needs to
influence the IEEE80211_TX_CTL_NO_ACK TX control flag,
and finally we should also be able to set it at all, so
make it available in debugfs.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/debugfs.c')
-rw-r--r-- | net/mac80211/debugfs.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index ac793201b701..e7682fe1c590 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c | |||
@@ -135,6 +135,42 @@ static const struct file_operations reset_ops = { | |||
135 | .open = mac80211_open_file_generic, | 135 | .open = mac80211_open_file_generic, |
136 | }; | 136 | }; |
137 | 137 | ||
138 | static ssize_t noack_read(struct file *file, char __user *user_buf, | ||
139 | size_t count, loff_t *ppos) | ||
140 | { | ||
141 | struct ieee80211_local *local = file->private_data; | ||
142 | int res; | ||
143 | char buf[10]; | ||
144 | |||
145 | res = scnprintf(buf, sizeof(buf), "%d\n", local->wifi_wme_noack_test); | ||
146 | |||
147 | return simple_read_from_buffer(user_buf, count, ppos, buf, res); | ||
148 | } | ||
149 | |||
150 | static ssize_t noack_write(struct file *file, | ||
151 | const char __user *user_buf, | ||
152 | size_t count, loff_t *ppos) | ||
153 | { | ||
154 | struct ieee80211_local *local = file->private_data; | ||
155 | char buf[10]; | ||
156 | size_t len; | ||
157 | |||
158 | len = min(count, sizeof(buf) - 1); | ||
159 | if (copy_from_user(buf, user_buf, len)) | ||
160 | return -EFAULT; | ||
161 | buf[len] = '\0'; | ||
162 | |||
163 | local->wifi_wme_noack_test = !!simple_strtoul(buf, NULL, 0); | ||
164 | |||
165 | return count; | ||
166 | } | ||
167 | |||
168 | static const struct file_operations noack_ops = { | ||
169 | .read = noack_read, | ||
170 | .write = noack_write, | ||
171 | .open = mac80211_open_file_generic | ||
172 | }; | ||
173 | |||
138 | /* statistics stuff */ | 174 | /* statistics stuff */ |
139 | 175 | ||
140 | #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \ | 176 | #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \ |
@@ -275,6 +311,7 @@ void debugfs_hw_add(struct ieee80211_local *local) | |||
275 | DEBUGFS_ADD(wep_iv); | 311 | DEBUGFS_ADD(wep_iv); |
276 | DEBUGFS_ADD(tsf); | 312 | DEBUGFS_ADD(tsf); |
277 | DEBUGFS_ADD_MODE(reset, 0200); | 313 | DEBUGFS_ADD_MODE(reset, 0200); |
314 | DEBUGFS_ADD(noack); | ||
278 | 315 | ||
279 | statsd = debugfs_create_dir("statistics", phyd); | 316 | statsd = debugfs_create_dir("statistics", phyd); |
280 | local->debugfs.statistics = statsd; | 317 | local->debugfs.statistics = statsd; |
@@ -330,6 +367,7 @@ void debugfs_hw_del(struct ieee80211_local *local) | |||
330 | DEBUGFS_DEL(wep_iv); | 367 | DEBUGFS_DEL(wep_iv); |
331 | DEBUGFS_DEL(tsf); | 368 | DEBUGFS_DEL(tsf); |
332 | DEBUGFS_DEL(reset); | 369 | DEBUGFS_DEL(reset); |
370 | DEBUGFS_DEL(noack); | ||
333 | 371 | ||
334 | DEBUGFS_STATS_DEL(transmitted_fragment_count); | 372 | DEBUGFS_STATS_DEL(transmitted_fragment_count); |
335 | DEBUGFS_STATS_DEL(multicast_transmitted_frame_count); | 373 | DEBUGFS_STATS_DEL(multicast_transmitted_frame_count); |