qcacld-3.0: Save hlp info in mlme priv

Host moves hlp info from csr session to mlme priv object. Modules need
hlp info now use hlp info from mlme priv object

Change-Id: Ieffa749635239f72337af685707acccfd666a58a
CRs-Fixed: 2862315
This commit is contained in:
Abhishek Ambure 2021-01-27 20:51:03 +05:30 committed by snandini
parent 4afda23e63
commit 467050ebbd
24 changed files with 347 additions and 179 deletions

6
Kbuild
View File

@ -1308,11 +1308,9 @@ MLME_OBJS += $(CM_DIR)/dispatcher/src/wlan_cm_tgt_if_tx_api.o \
$(CM_DIR)/dispatcher/src/wlan_cm_roam_api.o \
$(CM_DIR)/dispatcher/src/wlan_cm_roam_ucfg_api.o \
$(CM_TGT_IF_DIR)/src/target_if_cm_roam_offload.o \
$(CM_DIR)/core/src/wlan_cm_roam_offload.o
ifeq ($(CONFIG_CM_ENABLE), y)
MLME_OBJS += $(CM_DIR)/core/src/wlan_cm_vdev_connect.o \
$(CM_DIR)/core/src/wlan_cm_roam_offload.o \
$(CM_DIR)/core/src/wlan_cm_vdev_connect.o \
$(CM_DIR)/core/src/wlan_cm_vdev_disconnect.o
endif
####### WFA_CONFIG ########

View File

@ -262,6 +262,9 @@ struct ft_context {
* @qos_enabled: is qos enabled
* @is_wps is wps connection
* @ft_info: ft related info
* @hlp_ie: hldp ie
* @hlp_ie_len: hlp ie length
* @fils_con_info: Pointer to fils connection info from connect req
*/
struct mlme_connect_info {
uint8_t timing_meas_cap;
@ -274,6 +277,11 @@ struct mlme_connect_info {
bool qos_enabled;
bool is_wps;
struct ft_context ft_info;
#ifdef WLAN_FEATURE_FILS_SK
uint8_t *hlp_ie;
uint32_t hlp_ie_len;
struct wlan_fils_connection_info *fils_con_info;
#endif
};
/**
@ -299,7 +307,6 @@ struct mlme_connect_info {
* @sae_auth_retry: SAE auth retry information
* @roam_reason_better_ap: roam due to better AP found
* @hb_failure_rssi: heartbeat failure AP RSSI
* @fils_con_info: Pointer to fils connection info from csr roam profile
* @opr_rate_set: operational rates set
* @ext_opr_rate_set: extended operational rates set
* @mscs_req_info: Information related to mscs request
@ -329,9 +336,6 @@ struct mlme_legacy_priv {
struct sae_auth_retry sae_retry;
bool roam_reason_better_ap;
uint32_t hb_failure_rssi;
#ifdef WLAN_FEATURE_FILS_SK
struct wlan_fils_connection_info *fils_con_info;
#endif
struct mlme_cfg_str opr_rate_set;
struct mlme_cfg_str ext_opr_rate_set;
#ifdef WLAN_FEATURE_MSCS

View File

@ -1160,6 +1160,20 @@ static QDF_STATUS mlme_get_vdev_types(enum QDF_OPMODE mode, uint8_t *type,
return status;
}
#ifdef WLAN_FEATURE_FILS_SK
static inline void mlme_free_fils_info(struct mlme_connect_info *connect_info)
{
qdf_mem_free(connect_info->fils_con_info);
qdf_mem_free(connect_info->hlp_ie);
connect_info->hlp_ie = NULL;
connect_info->hlp_ie_len = 0;
connect_info->fils_con_info = NULL;
}
#else
static inline void mlme_free_fils_info(struct mlme_connect_info *connect_info)
{}
#endif
static void mlme_ext_handler_destroy(struct vdev_mlme_obj *vdev_mlme)
{
if (!vdev_mlme || !vdev_mlme->ext_vdev_ptr)
@ -1172,8 +1186,7 @@ static void mlme_ext_handler_destroy(struct vdev_mlme_obj *vdev_mlme)
wlan_cm_rso_config_deinit(vdev_mlme->vdev,
&vdev_mlme->ext_vdev_ptr->rso_cfg);
#endif
qdf_mem_free(vdev_mlme->ext_vdev_ptr->fils_con_info);
vdev_mlme->ext_vdev_ptr->fils_con_info = NULL;
mlme_free_fils_info(&vdev_mlme->ext_vdev_ptr->connect_info);
qdf_mem_free(vdev_mlme->ext_vdev_ptr);
vdev_mlme->ext_vdev_ptr = NULL;
}
@ -1196,7 +1209,7 @@ QDF_STATUS vdevmgr_mlme_ext_hdl_create(struct vdev_mlme_obj *vdev_mlme)
return QDF_STATUS_E_NOMEM;
mlme_init_rate_config(vdev_mlme);
vdev_mlme->ext_vdev_ptr->fils_con_info = NULL;
vdev_mlme->ext_vdev_ptr->connect_info.fils_con_info = NULL;
/* This is temp ifdef will be removed in near future */
#ifndef FEATURE_CM_ENABLE
wlan_cm_rso_config_init(vdev_mlme->vdev,

View File

@ -24,13 +24,15 @@
#ifndef __WLAN_CM_VDEV_API_H__
#define __WLAN_CM_VDEV_API_H__
#ifdef FEATURE_CM_ENABLE
#include <wlan_cm_public_struct.h>
#include "scheduler_api.h"
#ifdef FEATURE_CM_ENABLE
#include "connection_mgr/core/src/wlan_cm_main.h"
#include "connection_mgr/core/src/wlan_cm_main_api.h"
#endif
#include <wlan_cm_roam_api.h>
#ifdef FEATURE_CM_ENABLE
/**
* struct cm_vdev_join_req - connect req from legacy CM to vdev manager
* @vdev_id: vdev id
@ -124,7 +126,30 @@ struct cm_peer_create_req {
struct cm_ext_obj {
struct rso_config rso_cfg;
};
#endif
#ifdef WLAN_FEATURE_FILS_SK
/**
* cm_update_hlp_info - API to save HLP IE
* @psoc: Pointer to psoc
* @gen_ie: IE buffer to store
* @len: length of the IE buffer @gen_ie
* @vdev_id: vdev id
* @flush: Flush the older saved HLP if any
*
* Return: None
*/
void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
const uint8_t *gen_ie, uint16_t len,
bool flush);
#else
static inline void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
const uint8_t *gen_ie, uint16_t len,
bool flush)
{}
#endif
#ifdef FEATURE_CM_ENABLE
static inline QDF_STATUS cm_ext_hdl_create(struct cnx_mgr *cm_ctx)
{
cm_ctx->ext_cm_ptr = qdf_mem_malloc(sizeof(struct cm_ext_obj));

View File

@ -29,6 +29,49 @@
#include "wlan_mlme_vdev_mgr_interface.h"
#include "wni_api.h"
#ifdef WLAN_FEATURE_FILS_SK
void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
const uint8_t *gen_ie, uint16_t len,
bool flush)
{
struct mlme_legacy_priv *mlme_priv;
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
if (!mlme_priv)
return;
if (flush) {
mlme_priv->connect_info.hlp_ie_len = 0;
if (mlme_priv->connect_info.hlp_ie) {
qdf_mem_free(mlme_priv->connect_info.hlp_ie);
mlme_priv->connect_info.hlp_ie = NULL;
}
}
if (!len || !gen_ie)
return;
if ((mlme_priv->connect_info.hlp_ie_len + len) >
FILS_MAX_HLP_DATA_LEN) {
mlme_err("HLP len exceeds: hlp_ie_len %d len %d",
mlme_priv->connect_info.hlp_ie_len, len);
return;
}
if (!mlme_priv->connect_info.hlp_ie) {
mlme_priv->connect_info.hlp_ie =
qdf_mem_malloc(FILS_MAX_HLP_DATA_LEN);
if (!mlme_priv->connect_info.hlp_ie)
return;
}
qdf_mem_copy(mlme_priv->connect_info.hlp_ie +
mlme_priv->connect_info.hlp_ie_len, gen_ie, len);
mlme_priv->connect_info.hlp_ie_len += len;
}
#endif
#ifdef FEATURE_CM_ENABLE
QDF_STATUS cm_connect_start_ind(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_connect_req *req)
{
@ -157,6 +200,16 @@ QDF_STATUS wlan_cm_send_connect_rsp(struct scheduler_msg *msg)
return status;
}
static void
cm_update_hlp_data_from_assoc_ie(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_vdev_connect_req *req)
{
/*
* loop through req->assoc IE and fill hld date from
* DOT11F_EID_FRAGMENT_IE and SIR_FILS_HLP_EXT_EID
*/
}
QDF_STATUS
cm_handle_connect_req(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_vdev_connect_req *req)
@ -181,6 +234,8 @@ cm_handle_connect_req(struct wlan_objmgr_vdev *vdev,
return QDF_STATUS_E_FAILURE;
}
cm_update_hlp_data_from_assoc_ie(vdev, req);
status = cm_csr_handle_connect_req(vdev, req, join_req);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("vdev_id: %d cm_id 0x%x : fail to fill params from legacy",
@ -347,3 +402,4 @@ bool cm_is_vdevid_connected(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
return connected;
}
#endif

View File

@ -31,6 +31,7 @@
#include <wlan_cm_roam_api.h>
#include "wni_api.h"
#ifdef FEATURE_CM_ENABLE
QDF_STATUS cm_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
struct wlan_cm_disconnect_req *req)
{
@ -248,3 +249,4 @@ QDF_STATUS cm_handle_disconnect_resp(struct scheduler_msg *msg)
return QDF_STATUS_E_FAILURE;
}
#endif

View File

@ -553,6 +553,20 @@ wlan_cm_update_mlme_fils_info(struct wlan_objmgr_vdev *vdev,
QDF_STATUS wlan_cm_update_fils_ft(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, uint8_t *fils_ft,
uint8_t fils_ft_len);
/**
* wlan_cm_update_hlp_info - API to save HLP IE
* @psoc: Pointer to psoc
* @gen_ie: IE buffer to store
* @len: length of the IE buffer @gen_ie
* @vdev_id: vdev id
* @flush: Flush the older saved HLP if any
*
* Return: None
*/
void wlan_cm_update_hlp_info(struct wlan_objmgr_psoc *psoc,
const uint8_t *gen_ie, uint16_t len,
uint8_t vdev_id, bool flush);
#else
static inline
struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info(
@ -561,6 +575,11 @@ struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info(
{
return NULL;
}
static inline void wlan_cm_update_hlp_info(struct wlan_objmgr_psoc *psoc,
const uint8_t *gen_ie, uint16_t len,
uint8_t vdev_id, bool flush)
{}
#endif
#if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)

View File

@ -98,6 +98,8 @@
#define WLAN_FILS_MAX_RRK_LENGTH 64
#endif
#define FILS_MAX_HLP_DATA_LEN 2048
#define WLAN_FILS_MAX_RIK_LENGTH WLAN_FILS_MAX_RRK_LENGTH
#define WLAN_FILS_FT_MAX_LEN 48

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021, 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 above
@ -133,8 +133,6 @@ ucfg_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
return wlan_cm_roaming_in_progress(pdev, vdev_id);
}
#endif
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
static inline QDF_STATUS
ucfg_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
@ -153,3 +151,22 @@ ucfg_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
#endif
#ifdef FEATURE_CM_ENABLE
#ifdef WLAN_FEATURE_FILS_SK
QDF_STATUS
ucfg_cm_update_fils_config(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
struct wlan_fils_con_info *fils_info);
#else
static inline QDF_STATUS
ucfg_cm_update_fils_config(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
struct wlan_fils_con_info *fils_info)
{
return QDF_STATUS_SUCCESS;
}
#endif
#endif
#endif /* _WLAN_CM_ROAM_UCFG_API_H_ */

View File

@ -1471,24 +1471,24 @@ QDF_STATUS wlan_cm_update_mlme_fils_connection_info(
if (!src_fils_info) {
mlme_debug("FILS: vdev:%d Clear fils info", vdev_id);
qdf_mem_free(mlme_priv->fils_con_info);
mlme_priv->fils_con_info = NULL;
qdf_mem_free(mlme_priv->connect_info.fils_con_info);
mlme_priv->connect_info.fils_con_info = NULL;
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
return QDF_STATUS_SUCCESS;
}
if (mlme_priv->fils_con_info)
qdf_mem_free(mlme_priv->fils_con_info);
if (mlme_priv->connect_info.fils_con_info)
qdf_mem_free(mlme_priv->connect_info.fils_con_info);
mlme_priv->fils_con_info =
mlme_priv->connect_info.fils_con_info =
qdf_mem_malloc(sizeof(struct wlan_fils_connection_info));
if (!mlme_priv->fils_con_info) {
if (!mlme_priv->connect_info.fils_con_info) {
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
return QDF_STATUS_E_NOMEM;
}
mlme_debug("FILS: vdev:%d update fils info", vdev_id);
qdf_mem_copy(mlme_priv->fils_con_info, src_fils_info,
qdf_mem_copy(mlme_priv->connect_info.fils_con_info, src_fils_info,
sizeof(struct wlan_fils_connection_info));
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
@ -1513,20 +1513,20 @@ wlan_cm_update_mlme_fils_info(struct wlan_objmgr_vdev *vdev,
if (!src_fils_info) {
mlme_debug("FILS: vdev:%d Clear fils info", vdev_id);
qdf_mem_free(mlme_priv->fils_con_info);
mlme_priv->fils_con_info = NULL;
qdf_mem_free(mlme_priv->connect_info.fils_con_info);
mlme_priv->connect_info.fils_con_info = NULL;
return QDF_STATUS_SUCCESS;
}
if (mlme_priv->fils_con_info)
qdf_mem_free(mlme_priv->fils_con_info);
if (mlme_priv->connect_info.fils_con_info)
qdf_mem_free(mlme_priv->connect_info.fils_con_info);
mlme_priv->fils_con_info =
mlme_priv->connect_info.fils_con_info =
qdf_mem_malloc(sizeof(struct wlan_fils_connection_info));
if (!mlme_priv->fils_con_info)
if (!mlme_priv->connect_info.fils_con_info)
return QDF_STATUS_E_NOMEM;
tgt_info = mlme_priv->fils_con_info;
tgt_info = mlme_priv->connect_info.fils_con_info;
mlme_debug("FILS: vdev:%d update fils info", vdev_id);
tgt_info->is_fils_connection = src_fils_info->is_fils_connection;
tgt_info->key_nai_length = src_fils_info->username_len;
@ -1545,8 +1545,26 @@ wlan_cm_update_mlme_fils_info(struct wlan_objmgr_vdev *vdev,
return QDF_STATUS_SUCCESS;
}
#endif
void wlan_cm_update_hlp_info(struct wlan_objmgr_psoc *psoc,
const uint8_t *gen_ie, uint16_t len,
uint8_t vdev_id, bool flush)
{
struct wlan_objmgr_vdev *vdev;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
WLAN_MLME_NB_ID);
if (!vdev) {
mlme_err("vdev object is NULL for vdev_id %d", vdev_id);
return;
}
cm_update_hlp_info(vdev, gen_ie, len, flush);
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
}
struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info(
struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id)
@ -1569,7 +1587,7 @@ struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info(
return NULL;
}
fils_info = mlme_priv->fils_con_info;
fils_info = mlme_priv->connect_info.fils_con_info;
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
return fils_info;
@ -1596,14 +1614,16 @@ QDF_STATUS wlan_cm_update_fils_ft(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_FAILURE;
}
if (!mlme_priv->fils_con_info || !fils_ft || !fils_ft_len ||
!mlme_priv->fils_con_info->is_fils_connection) {
if (!mlme_priv->connect_info.fils_con_info || !fils_ft ||
!fils_ft_len ||
!mlme_priv->connect_info.fils_con_info->is_fils_connection) {
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
return QDF_STATUS_E_FAILURE;
}
mlme_priv->fils_con_info->fils_ft_len = fils_ft_len;
qdf_mem_copy(mlme_priv->fils_con_info->fils_ft, fils_ft, fils_ft_len);
mlme_priv->connect_info.fils_con_info->fils_ft_len = fils_ft_len;
qdf_mem_copy(mlme_priv->connect_info.fils_con_info->fils_ft, fils_ft,
fils_ft_len);
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
return QDF_STATUS_SUCCESS;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021, 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 above
@ -113,3 +113,28 @@ QDF_STATUS ucfg_cm_abort_roam_scan(struct wlan_objmgr_pdev *pdev,
return status;
}
#ifdef FEATURE_CM_ENABLE
#ifdef WLAN_FEATURE_FILS_SK
QDF_STATUS
ucfg_cm_update_fils_config(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id,
struct wlan_fils_con_info *fils_info)
{
QDF_STATUS status;
struct wlan_objmgr_vdev *vdev;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
WLAN_MLME_NB_ID);
if (!vdev) {
mlme_err("vdev object is NULL");
return QDF_STATUS_E_INVAL;
}
status = wlan_cm_update_mlme_fils_info(vdev, fils_info);
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
return status;
}
#endif
#endif

View File

@ -4230,15 +4230,6 @@ int hdd_reset_limit_off_chan(struct hdd_adapter *adapter);
#if defined(WLAN_FEATURE_FILS_SK) && \
(defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)))
/**
* hdd_clear_fils_connection_info: API to clear fils info from roam profile and
* free allocated memory
* @adapter: pointer to hdd adapter
*
* Return: None
*/
void hdd_clear_fils_connection_info(struct hdd_adapter *adapter);
/**
* hdd_update_hlp_info() - Update HLP packet received in FILS (re)assoc rsp
* @dev: net device
@ -4252,8 +4243,6 @@ void hdd_clear_fils_connection_info(struct hdd_adapter *adapter);
void hdd_update_hlp_info(struct net_device *dev,
struct csr_roam_info *roam_info);
#else
static inline void hdd_clear_fils_connection_info(struct hdd_adapter *adapter)
{ }
static inline void hdd_update_hlp_info(struct net_device *dev,
struct csr_roam_info *roam_info)
{}

View File

@ -1695,9 +1695,6 @@ void hdd_clear_roam_profile_ie(struct hdd_adapter *adapter)
sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
sta_ctx->auth_key_mgmt = 0;
qdf_zero_macaddr(&sta_ctx->requested_bssid);
#ifndef FEATURE_CM_ENABLE
hdd_clear_fils_connection_info(adapter);
#endif
hdd_exit();
}
@ -2579,31 +2576,6 @@ hdd_roam_set_key_complete_handler(struct hdd_adapter *adapter,
}
#ifndef FEATURE_CM_ENABLE
#if defined(WLAN_FEATURE_FILS_SK) && \
(defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \
(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)))
void hdd_clear_fils_connection_info(struct hdd_adapter *adapter)
{
struct csr_roam_profile *roam_profile;
if ((adapter->device_mode == QDF_SAP_MODE) ||
(adapter->device_mode == QDF_P2P_GO_MODE))
return;
roam_profile = hdd_roam_profile(adapter);
if (roam_profile->fils_con_info) {
qdf_mem_free(roam_profile->fils_con_info);
roam_profile->fils_con_info = NULL;
}
if (roam_profile->hlp_ie) {
qdf_mem_free(roam_profile->hlp_ie);
roam_profile->hlp_ie = NULL;
roam_profile->hlp_ie_len = 0;
}
}
#endif
/**
* hdd_association_completion_handler() - association completion handler
* @adapter: pointer to adapter
@ -5312,8 +5284,6 @@ static void hdd_initialize_fils_info(struct hdd_adapter *adapter)
roam_profile = hdd_roam_profile(adapter);
roam_profile->fils_con_info = NULL;
roam_profile->hlp_ie = NULL;
roam_profile->hlp_ie_len = 0;
}
#else
static void hdd_initialize_fils_info(struct hdd_adapter *adapter)

View File

@ -19129,7 +19129,8 @@ static int wlan_hdd_cfg80211_set_fils_config(struct hdd_adapter *adapter,
return -EINVAL;
}
hdd_clear_fils_connection_info(adapter);
wlan_cm_update_hlp_info(hdd_ctx->psoc, NULL, 0, adapter->vdev_id,
true);
roam_profile->fils_con_info =
qdf_mem_malloc(sizeof(*roam_profile->fils_con_info));
@ -19508,55 +19509,6 @@ static int wlan_hdd_add_assoc_ie(struct hdd_adapter *adapter,
return 0;
}
#ifdef WLAN_FEATURE_FILS_SK
/**
* wlan_hdd_save_hlp_ie - API to save HLP IE
* @roam_profile: Pointer to roam profile
* @gen_ie: IE buffer to store
* @len: length of the IE buffer @gen_ie
* @flush: Flush the older saved HLP if any
*
* Return: None
*/
static void wlan_hdd_save_hlp_ie(struct csr_roam_profile *roam_profile,
const uint8_t *gen_ie, uint16_t len,
bool flush)
{
uint8_t *hlp_ie = roam_profile->hlp_ie;
if (flush) {
roam_profile->hlp_ie_len = 0;
if (hlp_ie) {
qdf_mem_free(hlp_ie);
roam_profile->hlp_ie = NULL;
}
}
if ((roam_profile->hlp_ie_len +
len) > FILS_MAX_HLP_DATA_LEN) {
hdd_err("HLP len exceeds: hlp_ie_len %d len %d",
roam_profile->hlp_ie_len, len);
return;
}
if (!roam_profile->hlp_ie) {
roam_profile->hlp_ie =
qdf_mem_malloc(FILS_MAX_HLP_DATA_LEN);
hlp_ie = roam_profile->hlp_ie;
if (!hlp_ie)
return;
}
qdf_mem_copy(hlp_ie + roam_profile->hlp_ie_len, gen_ie, len);
roam_profile->hlp_ie_len += len;
}
#else
static inline void wlan_hdd_save_hlp_ie(struct csr_roam_profile *roam_profile,
const uint8_t *gen_ie, uint16_t len,
bool flush)
{}
#endif
/**
* hdd_populate_crypto_auth_type() - populate auth type for crypto
* @vdev: pointed to vdev obmgr
@ -19773,6 +19725,7 @@ static int wlan_hdd_cfg80211_set_ie(struct hdd_adapter *adapter,
#endif
int status;
uint8_t *security_ie;
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
roam_profile = hdd_roam_profile(adapter);
@ -20077,8 +20030,9 @@ static int wlan_hdd_cfg80211_set_ie(struct hdd_adapter *adapter,
if (genie[0] == SIR_FILS_HLP_EXT_EID) {
hdd_debug("HLP EXT IE(len %d)",
eLen + 2);
wlan_hdd_save_hlp_ie(roam_profile,
wlan_cm_update_hlp_info(hdd_ctx->psoc,
genie - 2, eLen + 2,
adapter->vdev_id,
true);
status = wlan_hdd_add_assoc_ie(
adapter, genie - 2,
@ -20111,8 +20065,9 @@ static int wlan_hdd_cfg80211_set_ie(struct hdd_adapter *adapter,
case DOT11F_EID_FRAGMENT_IE:
{
hdd_debug("Fragment IE(len %d)", eLen + 2);
wlan_hdd_save_hlp_ie(roam_profile,
wlan_cm_update_hlp_info(hdd_ctx->psoc,
genie - 2, eLen + 2,
adapter->vdev_id,
false);
status = wlan_hdd_add_assoc_ie(adapter,
genie - 2, eLen + 2);
@ -23541,8 +23496,91 @@ hdd_update_connect_params_fils_info(struct hdd_adapter *adapter,
struct cfg80211_connect_params *req,
uint32_t changed)
{
/* handle for connection manager */
return 0;
uint8_t *buf;
QDF_STATUS status;
enum wlan_fils_auth_type auth_type;
struct wlan_fils_con_info *fils_info;
int ret = 0;
fils_info = qdf_mem_malloc(sizeof(*fils_info));
if (!fils_info)
return -EINVAL;
fils_info->is_fils_connection = true;
if (changed & UPDATE_FILS_ERP_INFO) {
fils_info->username_len = req->fils_erp_username_len +
sizeof(char) +
req->fils_erp_realm_len;
if (fils_info->username_len >
WLAN_CM_FILS_MAX_KEYNAME_NAI_LENGTH) {
hdd_err("Key NAI Length %d",
fils_info->username_len);
ret = -EINVAL;
goto free_mem;
}
if (req->fils_erp_username_len && req->fils_erp_username) {
buf = fils_info->username;
qdf_mem_copy(buf, req->fils_erp_username,
req->fils_erp_username_len);
buf += req->fils_erp_username_len;
*buf++ = '@';
qdf_mem_copy(buf, req->fils_erp_realm,
req->fils_erp_realm_len);
}
fils_info->next_seq_num = req->fils_erp_next_seq_num + 1;
fils_info->rrk_len = req->fils_erp_rrk_len;
if (fils_info->rrk_len > WLAN_CM_FILS_MAX_RRK_LENGTH) {
hdd_err("r_rk_length is invalid %d",
fils_info->rrk_len);
ret = -EINVAL;
goto free_mem;
}
if (req->fils_erp_rrk_len && req->fils_erp_rrk)
qdf_mem_copy(fils_info->rrk, req->fils_erp_rrk,
fils_info->rrk_len);
fils_info->realm_len = req->fils_erp_realm_len;
if (fils_info->realm_len > WLAN_CM_FILS_MAX_REALM_LEN) {
hdd_err("Invalid fils realm len %d",
fils_info->realm_len);
ret = -EINVAL;
goto free_mem;
}
if (req->fils_erp_realm_len && req->fils_erp_realm)
qdf_mem_copy(fils_info->realm, req->fils_erp_realm,
fils_info->realm_len);
}
if (changed & UPDATE_FILS_AUTH_TYPE) {
auth_type = osif_cm_get_fils_auth_type(req->auth_type);
if (auth_type == FILS_PK_MAX) {
hdd_err("invalid auth type for fils %d",
req->auth_type);
ret = -EINVAL;
goto free_mem;
}
fils_info->auth_type = auth_type;
}
hdd_debug("fils conn update: changed %x is_fils %d keyname nai len %d",
changed, fils_info->is_fils_connection,
fils_info->username_len);
/*
* Update the FILS config from adapter->roam_profile to
* csr_session
*/
status = ucfg_cm_update_fils_config(hdd_ctx->psoc, adapter->vdev_id,
fils_info);
if (QDF_IS_STATUS_ERROR(status))
hdd_err("Update FILS connect params failed %d", status);
free_mem:
qdf_mem_free(fils_info);
return ret;
}
#endif
#else

View File

@ -7190,9 +7190,6 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
wlan_hdd_scan_abort(adapter);
wlan_hdd_cleanup_actionframe(adapter);
wlan_hdd_cleanup_remain_on_channel_ctx(adapter);
#ifndef FEATURE_CM_ENABLE
hdd_clear_fils_connection_info(adapter);
#endif
status = wlan_hdd_flush_pmksa_cache(adapter);
if (QDF_IS_STATUS_ERROR(status))
hdd_debug("Cannot flush PMKIDCache");

View File

@ -917,7 +917,6 @@ static void __hdd_ipv4_notifier_work_queue(struct hdd_adapter *adapter)
{
struct hdd_context *hdd_ctx;
int errno;
struct csr_roam_profile *roam_profile;
struct in_ifaddr *ifa;
enum station_keepalive_method val;
QDF_STATUS status;
@ -944,12 +943,11 @@ static void __hdd_ipv4_notifier_work_queue(struct hdd_adapter *adapter)
hdd_debug("FILS Roaming support: %d",
hdd_ctx->is_fils_roaming_supported);
roam_profile = hdd_roam_profile(adapter);
ifa = hdd_lookup_ifaddr(adapter);
if (ifa && hdd_ctx->is_fils_roaming_supported)
sme_send_hlp_ie_info(hdd_ctx->mac_handle, adapter->vdev_id,
roam_profile, ifa->ifa_local);
ifa->ifa_local);
hdd_send_ps_config_to_fw(adapter);
exit:
hdd_exit();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2017, 2019-2021 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
@ -56,7 +56,6 @@
#define IPN_LEN 6
#define FILS_SESSION_LENGTH 8
#define FILS_MAX_KDE_LIST_LEN 255
#define FILS_MAX_HLP_DATA_LEN 2048
/* 12.12.2.5.3 80211-ai draft */
#define FILS_SHA384_KEK_LEN 64

View File

@ -1452,7 +1452,7 @@ void lim_update_fils_config(struct mac_context *mac_ctx,
mlme_priv = wlan_vdev_mlme_get_ext_hdl(session->vdev);
if (!mlme_priv)
return;
fils_info = mlme_priv->fils_con_info;
fils_info = mlme_priv->connect_info.fils_con_info;
if (!fils_info)
return;
pe_fils_info = session->fils_info;

View File

@ -2928,12 +2928,12 @@ static inline void lim_update_pmksa_to_profile(struct wlan_objmgr_vdev *vdev,
pe_err("vdev legacy private object is NULL");
return;
}
if (!mlme_priv->fils_con_info)
if (!mlme_priv->connect_info.fils_con_info)
return;
mlme_priv->fils_con_info->pmk_len = pmksa->pmk_len;
qdf_mem_copy(mlme_priv->fils_con_info->pmk,
mlme_priv->connect_info.fils_con_info->pmk_len = pmksa->pmk_len;
qdf_mem_copy(mlme_priv->connect_info.fils_con_info->pmk,
pmksa->pmk, pmksa->pmk_len);
qdf_mem_copy(mlme_priv->fils_con_info->pmkid,
qdf_mem_copy(mlme_priv->connect_info.fils_con_info->pmkid,
pmksa->pmkid, PMKID_LEN);
}
#else

View File

@ -715,10 +715,10 @@ struct csr_roam_profile {
bool force_24ghz_in_ht20;
uint32_t cac_duration_ms;
uint32_t dfs_regdomain;
#ifndef FEATURE_CM_ENABLE
#ifdef WLAN_FEATURE_FILS_SK
uint8_t *hlp_ie;
uint32_t hlp_ie_len;
struct wlan_fils_connection_info *fils_con_info;
#endif
#endif
bool force_rsne_override;
};

View File

@ -2858,7 +2858,6 @@ void sme_clear_sae_single_pmk_info(struct wlan_objmgr_psoc *psoc,
* sme_send_hlp_ie_info() - API to send HLP IE info to fw
* @mac_handle: Opaque handle to the global MAC context
* @vdev_id: vdev id
* @profile: CSR Roam profile
* @if_addr: IP address
*
* This API is used to send HLP IE info along with IP address
@ -2867,7 +2866,7 @@ void sme_clear_sae_single_pmk_info(struct wlan_objmgr_psoc *psoc,
* Return: None
*/
void sme_send_hlp_ie_info(mac_handle_t mac_handle, uint8_t vdev_id,
struct csr_roam_profile *profile, uint32_t if_addr);
uint32_t if_addr);
/**
* sme_update_session_assoc_ie() - Updates the assoc IEs to csr_roam_session

View File

@ -6085,7 +6085,7 @@ QDF_STATUS sme_update_fils_config(mac_handle_t mac_handle, uint8_t vdev_id,
}
#endif
void sme_send_hlp_ie_info(mac_handle_t mac_handle, uint8_t vdev_id,
struct csr_roam_profile *profile, uint32_t if_addr)
uint32_t if_addr)
{
int i;
struct scheduler_msg msg;
@ -6093,6 +6093,8 @@ void sme_send_hlp_ie_info(mac_handle_t mac_handle, uint8_t vdev_id,
struct hlp_params *params;
struct mac_context *mac = MAC_CONTEXT(mac_handle);
struct csr_roam_session *session = CSR_GET_SESSION(mac, vdev_id);
struct mlme_legacy_priv *mlme_priv;
struct wlan_objmgr_vdev *vdev;
if (!session) {
sme_err("session NULL");
@ -6112,22 +6114,39 @@ void sme_send_hlp_ie_info(mac_handle_t mac_handle, uint8_t vdev_id,
if (!params)
return;
if ((profile->hlp_ie_len +
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, vdev_id,
WLAN_MLME_NB_ID);
if (!vdev) {
mlme_err("vdev object is NULL for vdev_id %d", vdev_id);
qdf_mem_free(params);
return;
}
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
if (!mlme_priv) {
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
qdf_mem_free(params);
return;
}
if ((mlme_priv->connect_info.hlp_ie_len +
QDF_IPV4_ADDR_SIZE) > FILS_MAX_HLP_DATA_LEN) {
sme_err("HLP IE len exceeds %d",
profile->hlp_ie_len);
mlme_priv->connect_info.hlp_ie_len);
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
qdf_mem_free(params);
return;
}
params->vdev_id = vdev_id;
params->hlp_ie_len = profile->hlp_ie_len + QDF_IPV4_ADDR_SIZE;
params->hlp_ie_len =
mlme_priv->connect_info.hlp_ie_len + QDF_IPV4_ADDR_SIZE;
for (i = 0; i < QDF_IPV4_ADDR_SIZE; i++)
params->hlp_ie[i] = (if_addr >> (i * 8)) & 0xFF;
qdf_mem_copy(params->hlp_ie + QDF_IPV4_ADDR_SIZE,
profile->hlp_ie, profile->hlp_ie_len);
mlme_priv->connect_info.hlp_ie,
mlme_priv->connect_info.hlp_ie_len);
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
msg.type = SIR_HAL_HLP_IE_INFO;
msg.reserved = 0;

View File

@ -7189,22 +7189,6 @@ static void update_profile_fils_info(struct mac_context *mac,
wlan_cm_update_mlme_fils_connection_info(mac->psoc,
des_profile->fils_con_info,
vdev_id);
if (src_profile->hlp_ie_len) {
if (des_profile->hlp_ie)
qdf_mem_free(des_profile->hlp_ie);
des_profile->hlp_ie =
qdf_mem_malloc(src_profile->hlp_ie_len);
if (!des_profile->hlp_ie) {
qdf_mem_free(des_profile->fils_con_info);
des_profile->fils_con_info = NULL;
return;
}
qdf_mem_copy(des_profile->hlp_ie, src_profile->hlp_ie,
src_profile->hlp_ie_len);
des_profile->hlp_ie_len = src_profile->hlp_ie_len;
}
}
#else
static inline

View File

@ -2703,12 +2703,12 @@ static inline void csr_update_pmksa_to_profile(struct wlan_objmgr_vdev *vdev,
mlme_err("vdev legacy private object is NULL");
return;
}
if (!mlme_priv->fils_con_info)
if (!mlme_priv->connect_info.fils_con_info)
return;
mlme_priv->fils_con_info->pmk_len = pmksa->pmk_len;
qdf_mem_copy(mlme_priv->fils_con_info->pmk,
mlme_priv->connect_info.fils_con_info->pmk_len = pmksa->pmk_len;
qdf_mem_copy(mlme_priv->connect_info.fils_con_info->pmk,
pmksa->pmk, pmksa->pmk_len);
qdf_mem_copy(mlme_priv->fils_con_info->pmkid,
qdf_mem_copy(mlme_priv->connect_info.fils_con_info->pmkid,
pmksa->pmkid, PMKID_LEN);
}
#else
@ -3466,12 +3466,6 @@ void csr_free_fils_profile_info(struct mac_context *mac,
qdf_mem_free(profile->fils_con_info);
profile->fils_con_info = NULL;
}
if (profile->hlp_ie) {
qdf_mem_free(profile->hlp_ie);
profile->hlp_ie = NULL;
profile->hlp_ie_len = 0;
}
}
#else
static inline void csr_free_fils_profile_info(struct mac_context *mac,