ath9k: Enable SGI correctly
authorSujith Manoharan <c_manoha@qualcomm.com>
Wed, 12 Sep 2012 09:29:58 +0000 (14:59 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 24 Sep 2012 18:59:06 +0000 (14:59 -0400)
Set the driver specific SGI flag based on the station's
HT capabilities, otherwise rate control uses the wrong rate.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/rc.c

index 4b12c34..27ed80b 100644 (file)
@@ -1222,11 +1222,14 @@ static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta)
                        caps |= WLAN_RC_TS_FLAG | WLAN_RC_DS_FLAG;
                else if (sta->ht_cap.mcs.rx_mask[1])
                        caps |= WLAN_RC_DS_FLAG;
-               if (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40)
+               if (sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
                        caps |= WLAN_RC_40_FLAG;
-               if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40 ||
-                   sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
-                       caps |= WLAN_RC_SGI_FLAG;
+                       if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40)
+                               caps |= WLAN_RC_SGI_FLAG;
+               } else {
+                       if (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20)
+                               caps |= WLAN_RC_SGI_FLAG;
+               }
        }
 
        return caps;