Skip to content

Commit

Permalink
mac80211: init rate-control for TDLS sta when supp-rates are known
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Arik Nemtsov authored and John W. Linville committed Nov 11, 2011
1 parent dd9dfb9 commit d64cf63
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,12 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,

sta_apply_parameters(local, sta, params);

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;
Expand Down Expand Up @@ -953,6 +958,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 &&
Expand Down

0 comments on commit d64cf63

Please sign in to comment.