mac80211: make noack test available
Johannes Berg
maintainerPATCH 1/1 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.
--- net/mac80211/debugfs.c | 38 ++++++++++++++++++++++++++++++++++++++ net/mac80211/ieee80211_i.h | 1 + net/mac80211/tx.c | 5 ++++- net/mac80211/wme.c | 2 +- 4 files changed, 44 insertions(+), 2 deletions(-)
net/mac80211/tx.c +4 -1
@@ -1087,7 +1087,10 @@ __ieee80211_tx_prepare(struct ieee80211_ info->flags |=IEEE80211_TX_CTL_NO_ACK ; }else { tx->flags |=IEEE80211_TX_UNICAST ; - info->flags &= ~IEEE80211_TX_CTL_NO_ACK ; +if (unlikely (local->wifi_wme_noack_test)) + info->flags |=IEEE80211_TX_CTL_NO_ACK ; +else + info->flags &= ~IEEE80211_TX_CTL_NO_ACK ; }if (tx->flags &IEEE80211_TX_FRAGMENTED ) {
net/mac80211/debugfs.c +38 -0
@@ -135,6 +135,42 @@ static const struct file_operations rese .open = mac80211_open_file_generic, }; +static ssize_t noack_read (struct file *file,char __user *user_buf, +size_t count,loff_t *ppos) +{ +struct ieee80211_local *local = file->private_data; +int res; +char buf[10 ]; + + res =scnprintf (buf,sizeof (buf),"%d\n" , local->wifi_wme_noack_test); + +return simple_read_from_buffer (user_buf, count, ppos, buf, res); +} + +static ssize_t noack_write (struct file *file, +const char __user *user_buf, +size_t count,loff_t *ppos) +{ +struct ieee80211_local *local = file->private_data; +char buf[10 ]; +size_t len; + + len =min (count,sizeof (buf) -1 ); +if (copy_from_user (buf, user_buf, len)) +return -EFAULT ; + buf[len] ='\0' ; + + local->wifi_wme_noack_test = !!simple_strtoul (buf,NULL ,0 ); + +return count; +} + +static const struct file_operations noack_ops = { + .read = noack_read, + .write = noack_write, + .open = mac80211_open_file_generic +}; +/* statistics stuff */ #define DEBUGFS_STATS_FILE(name, buflen, fmt, value...) \
@@ -275,6 +311,7 @@ void debugfs_hw_add(struct ieee80211_locDEBUGFS_ADD (wep_iv);DEBUGFS_ADD (tsf);DEBUGFS_ADD_MODE (reset,0200 ); +DEBUGFS_ADD (noack); statsd =debugfs_create_dir ("statistics" , phyd); local->debugfs.statistics = statsd;
@@ -330,6 +367,7 @@ void debugfs_hw_del(struct ieee80211_locDEBUGFS_DEL (wep_iv);DEBUGFS_DEL (tsf);DEBUGFS_DEL (reset); +DEBUGFS_DEL (noack);DEBUGFS_STATS_DEL (transmitted_fragment_count);DEBUGFS_STATS_DEL (multicast_transmitted_frame_count);
net/mac80211/ieee80211_i.h +1 -0
@@ -766,6 +766,7 @@ struct ieee80211_local {struct dentry *wep_iv;struct dentry *tsf;struct dentry *reset; +struct dentry *noack;struct dentry *statistics;struct local_debugfsdentries_statsdentries {struct dentry *transmitted_fragment_count;
net/mac80211/wme.c +1 -1
@@ -133,7 +133,7 @@ u16 ieee80211_select_queue(struct net_deu8 *p =ieee80211_get_qos_ctl (hdr);u8 ack_policy =0 ; tid = skb->priority &IEEE80211_QOS_CTL_TAG1D_MASK ; -if (local->wifi_wme_noack_test) +if (unlikely (local->wifi_wme_noack_test)) ack_policy |=QOS_CONTROL_ACK_POLICY_NOACK <<QOS_CONTROL_ACK_POLICY_SHIFT ;/* qos header is 2 bytes, second reserved */
Quoted 10 lines · Johannes Berg
There's this internal
wifi_wme_noack_testvariable 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 theIEEE80211_TX_CTL_NO_ACKTX 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 <[email protected]>---
=A0net/mac80211/debugfs.c =A0 =A0 | =A0 38 ++++++++++++++++++++++++++=
++++++++++++
Quoted 6 lines
=A0net/mac80211/ieee80211_i.h | =A0 =A01 + =A0net/mac80211/tx.c =A0 =A0 =A0 =A0 =A0| =A0 =A05 ++++- =A0net/mac80211/wme.c =A0 =A0 =A0 =A0 | =A0 =A02 +- =A04 files changed, 44 insertions(+), 2 deletions(-)
---
wireless-testing.orig/net/mac80211/tx.c=A0 =A0 2009-05-12 21:44:=
01.000000000 +0200
Quoted 1 line
+++
wireless-testing/net/mac80211/tx.c=A02009-05-12 22:03:26.0000000=
00 +0200
Quoted 2 lines
(quoted diff) +0
-0@@ -1087,7 +1087,10 @@ __ieee80211_tx_prepare(struct ieee80211_=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0info->flags |=3D IEEE80211_TX_CTL_NO_A=
CK;
Quoted 3 lines
=A0 =A0 =A0 =A0} else {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tx->flags |=3DIEEE80211_TX_UNICAST;
- =A0 =A0 =A0 =A0 =A0 =A0 =A0info->flags&=3D ~IEEE80211_TX_CTL_NO_A=
CK;
Quoted 1 line
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (unlikely(local->wifi_wme_noack_test=
))
Quoted 1 line
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
info->flags|=3D IEEE80=
211_TX_CTL_NO_ACK;
Quoted 2 lines
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 else
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0info->flags&=3D ~IEEE8=
0211_TX_CTL_NO_ACK;
Quoted 1 line
=A0 =A0 =A0 =A0}
While you are at it, why not clean up this code completely? IMHO the unset-bit operations are useless, given that both TX_UNICAST and TX_CTL_NO_ACK are initialized to zero at the beginning of __ieee80211_tx_prepare. This also makes it possible to set TX_CTL_NO_ACK in a TX handler, which is IMO much nicer (not to mention that it significantly simplifies the work needed to support Radiotap's TX flags once they land).
(BTW should we implement the already-stable parts of TX flags now, or is it a better idea to wait till it is final?)
--G=E1bor
--=20
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-) --
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Berg
maintainerQuoted 17 lines · Gábor Stefanik
Quoted 15 lines · Johannes Berg
There's this internal
wifi_wme_noack_testvariable 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 theIEEE80211_TX_CTL_NO_ACKTX 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 <[email protected]>--- net/mac80211/debugfs.c | 38 ++++++++++++++++++++++++++++++++++++++ net/mac80211/ieee80211_i.h | 1 + net/mac80211/tx.c | 5 ++++- net/mac80211/wme.c | 2 +- 4 files changed, 44 insertions(+), 2 deletions(-)
Quoted 14 lines
net/mac80211/tx.c 2009-05-12 22:03:26.000000000 +0200 __ieee80211_tx_prepare(struct ieee80211_ · line 1094
Quoted 12 lines
net/mac80211/tx.c 2009-05-12 22:03:26.000000000 +0200 renamed from net/mac80211/tx.c 2009-05-12 21:44:01.000000000 +0200 +4
-1@@ -1087,7 +1087,10 @@ __ieee80211_tx_prepare(struct ieee80211_ info->flags |= IEEE80211_TX_CTL_NO_ACK; } else { tx->flags |= IEEE80211_TX_UNICAST; - info->flags &= ~IEEE80211_TX_CTL_NO_ACK; + if (unlikely(local->wifi_wme_noack_test)) + info->flags |= IEEE80211_TX_CTL_NO_ACK; + else + info->flags &= ~IEEE80211_TX_CTL_NO_ACK; }While you are at it, why not clean up this code completely?
Because I'm lazy.
Quoted 4 lines
IMHO the
unset-bit operations are useless, given that bothTX_UNICASTandTX_CTL_NO_ACKare initialized to zero at the beginning of__ieee80211_tx_prepare.
Probably. But it works, why change it :)
Quoted 4 lines
This also makes it possible to set
TX_CTL_NO_ACKin a TX handler, which is IMO much nicer (not to mention that it significantly simplifies the work needed to support Radiotap's TX flags once they land).
That seems to serve only you ;)
Quoted 2 lines
(BTW should we implement the already-stable parts of TX flags now, or is it a better idea to wait till it is final?)
Wait until it's final please.
johannes
2009/5/13 Johannes Berg <[email protected]>:
Quoted 10 lines · On Wed, 2009-05-13 at 00:13 +0200, G=E1bor Stefanik wrote:
Quoted 9 lines
Quoted 7 lines · Johannes Berg
There's this internal
wifi_wme_noack_testvariable 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 theIEEE80211_TX_CTL_NO_ACKTX control flag, and finally we should also be able to set it at all, so make it available in debugfs.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Signed-off-by Johannes Berg <[email protected]>---
=A0net/mac80211/debugfs.c =A0 =A0 | =A0 38 +++++++++++++++++++++++=
+++++++++++++++
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
=A0net/mac80211/ieee80211_i.h | =A0 =A01 + =A0net/mac80211/tx.c =A0 =A0 =A0 =A0 =A0| =A0 =A05 ++++- =A0net/mac80211/wme.c =A0 =A0 =A0 =A0 | =A0 =A02 +- =A04 files changed, 44 insertions(+), 2 deletions(-)
---
wireless-testing.orig/net/mac80211/tx.c=A0 =A0 2009-05-12 21:=
44:01.000000000 +0200
Quoted 1 line
Quoted 1 line
Quoted 1 line
+++
wireless-testing/net/mac80211/tx.c=A02009-05-12 22:03:26.0000=
00000 +0200
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(quoted diff) +0
-0@@ -1087,7 +1087,10 @@ __ieee80211_tx_prepare(struct ieee80211_=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0info->flags |=3D IEEE80211_TX_CTL_N=
O_ACK;
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
=A0 =A0 =A0 =A0} else {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tx->flags |=3D IEEE80211_TX_UNICAST=
;
Quoted 1 line
Quoted 1 line
Quoted 1 line
- =A0 =A0 =A0 =A0 =A0 =A0 =A0
info->flags&=3D ~IEEE80211_TX_CTL_N=
O_ACK;
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (unlikely(local->wifi_wme_noack_t=
est))
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
info->flags|=3D IEE=
E80211_TX_CTL_NO_ACK;
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 else
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0info->flags&=3D ~IE=
EE80211_TX_CTL_NO_ACK;
Quoted 4 lines
Quoted 3 lines
Quoted 1 line
=A0 =A0 =A0 =A0}
While you are at it, why not clean up this code completely?
Quoted 11 lines
Because I'm lazy.
Quoted 4 lines
IMHO the
unset-bit operations are useless, given that bothTX_UNICASTandTX_CTL_NO_ACKare initialized to zero at the beginning of__ieee80211_tx_prepare.Probably. But it works, why change it :)
Quoted 2 lines
This also makes it possible to set
TX_CTL_NO_ACKin a TX handler, which is IMO much nicer (not to menti=
on
Quoted 1 line
Quoted 1 line
that it significantly simplifies the work needed to support Radiotap=
's
Quoted 3 lines
Quoted 1 line
TX flags once they land).
That seems to serve only you ;)
I mean, you can put the noack_test check in a more relevant part of the code if we don't re-zero these bits in tx_prepare.
Quoted 2 lines
Quoted 2 lines
(BTW should we implement the already-stable parts of TX flags now, o=
r
Quoted 6 lines
Quoted 1 line
is it a better idea to wait till it is final?)
Wait until it's final please.
johannes
--=20
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-) --
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Berg
maintainerQuoted 12 lines · Gábor Stefanik
Quoted 12 lines
Quoted 4 lines
IMHO the
unset-bit operations are useless, given that bothTX_UNICASTandTX_CTL_NO_ACKare initialized to zero at the beginning of__ieee80211_tx_prepare.Probably. But it works, why change it :)
Quoted 4 lines
This also makes it possible to set
TX_CTL_NO_ACKin a TX handler, which is IMO much nicer (not to mention that it significantly simplifies the work needed to support Radiotap's TX flags once they land).
Quoted 4 lines
Quoted 1 line
That seems to serve only you ;)
I mean, you can put the
noack_testcheck in a more relevant part of the code if we don't re-zero these bits intx_prepare.
Huh? What part of the code would be more relevant to that than the bit where it checks for mcast etc?
johannes