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_ */