From 4edc97d87711ab9fdcc3c05b48e1d72d49f6486a Mon Sep 17 00:00:00 2001 From: Amruta Kulkarni Date: Wed, 18 Dec 2019 16:13:07 -0800 Subject: [PATCH] qcacld-3.0: Add 6ghz HE band caps in peer_assoc cmd While sending peer_assoc_cmd to FW,add 6ghz HE band capability if chan_freq is 6ghz. Change-Id: Icfe886e8c9089d2c58609866e5bc64250c2b6eea CRs-Fixed: 2591039 --- core/mac/src/include/parser_api.h | 4 ++- core/mac/src/pe/lim/lim_assoc_utils.c | 8 +++-- core/mac/src/pe/lim/lim_utils.c | 21 ++++++++++-- core/mac/src/pe/lim/lim_utils.h | 33 +++++++++++++++++-- .../src/sys/legacy/src/utils/src/parser_api.c | 21 +++++++++++- core/wma/inc/wma_if.h | 3 +- core/wma/src/wma_he.c | 5 ++- core/wma/src/wma_mgmt.c | 3 +- 8 files changed, 85 insertions(+), 13 deletions(-) diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index f2cbf39a37b1..32079b16a0c9 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -358,6 +358,7 @@ typedef struct sSirAssocReq { tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEhs20vendor_ie hs20vendor_ie; tDot11fIEhe_cap he_cap; + tDot11fIEhe_6ghz_band_cap he_6ghz_band_cap; tDot11fIEqcn_ie qcn_ie; bool is_sae_authenticated; } tSirAssocReq, *tpSirAssocReq; @@ -460,6 +461,7 @@ typedef struct sSirAssocRsp { tDot11fIEqcn_ie qcn_ie; tDot11fIEhe_cap he_cap; tDot11fIEhe_op he_op; + tDot11fIEhe_6ghz_band_cap he_6ghz_band_cap; bool mu_edca_present; tSirMacEdcaParamSetIE mu_edca; #ifdef WLAN_FEATURE_FILS_SK diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 2d627452ac17..95baf3ba94d2 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2529,7 +2529,8 @@ lim_add_sta(struct mac_context *mac_ctx, lim_populate_vht_caps(vht_caps); } - lim_add_he_cap(add_sta_params, assoc_req); + lim_add_he_cap(mac_ctx, session_entry, + add_sta_params, assoc_req); } else if (LIM_IS_IBSS_ROLE(session_entry)) { @@ -3970,6 +3971,9 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp lim_update_he_6gop_assoc_resp(pAddBssParams, &pAssocRsp->he_op, pe_session); + lim_update_he_6ghz_band_caps(mac, + &pAssocRsp->he_6ghz_band_cap, + &pAddBssParams->staContext); } } pAddBssParams->staContext.smesessionId = diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 1f03bf8b0f77..77945d1b3b1c 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -6644,13 +6644,30 @@ void lim_ap_check_6g_compatible_peer(struct mac_context *mac_ctx, #endif #ifdef WLAN_FEATURE_11AX -void lim_add_he_cap(tpAddStaParams add_sta_params, tpSirAssocReq assoc_req) +void lim_update_he_6ghz_band_caps(struct mac_context *mac, + tDot11fIEhe_6ghz_band_cap *he_6ghz_band_cap, + tpAddStaParams params) +{ + qdf_mem_copy(¶ms->he_6ghz_band_caps, he_6ghz_band_cap, + sizeof(tDot11fIEhe_6ghz_band_cap)); + + lim_log_he_6g_cap(mac, ¶ms->he_6ghz_band_caps); +} + +void lim_add_he_cap(struct mac_context *mac_ctx, struct pe_session *pe_session, + tpAddStaParams add_sta_params, tpSirAssocReq assoc_req) { if (!add_sta_params->he_capable || !assoc_req) return; qdf_mem_copy(&add_sta_params->he_config, &assoc_req->he_cap, sizeof(add_sta_params->he_config)); + + if (lim_is_he_6ghz_band(pe_session)) + lim_update_he_6ghz_band_caps(mac_ctx, + &assoc_req->he_6ghz_band_cap, + add_sta_params); + } void lim_add_self_he_cap(tpAddStaParams add_sta_params, struct pe_session *session) diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index cead953dc9fd..67a7f6c1f578 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -986,12 +986,15 @@ void lim_intersect_sta_he_caps(tpSirAssocReq assoc_req, struct pe_session *sessi /** * lim_add_he_cap() - Copy HE capability into Add sta params + * @mac_ctx: Global MAC context + * @pe_session: pe session entry * @add_sta_params: pointer to add sta params * @assoc_req: pointer to Assoc request * * Return: None */ -void lim_add_he_cap(tpAddStaParams add_sta_params, tpSirAssocReq assoc_req); +void lim_add_he_cap(struct mac_context *mac_ctx, struct pe_session *pe_session, + tpAddStaParams add_sta_params, tpSirAssocReq assoc_req); /** * lim_add_self_he_cap() - Copy HE capability into add sta from PE session @@ -1266,8 +1269,25 @@ QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx, */ void lim_update_stads_he_6ghz_op(struct pe_session *session, tpDphHashNode sta_ds); + +/** + * lim_update_he_6ghz_band_caps() - Update he 6ghz band caps + * @mac_ctx: Global MAC context + * @pAssocRsp: contains the structured assoc/reassoc Response got from AP + * @add_bss: pointer to ADD BSS params + * + * Update 6ghz band caps based on HE capability + * + * Return: none + */ +void lim_update_he_6ghz_band_caps(struct mac_context *mac, + tDot11fIEhe_6ghz_band_cap *he_6ghz_band_cap, + tpAddStaParams params); + #else -static inline void lim_add_he_cap(tpAddStaParams add_sta_params, +static inline void lim_add_he_cap(struct mac_context *mac_ctx, + struct pe_session *pe_session, + tpAddStaParams add_sta_params, tpSirAssocReq assoc_req) { } @@ -1417,6 +1437,13 @@ lim_update_stads_he_6ghz_op(struct pe_session *session, tpDphHashNode sta_ds) { } + +static inline void +lim_update_he_6ghz_band_caps(struct mac_context *mac, + tDot11fIEhe_6ghz_band_cap *he_6ghz_band_cap, + tpAddStaParams params) +{ +} #endif /** 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 04bd8426af92..00cb4820c321 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -2797,6 +2797,12 @@ sir_convert_assoc_req_frame2_struct(struct mac_context *mac, QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG, &pAssocReq->he_cap, sizeof(tDot11fIEhe_cap)); } + if (ar->he_6ghz_band_cap.present) { + qdf_mem_copy(&pAssocReq->he_6ghz_band_cap, + &ar->he_6ghz_band_cap, + sizeof(tDot11fIEhe_6ghz_band_cap)); + pe_debug("Received Assoc Req with HE Band Capability IE"); + } qdf_mem_free(ar); return QDF_STATUS_SUCCESS; @@ -3261,6 +3267,13 @@ sir_convert_assoc_resp_frame2_struct(struct mac_context *mac, pAssocRsp->he_op.bss_col_disabled); } + if (ar->he_6ghz_band_cap.present) { + pe_debug("11AX: HE Band Capability IE present"); + qdf_mem_copy(&pAssocRsp->he_6ghz_band_cap, + &ar->he_6ghz_band_cap, + sizeof(tDot11fIEhe_6ghz_band_cap)); + } + if (ar->mu_edca_param_set.present) { pe_debug("11AX: HE MU EDCA param IE present"); pAssocRsp->mu_edca_present = true; @@ -3463,6 +3476,12 @@ sir_convert_reassoc_req_frame2_struct(struct mac_context *mac, qdf_mem_copy(&pAssocReq->he_cap, &ar->he_cap, sizeof(tDot11fIEhe_cap)); } + if (ar->he_6ghz_band_cap.present) { + qdf_mem_copy(&pAssocReq->he_6ghz_band_cap, + &ar->he_6ghz_band_cap, + sizeof(tDot11fIEhe_6ghz_band_cap)); + } + qdf_mem_free(ar); return QDF_STATUS_SUCCESS; diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h index 4d106ad2fea3..7443a07cce7a 100644 --- a/core/wma/inc/wma_if.h +++ b/core/wma/inc/wma_if.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -243,6 +243,7 @@ typedef struct { bool he_capable; tDot11fIEhe_cap he_config; tDot11fIEhe_op he_op; + tDot11fIEhe_6ghz_band_cap he_6ghz_band_caps; #endif uint8_t stbc_capable; #ifdef WLAN_SUPPORT_TWT diff --git a/core/wma/src/wma_he.c b/core/wma/src/wma_he.c index d42ee779f623..242c8e52134d 100644 --- a/core/wma/src/wma_he.c +++ b/core/wma/src/wma_he.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1290,6 +1290,9 @@ void wma_populate_peer_he_cap(struct peer_assoc_params *peer, wma_print_he_mac_cap_w2(mac_cap[1]); wma_print_he_ppet(&peer->peer_ppet); + qdf_mem_copy(&peer->peer_he_caps_6ghz, + ((uint16_t *)¶ms->he_6ghz_band_caps) + 1, + sizeof(peer->peer_he_caps_6ghz)); return; } diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index cc3debb64ed5..9dc29d332c05 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1687,7 +1687,6 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma, } wma_populate_peer_he_cap(cmd, params); - if (!wma_is_vdev_in_ap_mode(wma, params->smesessionId)) intr->nss = cmd->peer_nss;