From ba0b4fc472c08e805cdaa4bfd6d08d8a471e7f4e Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Fri, 23 Feb 2018 15:42:11 -0800 Subject: [PATCH] qcacld-3.0: Populate extended capabilities for TWT Populate Extended capablities for TWT requestor and responder. Set the capabilities accordingly for STA and AP and populate them into extcaps IE and pack them along with the association request. Change-Id: I38df774fa6dc96459f0d08453f48d6646852dbb8 CRs-Fixed: 2264631 --- core/mac/src/include/parser_api.h | 30 +++++++++++++++++++ .../src/sys/legacy/src/utils/src/parser_api.c | 25 ++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index 5408fabf42b2..d26c17f7d7bb 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 54b630920073..2418dcc49374 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. */