qcacld-3.0: Update HLP data from FILS assoc rsp frame to PE session

HLP data extracted from FILS association response frame needs to
be sent to upper layer. When association success is posted to
sme, HLP data is copied from lim pe_fils_info structure to
sme_join_rsp->roam_fils_info. But the hlp data is parsed from
association response frame but its not copied to pe_fils_session
This resuts in hlp data not sent to hdd and upper layers.
Copy fils data from parsed association response frame into the
pe_fils_info for FILS connection.

Currently there is pointer to hlp_data in pe_session also. But
it is not used and memory allocation is also not done for this
hlp_data. Cleanup this unused hlp data in pe_session and only
use the hlp data from pe_fils_session structure.

Change-Id: I0ef6df6e55130e18a85e2ddf49f8293d8672ac0b
CRs-Fixed: 2424493
This commit is contained in:
Pragaspathi Thilagaraj
2019-04-12 19:54:39 +05:30
committed by nshrivas
parent 14f72de820
commit 42dc8c9360
5 changed files with 86 additions and 20 deletions

View File

@@ -640,6 +640,15 @@ void cds_copy_hlp_info(struct qdf_mac_addr *input_dst_mac,
return;
}
if (!input_dst_mac) {
cds_debug("HLP destination mac NULL");
return;
}
if (!input_src_mac) {
cds_debug("HLP source mac NULL");
return;
}
qdf_copy_macaddr(output_dst_mac, input_dst_mac);
qdf_copy_macaddr(output_src_mac, input_src_mac);
*output_hlp_data_len = input_hlp_data_len;

View File

@@ -133,6 +133,22 @@ void populate_fils_connect_params(struct mac_context *mac_ctx,
struct pe_session *session,
struct join_rsp *sme_join_rsp);
/**
* lim_update_fils_hlp_data() - Update the hlp data from association
* response frame to PE session.
* @hlp_frm_src_mac: SRC mac address in HLP IE from assoc frame
* @hlp_frm_dst_mac: DST mac address in HLP IE from assoc frame
* @frm_hlp_len: HLP data length
* @frm_hlp_data: Pointer to hlp data
* @pe_session: Pointer to pe_session
*
* Return: None
*/
void lim_update_fils_hlp_data(struct qdf_mac_addr *hlp_frm_src_mac,
struct qdf_mac_addr *hlp_frm_dest_mac,
uint16_t frm_hlp_len, uint8_t *frm_hlp_data,
struct pe_session *pe_session);
/**
* aead_encrypt_assoc_req() - Encrypt FILS IE's in assoc request
* @mac_ctx: mac context
@@ -253,6 +269,13 @@ static inline void populate_fils_connect_params(struct mac_context *mac_ctx,
struct join_rsp *sme_join_rsp)
{ }
static inline
void lim_update_fils_hlp_data(struct qdf_mac_addr *hlp_frm_src_mac,
struct qdf_mac_addr *hlp_frm_dest_mac,
uint16_t frm_hlp_len, uint8_t *frm_hlp_data,
struct pe_session *pe_session)
{}
static inline QDF_STATUS aead_encrypt_assoc_req(struct mac_context *mac_ctx,
struct pe_session *pe_session,
uint8_t *frame,

View File

@@ -533,10 +533,6 @@ struct pe_session {
bool he_with_wep_tkip;
#ifdef WLAN_FEATURE_FILS_SK
struct pe_fils_session *fils_info;
struct qdf_mac_addr dst_mac;
struct qdf_mac_addr src_mac;
uint16_t hlp_data_len;
uint8_t *hlp_data;
#endif
/* previous auth frame's sequence number */
uint16_t prev_auth_seq_num;

View File

@@ -2053,26 +2053,30 @@ lim_roam_fill_bss_descr(struct mac_context *mac,
*
* Return: None
*/
static void lim_copy_and_free_hlp_data_from_session(struct pe_session *session_ptr,
struct roam_offload_synch_ind *roam_sync_ind_ptr)
static void
lim_copy_and_free_hlp_data_from_session(struct pe_session *session_ptr,
struct roam_offload_synch_ind
*roam_sync_ind_ptr)
{
if (session_ptr->hlp_data && session_ptr->hlp_data_len) {
cds_copy_hlp_info(&session_ptr->dst_mac,
&session_ptr->src_mac,
session_ptr->hlp_data_len,
session_ptr->hlp_data,
&roam_sync_ind_ptr->dst_mac,
&roam_sync_ind_ptr->src_mac,
&roam_sync_ind_ptr->hlp_data_len,
roam_sync_ind_ptr->hlp_data);
qdf_mem_free(session_ptr->hlp_data);
session_ptr->hlp_data = NULL;
session_ptr->hlp_data_len = 0;
if (session_ptr->fils_info->hlp_data &&
session_ptr->fils_info->hlp_data_len) {
cds_copy_hlp_info(&session_ptr->fils_info->dst_mac,
&session_ptr->fils_info->src_mac,
session_ptr->fils_info->hlp_data_len,
session_ptr->fils_info->hlp_data,
&roam_sync_ind_ptr->dst_mac,
&roam_sync_ind_ptr->src_mac,
&roam_sync_ind_ptr->hlp_data_len,
roam_sync_ind_ptr->hlp_data);
qdf_mem_free(session_ptr->fils_info->hlp_data);
session_ptr->fils_info->hlp_data = NULL;
session_ptr->fils_info->hlp_data_len = 0;
}
}
#else
static inline void lim_copy_and_free_hlp_data_from_session(
struct pe_session *session_ptr,
static inline void
lim_copy_and_free_hlp_data_from_session(struct pe_session *session_ptr,
struct roam_offload_synch_ind
*roam_sync_ind_ptr)
{}

View File

@@ -1426,6 +1426,34 @@ static QDF_STATUS lim_parse_kde_elements(struct mac_context *mac_ctx,
return QDF_STATUS_SUCCESS;
}
void lim_update_fils_hlp_data(struct qdf_mac_addr *hlp_frm_src_mac,
struct qdf_mac_addr *hlp_frm_dest_mac,
uint16_t frm_hlp_len, uint8_t *frm_hlp_data,
struct pe_session *pe_session)
{
struct pe_fils_session *pe_fils_info = pe_session->fils_info;
if (!pe_fils_info) {
pe_err("Not a fils connection");
return;
}
if (frm_hlp_data && frm_hlp_len) {
qdf_mem_free(pe_fils_info->hlp_data);
pe_fils_info->hlp_data = qdf_mem_malloc(frm_hlp_len);
if (!pe_fils_info->hlp_data)
return;
pe_debug("FILS: hlp_data_len:%d", frm_hlp_len);
cds_copy_hlp_info(hlp_frm_dest_mac, hlp_frm_src_mac,
frm_hlp_len, frm_hlp_data,
&pe_fils_info->dst_mac,
&pe_fils_info->src_mac,
&pe_fils_info->hlp_data_len,
pe_fils_info->hlp_data);
}
}
bool lim_verify_fils_params_assoc_rsp(struct mac_context *mac_ctx,
struct pe_session *session_entry,
tpSirAssocRsp assoc_rsp,
@@ -1483,6 +1511,12 @@ bool lim_verify_fils_params_assoc_rsp(struct mac_context *mac_ctx,
pe_err("KDE parsing fails");
goto verify_fils_params_fails;
}
lim_update_fils_hlp_data(&assoc_rsp->dst_mac,
&assoc_rsp->src_mac,
assoc_rsp->hlp_data_len,
assoc_rsp->hlp_data,
session_entry);
return true;
verify_fils_params_fails: