diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index 5408fabf42..d26c17f7d7 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -530,6 +530,11 @@ struct s_ext_cap { uint8_t fine_time_meas_responder:1; uint8_t fine_time_meas_initiator:1; uint8_t fils_capability:1; + uint8_t ext_spectrum_management:1; + uint8_t future_channel_guidance:1; + uint8_t reserved7:2; + uint8_t twt_requestor_support:1; + uint8_t twt_responder_support:1; }; uint8_t sirIsPropCapabilityEnabled(struct sAniSirGlobal *pMac, uint32_t bitnum); @@ -1204,6 +1209,31 @@ static inline QDF_STATUS populate_dot11f_he_bss_color_change( return QDF_STATUS_SUCCESS; } #endif + +#ifdef WLAN_SUPPORT_TWT +/** + * populate_dot11f_twt_extended_caps() - populate TWT extended capabilities + * @mac_ctx: Global MAC context. + * @pe_session: Pointer to the PE session. + * @p_ext_cap: Pointer to the extended capabilities of the session. + * + * Populate the TWT extended capabilities based on the target and INI support. + * + * Return: tSirRetStatus Success or Failure + */ +tSirRetStatus populate_dot11f_twt_extended_caps(tpAniSirGlobal mac_ctx, + tpPESession pe_session, + struct s_ext_cap *p_ext_cap); +#else +static inline tSirRetStatus +populate_dot11f_twt_extended_caps(tpAniSirGlobal mac_ctx, + tpPESession pe_session, + struct s_ext_cap *p_ext_cap) +{ + return QDF_STATUS_SUCCESS; +} +#endif + /** * sir_unpack_beacon_ie: wrapper to unpack beacon and update def RSN params * if optional fields are not present. diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 54b6309200..2418dcc493 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -1215,6 +1215,10 @@ populate_dot11f_ext_cap(tpAniSirGlobal pMac, if (psessionEntry && psessionEntry->enable_bcast_probe_rsp) p_ext_cap->fils_capability = 1; + if (psessionEntry) + populate_dot11f_twt_extended_caps(pMac, psessionEntry, + p_ext_cap); + /* Need to calculate the num_bytes based on bits set */ if (pDot11f->present) pDot11f->num_bytes = lim_compute_ext_cap_ie_length(pDot11f); @@ -6404,4 +6408,25 @@ QDF_STATUS populate_dot11f_he_bss_color_change(tpAniSirGlobal mac_ctx, #endif #endif +#ifdef WLAN_SUPPORT_TWT +tSirRetStatus populate_dot11f_twt_extended_caps(tpAniSirGlobal mac_ctx, + tpPESession pe_session, + struct s_ext_cap *p_ext_cap) +{ + uint32_t value = 0; + tSirRetStatus status; + + if (pe_session->pePersona == QDF_STA_MODE) { + CFG_GET_INT(status, mac_ctx, WNI_CFG_TWT_REQUESTOR, value); + p_ext_cap->twt_requestor_support = value; + } + if (pe_session->pePersona == QDF_SAP_MODE) { + CFG_GET_INT(status, mac_ctx, WNI_CFG_TWT_RESPONDER, value); + p_ext_cap->twt_responder_support = value; + } + + return status; +} +#endif + /* parser_api.c ends here. */