From f363c9105d3f35584c376daffd68e6c35f904839 Mon Sep 17 00:00:00 2001 From: Srikanth Marepalli Date: Tue, 27 Feb 2024 18:14:28 +0530 Subject: [PATCH] qcacmn: Send the user configured MFP state in RSO command Currently the user configured MFP state that comes from the userspace in connect request is not handled or processed. Instead the RSN caps from assoc IE of connect request is inter- sected with AP RSN caps and sent to Firmware using RSO command. This RSN caps is used in FW in selecting a roam candidate, which was causing the cross AKM (eg:SAE -> PSK) roam fail. Hence, use the user configured MFP value in sending the RSN caps to Firmware. Change-Id: I3facfcf3616667b4749109d26d924c3fb1537494 CRs-Fixed: 3606069 --- .../cmn_defs/inc/wlan_cmn_ieee80211.h | 3 +- .../crypto/inc/wlan_crypto_global_def.h | 3 ++ .../crypto/src/wlan_crypto_global_api.c | 6 ++++ .../crypto/src/wlan_crypto_param_handling.c | 33 +++++++++++++++++++ .../crypto/src/wlan_crypto_param_handling_i.h | 23 +++++++++++++ 5 files changed, 67 insertions(+), 1 deletion(-) diff --git a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h index f4ccb035f530..7bb3e657a8d9 100644 --- a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h +++ b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. 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 @@ -918,6 +918,7 @@ enum wlan_status_code { #define WLAN_ASE_SHA256_PSK 0x100 #define WLAN_ASE_WPS 0x200 +#define RSN_CAP_MFP_DISABLED 0x00 #define RSN_CAP_MFP_CAPABLE 0x80 #define RSN_CAP_MFP_REQUIRED 0x40 diff --git a/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h b/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h index f7468a78f083..d5f386bef272 100644 --- a/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h +++ b/umac/cmn_services/crypto/inc/wlan_crypto_global_def.h @@ -312,6 +312,7 @@ struct wlan_crypto_pmksa { * @orig_ucastcipher: connection request unicast ciphers * @orig_mcastcipher: connection request multicast cipher * @orig_key_mgmt: connection request key mgmt + * @orig_rsn_caps: connection request rsn_capability * * This structure holds crypto params for peer or vdev */ @@ -327,6 +328,7 @@ struct wlan_crypto_params { uint32_t orig_ucastcipher; uint32_t orig_mcastcipher; uint32_t orig_key_mgmt; + uint16_t orig_rsn_caps; }; typedef enum wlan_crypto_param_type { @@ -341,6 +343,7 @@ typedef enum wlan_crypto_param_type { WLAN_CRYPTO_PARAM_ORIG_UCAST_CIPHER, WLAN_CRYPTO_PARAM_ORIG_MCAST_CIPHER, WLAN_CRYPTO_PARAM_ORIG_KEY_MGMT, + WLAN_CRYPTO_PARAM_ORIG_RSN_CAP, } wlan_crypto_param_type; /** diff --git a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c index f7ec591a6263..8bf19d70cbb6 100644 --- a/umac/cmn_services/crypto/src/wlan_crypto_global_api.c +++ b/umac/cmn_services/crypto/src/wlan_crypto_global_api.c @@ -181,6 +181,9 @@ static QDF_STATUS wlan_crypto_set_param(struct wlan_crypto_params *crypto_params case WLAN_CRYPTO_PARAM_ORIG_KEY_MGMT: status = wlan_crypto_set_orig_key_mgmt(crypto_params, value); break; + case WLAN_CRYPTO_PARAM_ORIG_RSN_CAP: + status = wlan_crypto_set_orig_rsn_cap(crypto_params, value); + break; default: status = QDF_STATUS_E_INVAL; } @@ -297,6 +300,9 @@ static int32_t wlan_crypto_get_param_value(wlan_crypto_param_type param, case WLAN_CRYPTO_PARAM_ORIG_KEY_MGMT: value = wlan_crypto_get_orig_key_mgmt(crypto_params); break; + case WLAN_CRYPTO_PARAM_ORIG_RSN_CAP: + value = wlan_crypto_get_orig_rsn_cap(crypto_params); + break; default: value = -1; } diff --git a/umac/cmn_services/crypto/src/wlan_crypto_param_handling.c b/umac/cmn_services/crypto/src/wlan_crypto_param_handling.c index 68b79f07e87e..12a78b4334c9 100644 --- a/umac/cmn_services/crypto/src/wlan_crypto_param_handling.c +++ b/umac/cmn_services/crypto/src/wlan_crypto_param_handling.c @@ -404,3 +404,36 @@ int32_t wlan_crypto_get_orig_key_mgmt(struct wlan_crypto_params *crypto_params) { return crypto_params->orig_key_mgmt; } + +/** + * wlan_crypto_set_orig_rsn_cap - called by ucfg to configure connection + * request RSN capabilities in vdev + * @crypto_params: pointer to crypto params structure + * @value: bitmap value of all supported RSN capabilities + * + * This function gets called from ucfg to configure RSN caps in vdev + * + * Return: QDF_STATUS_SUCCESS - in case of success + */ +QDF_STATUS +wlan_crypto_set_orig_rsn_cap(struct wlan_crypto_params *crypto_params, + uint32_t value) +{ + crypto_params->orig_rsn_caps = value; + + return QDF_STATUS_SUCCESS; +} + +/** + * wlan_crypto_get_orig_rsn_cap - called by ucfg to get connection request + * RSN capabilities from vdev + * @crypto_params: pointer to crypto params structure + * + * This function gets called from ucfg to get supported RSN capabilities + * + * Return: bitmap value of all supported RSN caps + */ +int32_t wlan_crypto_get_orig_rsn_cap(struct wlan_crypto_params *crypto_params) +{ + return crypto_params->orig_rsn_caps; +} diff --git a/umac/cmn_services/crypto/src/wlan_crypto_param_handling_i.h b/umac/cmn_services/crypto/src/wlan_crypto_param_handling_i.h index 17d0edd0daf5..718001866cad 100644 --- a/umac/cmn_services/crypto/src/wlan_crypto_param_handling_i.h +++ b/umac/cmn_services/crypto/src/wlan_crypto_param_handling_i.h @@ -256,4 +256,27 @@ wlan_crypto_set_orig_key_mgmt(struct wlan_crypto_params *crypto_params, * Return: bitmap value of all supported AKMs */ int32_t wlan_crypto_get_orig_key_mgmt(struct wlan_crypto_params *crypto_params); + +/** + * wlan_crypto_set_orig_rsn_cap - called by ucfg to configure + * RSN cap in vdev + * @crypto_params: pointer to crypto params + * @value: bitmap value of all supported RSN cap + * + * This function gets called from ucfg to configure RSN cap in vdev + * + * Return: QDF_STATUS_SUCCESS - in case of success + */ +QDF_STATUS wlan_crypto_set_orig_rsn_cap(struct wlan_crypto_params *crypto_params, + uint32_t value); + +/** + * wlan_crypto_get_orig_rsn_cap - called by ucfg to get RSN cap from vdev + * @crypto_params: pointer to crypto params + * + * This function gets called from ucfg to get supported RSN cap + * + * Return: bitmap value of all supported RSN cap + */ +int32_t wlan_crypto_get_orig_rsn_cap(struct wlan_crypto_params *crypto_params); #endif /* __WLAN_CRYPTO_PARAM_HANDLING_I_H_ */