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 | |
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>
-rw-r--r-- | net/mac80211/debugfs.c | 38 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/tx.c | 5 | ||||
-rw-r--r-- | net/mac80211/wme.c | 2 |
4 files changed, 44 insertions, 2 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); |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 56a49ef446ca..9d1514727f6e 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -766,6 +766,7 @@ struct ieee80211_local { | |||
766 | struct dentry *wep_iv; | 766 | struct dentry *wep_iv; |
767 | struct dentry *tsf; | 767 | struct dentry *tsf; |
768 | struct dentry *reset; | 768 | struct dentry *reset; |
769 | struct dentry *noack; | ||
769 | struct dentry *statistics; | 770 | struct dentry *statistics; |
770 | struct local_debugfsdentries_statsdentries { | 771 | struct local_debugfsdentries_statsdentries { |
771 | struct dentry *transmitted_fragment_count; | 772 | struct dentry *transmitted_fragment_count; |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 5f9a8d7af83d..8f68bf9746d0 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1087,7 +1087,10 @@ __ieee80211_tx_prepare(struct ieee80211_tx_data *tx, | |||
1087 | info->flags |= IEEE80211_TX_CTL_NO_ACK; | 1087 | info->flags |= IEEE80211_TX_CTL_NO_ACK; |
1088 | } else { | 1088 | } else { |
1089 | tx->flags |= IEEE80211_TX_UNICAST; | 1089 | tx->flags |= IEEE80211_TX_UNICAST; |
1090 | info->flags &= ~IEEE80211_TX_CTL_NO_ACK; | 1090 | if (unlikely(local->wifi_wme_noack_test)) |
1091 | info->flags |= IEEE80211_TX_CTL_NO_ACK; | ||
1092 | else | ||
1093 | info->flags &= ~IEEE80211_TX_CTL_NO_ACK; | ||
1091 | } | 1094 | } |
1092 | 1095 | ||
1093 | if (tx->flags & IEEE80211_TX_FRAGMENTED) { | 1096 | if (tx->flags & IEEE80211_TX_FRAGMENTED) { |
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 0b8ad1f4ecdd..45b74f38b867 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -133,7 +133,7 @@ u16 ieee80211_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
133 | u8 *p = ieee80211_get_qos_ctl(hdr); | 133 | u8 *p = ieee80211_get_qos_ctl(hdr); |
134 | u8 ack_policy = 0; | 134 | u8 ack_policy = 0; |
135 | tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; | 135 | tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; |
136 | if (local->wifi_wme_noack_test) | 136 | if (unlikely(local->wifi_wme_noack_test)) |
137 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << | 137 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << |
138 | QOS_CONTROL_ACK_POLICY_SHIFT; | 138 | QOS_CONTROL_ACK_POLICY_SHIFT; |
139 | /* qos header is 2 bytes, second reserved */ | 139 | /* qos header is 2 bytes, second reserved */ |