Skip to content

Commit 55ebd6e

Browse files
egrumbachjmberg-intel
authored andcommitted
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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent fdb313e commit 55ebd6e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

include/net/mac80211.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@ struct ieee80211_ftm_responder_params {
496496
* @uora_ocw_range: UORA element's OCW Range field
497497
* @frame_time_rts_th: HE duration RTS threshold, in units of 32us
498498
* @he_support: does this BSS support HE
499+
* @twt_requester: does this BSS support TWT requester (relevant for managed
500+
* mode only, set if the AP advertises TWT responder role)
499501
* @assoc: association status
500502
* @ibss_joined: indicates whether this station is part of an IBSS
501503
* or not
@@ -594,6 +596,7 @@ struct ieee80211_bss_conf {
594596
u8 uora_ocw_range;
595597
u16 frame_time_rts_th;
596598
bool he_support;
599+
bool twt_requester;
597600
/* association related data */
598601
bool assoc, ibss_joined;
599602
bool ibss_creator;

net/mac80211/mlme.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,6 +3058,19 @@ static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
30583058
}
30593059
}
30603060

3061+
static 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+
30613074
static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
30623075
struct cfg80211_bss *cbss,
30633076
struct ieee80211_mgmt *mgmt, size_t len)
@@ -3247,8 +3260,11 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
32473260
sta);
32483261

32493262
bss_conf->he_support = sta->sta.he_cap.has_he;
3263+
bss_conf->twt_requester =
3264+
ieee80211_twt_req_supported(sta, &elems);
32503265
} else {
32513266
bss_conf->he_support = false;
3267+
bss_conf->twt_requester = false;
32523268
}
32533269

32543270
if (bss_conf->he_support) {

0 commit comments

Comments
 (0)