summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx/sta.c
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2020-01-15 13:54:19 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-16 20:59:46 +0100
commit08dced7f7fe921a3880fd799583a5a85c348b85d (patch)
treedc6efd9b81a0542f5f765616b86b90e99b9d39f5 /drivers/staging/wfx/sta.c
parentc08ffbf7c02bddedda9e2945a9934e2651436706 (diff)
staging: wfx: retrieve greenfield mode from sta->ht_cap and bss_conf
wvif->ht_info contains useless copies of sta->ht_cap and bss_conf->ht_operation_mode. Prefer to retrieve information from the original structs instead of rely on wvif->ht_info. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20200115135338.14374-13-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/sta.c')
-rw-r--r--drivers/staging/wfx/sta.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index f13a5b41735c..fcd9fe66e417 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -817,14 +817,6 @@ static int wfx_is_ht(const struct wfx_ht_info *ht_info)
return ht_info->channel_type != NL80211_CHAN_NO_HT;
}
-static int wfx_ht_greenfield(const struct wfx_ht_info *ht_info)
-{
- return wfx_is_ht(ht_info) &&
- (ht_info->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) &&
- !(ht_info->operation_mode &
- IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
-}
-
static void wfx_join_finalize(struct wfx_vif *wvif,
struct ieee80211_bss_conf *info)
{
@@ -849,9 +841,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
}
rcu_read_unlock();
- /* Non Greenfield stations present */
- if (wvif->ht_info.operation_mode &
- IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)
+ if (sta &&
+ info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)
hif_dual_cts_protection(wvif, true);
else
hif_dual_cts_protection(wvif, false);
@@ -862,7 +853,10 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
association_mode.spacing = 1;
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);
+ if (sta && sta->ht_cap.ht_supported &&
+ !(info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT))
+ association_mode.greenfield =
+ !!(sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD);
if (sta && sta->ht_cap.ht_supported)
association_mode.mpdu_start_spacing = sta->ht_cap.ampdu_density;