2011-10-26 13:47:55

by Arik Nemtsov

[permalink] [raw]
Subject: [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known

Initialize rate control algorithms only when supported rates are known
for a TDLS peer sta. Direct Tx between peers is not allowed before the
link is enabled. In turn, this only occurs after a change_station()
call that sets supported rates.

Signed-off-by: Arik Nemtsov <[email protected]>
---
net/mac80211/cfg.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 1309bb9..9f05416d 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -829,7 +829,12 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
sdata->vif.type == NL80211_IFTYPE_STATION))
return -ENOTSUPP;

- rate_control_rate_init(sta);
+ /*
+ * for TDLS, rate control should be initialized only when supported
+ * rates are known.
+ */
+ if (!test_sta_flag(sta, WLAN_STA_TDLS_PEER))
+ rate_control_rate_init(sta);

layer2_update = sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
sdata->vif.type == NL80211_IFTYPE_AP;
@@ -913,6 +918,9 @@ static int ieee80211_change_station(struct wiphy *wiphy,

sta_apply_parameters(local, sta, params);

+ if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && params->supported_rates)
+ rate_control_rate_init(sta);
+
rcu_read_unlock();

if (sdata->vif.type == NL80211_IFTYPE_STATION &&
--
1.7.5.4



2011-10-27 14:22:58

by Jouni Malinen

[permalink] [raw]
Subject: Re: [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known

On Wed, Oct 26, 2011 at 03:47:46PM +0200, Arik Nemtsov wrote:
> Initialize rate control algorithms only when supported rates are known
> for a TDLS peer sta. Direct Tx between peers is not allowed before the
> link is enabled. In turn, this only occurs after a change_station()
> call that sets supported rates.

Thanks - this seems to fix the issues I saw previously. I tested ath9k
with this instead of my earlier patch and was able to run successfully
through my TDLS test scripts against another implementation.

--
Jouni Malinen PGP id EFC895FA

2011-11-07 21:22:28

by Arik Nemtsov

[permalink] [raw]
Subject: Re: [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known

On Mon, Nov 7, 2011 at 20:11, John W. Linville <[email protected]> wrote:
> I merged this patch from Jouni:
>
> ? ? ? ?commit e3a4cc2f073739c9c9c2e97efc774703061f034a
> ? ? ? ?Author: Jouni Malinen <[email protected]>
> ? ? ? ?Date: ? Sun Oct 23 22:36:04 2011 +0300
>
> ? ? ? ? ? ?mac80211: Fix TDLS support validation in add_station handler
>
> ? ? ? ? ? ?We need to verify whether the command is successful before allocating
> ? ? ? ? ? ?the station entry to avoid extra processing. This also fixes a memory
> ? ? ? ? ? ?leak on the error path.
>
> ? ? ? ? ? ?Signed-off-by: Jouni Malinen <[email protected]>
> ? ? ? ? ? ?Signed-off-by: John W. Linville <[email protected]>
>
> I'm not sure what to do with this patch now. ?I think I will just drop
> it, and you can send me a new patch that applies on top of Jouni's
> (perhaps even reverting it) as appropriate?

Actually the merged patch from Jouni is unrelated to this fix (and
should have been merged). There's a different patch from Jouni that
should not be applied - "mac80211: Fix STA supported rate
configuration with dummy entry".

I'll resend this one after rebasing to the latest wireless-testing
(there was a conflict).

Arik

2011-11-07 18:16:34

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known

On Thu, Oct 27, 2011 at 05:22:48PM +0300, Jouni Malinen wrote:
> On Wed, Oct 26, 2011 at 03:47:46PM +0200, Arik Nemtsov wrote:
> > Initialize rate control algorithms only when supported rates are known
> > for a TDLS peer sta. Direct Tx between peers is not allowed before the
> > link is enabled. In turn, this only occurs after a change_station()
> > call that sets supported rates.
>
> Thanks - this seems to fix the issues I saw previously. I tested ath9k
> with this instead of my earlier patch and was able to run successfully
> through my TDLS test scripts against another implementation.

I merged this patch from Jouni:

commit e3a4cc2f073739c9c9c2e97efc774703061f034a
Author: Jouni Malinen <[email protected]>
Date: Sun Oct 23 22:36:04 2011 +0300

mac80211: Fix TDLS support validation in add_station handler

We need to verify whether the command is successful before allocating
the station entry to avoid extra processing. This also fixes a memory
leak on the error path.

Signed-off-by: Jouni Malinen <[email protected]>
Signed-off-by: John W. Linville <[email protected]>

I'm not sure what to do with this patch now. I think I will just drop
it, and you can send me a new patch that applies on top of Jouni's
(perhaps even reverting it) as appropriate?

Thanks,

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.