mac80211: don't transmit 40MHz frames to 20MHz peer
authorThomas Pedersen <thomas@cozybit.com>
Thu, 26 Apr 2012 22:01:07 +0000 (15:01 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 9 May 2012 01:53:42 +0000 (21:53 -0400)
If a mesh peer indicates it is operating as 20MHz-only in its HT
operation IE, have the rate control algorithm respect this by disabling
the equivalent bit in the ieee80211_sta HT capabilities.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mesh_plink.c

index f4124d7..6209327 100644 (file)
@@ -302,6 +302,12 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
        else
                memset(&sta->sta.ht_cap, 0, sizeof(sta->sta.ht_cap));
 
+       if (elems->ht_operation)
+               if (!(elems->ht_operation->ht_param &
+                     IEEE80211_HT_PARAM_CHAN_WIDTH_ANY))
+                       sta->sta.ht_cap.cap &=
+                                           ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
+
        rate_control_rate_init(sta);
        spin_unlock_bh(&sta->lock);