staging: wfx: retrieve ampdu_density from sta->ht_cap
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Wed, 15 Jan 2020 13:54:17 +0000 (13:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jan 2020 19:59:46 +0000 (20:59 +0100)
wvif->ht_info.ht_cap is a useless copy of sta->ht_cap. It makes no sense
to rely on it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/sta.c

index 660a75024f4b62bbf49cc305a7920ee1337050d6..f13a5b41735cf20136aaa477a8b0dffea07571a2 100644 (file)
@@ -825,13 +825,6 @@ static int wfx_ht_greenfield(const struct wfx_ht_info *ht_info)
                  IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
 }
 
-static int wfx_ht_ampdu_density(const struct wfx_ht_info *ht_info)
-{
-       if (!wfx_is_ht(ht_info))
-               return 0;
-       return ht_info->ht_cap.ampdu_density;
-}
-
 static void wfx_join_finalize(struct wfx_vif *wvif,
                              struct ieee80211_bss_conf *info)
 {
@@ -870,7 +863,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
        association_mode.short_preamble = info->use_short_preamble;
        association_mode.basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, info->basic_rates));
        association_mode.greenfield = wfx_ht_greenfield(&wvif->ht_info);
-       association_mode.mpdu_start_spacing = wfx_ht_ampdu_density(&wvif->ht_info);
+       if (sta && sta->ht_cap.ht_supported)
+               association_mode.mpdu_start_spacing = sta->ht_cap.ampdu_density;
 
        wfx_cqm_bssloss_sm(wvif, 0, 0, 0);
        cancel_work_sync(&wvif->unjoin_work);