summaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2018-12-15 04:03:04 -0500
committerJohannes Berg <johannes.berg@intel.com>2018-12-18 08:18:49 -0500
commit55ebd6e6c765cce4697a6fbb97acf6eec9ad7a51 (patch)
tree634e0339d46f379bbe775cd055946585af1b32c3 /net/mac80211/mlme.c
parentfdb313e3182094939b34234bdade0fbce28dfb2c (diff)
mac80211: propagate the support for TWT to the driver
TWT is a feature that was added in 11ah and enhanced in 11ax. There are two bits that need to be set if we want to use the feature in 11ax: one in the HE Capability IE and one in the Extended Capability IE. This is because of backward compatibility between 11ah and 11ax. In order to simplify the flow for the low level driver in managed mode, aggregate the two bits and add a boolean that tells whether TWT is supported or not, but only if 11ax is supported. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d2bc8d57c87e..3d1334a4a264 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3058,6 +3058,19 @@ static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
3058 } 3058 }
3059} 3059}
3060 3060
3061static bool ieee80211_twt_req_supported(const struct sta_info *sta,
3062 const struct ieee802_11_elems *elems)
3063{
3064 if (elems->ext_capab_len < 10)
3065 return false;
3066
3067 if (!(elems->ext_capab[9] & WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT))
3068 return false;
3069
3070 return sta->sta.he_cap.he_cap_elem.mac_cap_info[0] &
3071 IEEE80211_HE_MAC_CAP0_TWT_RES;
3072}
3073
3061static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, 3074static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
3062 struct cfg80211_bss *cbss, 3075 struct cfg80211_bss *cbss,
3063 struct ieee80211_mgmt *mgmt, size_t len) 3076 struct ieee80211_mgmt *mgmt, size_t len)
@@ -3247,8 +3260,11 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
3247 sta); 3260 sta);
3248 3261
3249 bss_conf->he_support = sta->sta.he_cap.has_he; 3262 bss_conf->he_support = sta->sta.he_cap.has_he;
3263 bss_conf->twt_requester =
3264 ieee80211_twt_req_supported(sta, &elems);
3250 } else { 3265 } else {
3251 bss_conf->he_support = false; 3266 bss_conf->he_support = false;
3267 bss_conf->twt_requester = false;
3252 } 3268 }
3253 3269
3254 if (bss_conf->he_support) { 3270 if (bss_conf->he_support) {