linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known
@ 2011-10-26 13:47 Arik Nemtsov
  2011-10-27 14:22 ` Jouni Malinen
  0 siblings, 1 reply; 4+ messages in thread
From: Arik Nemtsov @ 2011-10-26 13:47 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, Arik Nemtsov

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 <arik@wizery.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known
  2011-10-26 13:47 [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known Arik Nemtsov
@ 2011-10-27 14:22 ` Jouni Malinen
  2011-11-07 18:11   ` John W. Linville
  0 siblings, 1 reply; 4+ messages in thread
From: Jouni Malinen @ 2011-10-27 14:22 UTC (permalink / raw)
  To: Arik Nemtsov; +Cc: linux-wireless, Johannes Berg

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known
  2011-10-27 14:22 ` Jouni Malinen
@ 2011-11-07 18:11   ` John W. Linville
  2011-11-07 21:22     ` Arik Nemtsov
  0 siblings, 1 reply; 4+ messages in thread
From: John W. Linville @ 2011-11-07 18:11 UTC (permalink / raw)
  To: Jouni Malinen; +Cc: Arik Nemtsov, linux-wireless, Johannes Berg

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 <j@w1.fi>
	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 <j@w1.fi>
	    Signed-off-by: John W. Linville <linville@tuxdriver.com>

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
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known
  2011-11-07 18:11   ` John W. Linville
@ 2011-11-07 21:22     ` Arik Nemtsov
  0 siblings, 0 replies; 4+ messages in thread
From: Arik Nemtsov @ 2011-11-07 21:22 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jouni Malinen, linux-wireless, Johannes Berg

On Mon, Nov 7, 2011 at 20:11, John W. Linville <linville@tuxdriver.com> wrote:
> I merged this patch from Jouni:
>
>        commit e3a4cc2f073739c9c9c2e97efc774703061f034a
>        Author: Jouni Malinen <j@w1.fi>
>        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 <j@w1.fi>
>            Signed-off-by: John W. Linville <linville@tuxdriver.com>
>
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-07 21:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-26 13:47 [PATCH] mac80211: init rate-control for TDLS sta when supp-rates are known Arik Nemtsov
2011-10-27 14:22 ` Jouni Malinen
2011-11-07 18:11   ` John W. Linville
2011-11-07 21:22     ` Arik Nemtsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).