From c4a61676cb6a9049baff482c23f24aa90d3d9237 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Mon, 3 Aug 2020 11:54:32 +0530 Subject: [PATCH] qcacld-3.0: Update RSN caps on roaming After roaming, FW updates host by roam sync indication. Host parses the reassoc request in roam sync indication to update RSN params of vdev crypto. Change-Id: I9638a77150e81ea911e95d294c58d605871630a0 CRs-Fixed: 2746470 --- core/mac/src/pe/lim/lim_api.c | 62 ++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 26195a839f..c72d6fc70a 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -673,6 +673,7 @@ static bool is_mgmt_protected(uint32_t vdev_id, return protected; } + #else /** * is_mgmt_protected - check RMF enabled for the peer @@ -1777,6 +1778,65 @@ void lim_fill_join_rsp_ht_caps(struct pe_session *session, #endif #ifdef WLAN_FEATURE_ROAM_OFFLOAD +#ifdef WLAN_FEATURE_11W +static void pe_set_rmf_caps(struct mac_context *mac_ctx, + struct pe_session *ft_session, + struct roam_offload_synch_ind *roam_synch) +{ + uint8_t *assoc_body; + uint16_t len; + tDot11fReAssocRequest *assoc_req; + uint32_t status; + tSirMacRsnInfo rsn_ie; + + assoc_body = (uint8_t *)roam_synch + roam_synch->reassoc_req_offset + + sizeof(tSirMacMgmtHdr); + len = roam_synch->reassoc_req_length - sizeof(tSirMacMgmtHdr); + + assoc_req = qdf_mem_malloc(sizeof(*assoc_req)); + if (!assoc_req) + return; + + /* delegate to the framesc-generated code, */ + status = dot11f_unpack_re_assoc_request(mac_ctx, assoc_body, len, + assoc_req, false); + if (DOT11F_FAILED(status)) { + pe_err("Failed to parse a Re-association Request (0x%08x, %d bytes):", + status, len); + QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO, + assoc_body, len); + qdf_mem_free(assoc_req); + return; + } else if (DOT11F_WARNED(status)) { + pe_debug("There were warnings while unpacking a Re-association Request (0x%08x, %d bytes):", + status, len); + } + ft_session->limRmfEnabled = false; + if (!assoc_req->RSNOpaque.present) { + qdf_mem_free(assoc_req); + return; + } + rsn_ie.info[0] = WLAN_ELEMID_RSN; + rsn_ie.info[1] = assoc_req->RSNOpaque.num_data; + + rsn_ie.length = assoc_req->RSNOpaque.num_data + 2; + qdf_mem_copy(&rsn_ie.info[2], assoc_req->RSNOpaque.data, + assoc_req->RSNOpaque.num_data); + qdf_mem_free(assoc_req); + wlan_set_vdev_crypto_prarams_from_ie(ft_session->vdev, rsn_ie.info, + rsn_ie.length); + + ft_session->limRmfEnabled = + lim_get_vdev_rmf_capable(mac_ctx, ft_session); +} +#else +static inline void pe_set_rmf_caps(struct mac_context *mac_ctx, + struct pe_session *ft_session, + struct roam_offload_synch_ind *roam_synch) +{ +} +#endif + /** * sir_parse_bcn_fixed_fields() - Parse fixed fields in Beacon IE's * @@ -2475,7 +2535,7 @@ pe_roam_synch_callback(struct mac_context *mac_ctx, /* Next routine will update nss and vdev_nss with AP's capabilities */ lim_fill_ft_session(mac_ctx, bss_desc, ft_session_ptr, session_ptr, roam_sync_ind_ptr->phy_mode); - + pe_set_rmf_caps(mac_ctx, ft_session_ptr, roam_sync_ind_ptr); /* Next routine may update nss based on dot11Mode */ lim_ft_prepare_add_bss_req(mac_ctx, ft_session_ptr, bss_desc); if (session_ptr->is11Rconnection)