From c5e64e4f2d68338e5702b35710341ff92696ab52 Mon Sep 17 00:00:00 2001 From: Srikanth Marepalli Date: Sat, 16 Jan 2021 01:37:30 +0530 Subject: [PATCH] qcacld-3.0: Enhance the EAPOL handshake offload INI per AKM Existing INI disable_4way_hs_offload is defined as a boolean that controls the EAPOL Handshake to be offloaded to Firmware or Not. There is no way to specify the EAPOL offload per AKM. Hence extended the support of EAPOL handshake offload to firmware per AKM by converting this INI to a bitmap integer. With ini value as 0 by default Firmware takes care of 4-way HS during roam for all AKMs except for SAE and OWE. If this ini value is 1 then Host takes care of EAPOL for all AKMs. Having the backward compatibility, added a new value to ini. If this ini value is set to 2 and also if the SAE EAPOL offload service bit is set by Firmware then the behavior is same as ini with 0 except that Firmware takes care of 4-way HS for SAE roam as well. And for OWE it is still handled by supplicant. To achieve this, new roam offload flag is introduced to indicate Firmware about SAE roam EAPOL offload, So that in Roam sync indication Firmware will inform the status as connected but not authenticated so that supplicant can take care of 4-way EAPOL HS. Change-Id: I8b65a1768fad91fac7e427712d3ccf4586176f5f CRs-Fixed: 2955029 --- .../mlme/dispatcher/inc/cfg_mlme_generic.h | 23 +++++++++++++------ .../mlme/dispatcher/inc/wlan_mlme_api.h | 2 +- .../dispatcher/inc/wlan_mlme_public_struct.h | 2 +- .../mlme/dispatcher/src/wlan_mlme_api.c | 2 +- .../src/target_if_cm_roam_offload.c | 4 ++++ .../inc/wlan_cm_roam_public_struct.h | 9 ++++++-- .../dispatcher/inc/wlan_cm_tgt_if_tx_api.h | 3 +++ .../dispatcher/src/wlan_cm_tgt_if_tx_api.c | 12 +++++++--- core/wma/src/wma_main.c | 6 +++++ 9 files changed, 48 insertions(+), 15 deletions(-) diff --git a/components/mlme/dispatcher/inc/cfg_mlme_generic.h b/components/mlme/dispatcher/inc/cfg_mlme_generic.h index 9bf436814daf..c75e4bf3ba93 100644 --- a/components/mlme/dispatcher/inc/cfg_mlme_generic.h +++ b/components/mlme/dispatcher/inc/cfg_mlme_generic.h @@ -640,11 +640,16 @@ enum monitor_mode_concurrency { * * disable_4way_hs_offload - Enable/Disable 4 way handshake offload to firmware * @Min: 0 - * @Max: 1 - * @Default: 0 + * @Max: 0x2 + * @Default: 0x2 * - * 0 4-way HS to be handled in firmware - * 1 4-way HS to be handled in supplicant + * 0x0 - 4-way HS to be handled in firmware for the AKMs except for SAE and + * OWE roaming the 4way HS is handled in supplicant by default + * 0x1 - 4-way HS to be handled in supplicant + * 0x2 - 4-way HS to be handled in firmware for the AKMs including the SAE + * Roam except for OWE roaming the 4way HS is handled in supplicant + * + * Based on the requirement the Max value can be increased per AKM. * * Related: None * @@ -654,9 +659,13 @@ enum monitor_mode_concurrency { * * */ -#define CFG_DISABLE_4WAY_HS_OFFLOAD CFG_INI_BOOL("disable_4way_hs_offload", \ - 0, \ - "Enable/disable 4 way handshake offload to firmware") +#define CFG_DISABLE_4WAY_HS_OFFLOAD CFG_INI_UINT( \ + "disable_4way_hs_offload", \ + 0, \ + 0x2, \ + 0x2, \ + CFG_VALUE_OR_DEFAULT, \ + "Enable/disable 4 way handshake offload to firmware") /* * diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index f7b2fcfe6ae7..547daa03d593 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -2352,7 +2352,7 @@ wlan_mlme_get_self_gen_frm_pwr(struct wlan_objmgr_psoc *psoc, * Return: QDF Status */ QDF_STATUS -wlan_mlme_get_4way_hs_offload(struct wlan_objmgr_psoc *psoc, bool *value); +wlan_mlme_get_4way_hs_offload(struct wlan_objmgr_psoc *psoc, uint32_t *value); /** * wlan_mlme_get_bmiss_skip_full_scan_value() - To get value of diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h index b7aec96de49d..4d2831f6f007 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h @@ -1263,7 +1263,7 @@ struct wlan_mlme_generic { bool enable_beacon_reception_stats; bool enable_remove_time_stamp_sync_cmd; bool data_stall_recovery_fw_support; - bool disable_4way_hs_offload; + uint32_t disable_4way_hs_offload; bool as_enabled; uint8_t mgmt_retry_max; bool bmiss_skip_full_scan; diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 06d69458b1e0..2ebed2fa3bdd 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -3602,7 +3602,7 @@ wlan_mlme_get_self_gen_frm_pwr(struct wlan_objmgr_psoc *psoc, } QDF_STATUS -wlan_mlme_get_4way_hs_offload(struct wlan_objmgr_psoc *psoc, bool *value) +wlan_mlme_get_4way_hs_offload(struct wlan_objmgr_psoc *psoc, uint32_t *value) { struct wlan_mlme_psoc_ext_obj *mlme_obj; diff --git a/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c b/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c index dc6d647bc5df..c8c885f24a2f 100644 --- a/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c +++ b/components/target_if/connection_mgr/src/target_if_cm_roam_offload.c @@ -754,6 +754,10 @@ target_if_get_wmi_roam_offload_flag(uint32_t flag) if (flag & WLAN_ROAM_BMISS_FINAL_SCAN_TYPE) roam_offload_flag |= WMI_ROAM_BMISS_FINAL_SCAN_TYPE_FLAG; + if (flag & WLAN_ROAM_SKIP_SAE_ROAM_4WAY_HANDSHAKE) + roam_offload_flag |= + WMI_VDEV_PARAM_SKIP_SAE_ROAM_4WAY_HANDSHAKE; + return roam_offload_flag; } diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h index ed6d65bea6a4..f378b45dee28 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h @@ -130,15 +130,20 @@ enum roam_cfg_param { * miss event at firmware * @WLAN_ROAM_SKIP_EAPOL_4WAY_HANDSHAKE: Disable 4 Way-HS offload to firmware * Setting this flag will make the eapol packets reach to host every time - * and can cause frequent APPS wake-ups. + * and can cause frequent APPS wake-ups. And clearing this flag will make + * eapol offload to firmware except for SAE and OWE roam. * @WLAN_ROAM_BMISS_FINAL_SCAN_TYPE: Set this flag to skip full scan on final * bmiss and use the channel map to do the partial scan alone + * @WLAN_ROAM_SKIP_SAE_ROAM_4WAY_HANDSHAKE: Disable 4 Way-HS offload to firmware + * Setting this flag will make the eapol packets reach to host and clearing this + * flag will make eapol offload to firmware including for SAE roam. */ enum roam_offload_init_flags { WLAN_ROAM_FW_OFFLOAD_ENABLE = BIT(1), WLAN_ROAM_BMISS_FINAL_SCAN_ENABLE = BIT(2), WLAN_ROAM_SKIP_EAPOL_4WAY_HANDSHAKE = BIT(3), - WLAN_ROAM_BMISS_FINAL_SCAN_TYPE = BIT(4) + WLAN_ROAM_BMISS_FINAL_SCAN_TYPE = BIT(4), + WLAN_ROAM_SKIP_SAE_ROAM_4WAY_HANDSHAKE = BIT(5) }; /** diff --git a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h index 6d85b0296e38..43c867d7f5f6 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h +++ b/components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_tgt_if_tx_api.h @@ -46,6 +46,9 @@ wlan_cm_roam_send_set_vdev_pcl(struct wlan_objmgr_psoc *psoc, #endif /* WLAN_FEATURE_ROAM_OFFLOAD */ #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD) + +#define CFG_DISABLE_4WAY_HS_OFFLOAD_DEFAULT BIT(0) + /** * wlan_cm_tgt_send_roam_offload_init() - Send WMI_VDEV_PARAM_ROAM_FW_OFFLOAD * to init/deinit roaming module at firmware diff --git a/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_tgt_if_tx_api.c b/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_tgt_if_tx_api.c index 71fa3b929c20..8b7c322cb5b1 100644 --- a/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_tgt_if_tx_api.c +++ b/components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_tgt_if_tx_api.c @@ -164,7 +164,8 @@ QDF_STATUS wlan_cm_tgt_send_roam_offload_init(struct wlan_objmgr_psoc *psoc, struct wlan_cm_roam_tx_ops *roam_tx_ops; struct wlan_objmgr_vdev *vdev; struct wlan_roam_offload_init_params init_msg = {0}; - bool disable_4way_hs_offload, bmiss_skip_full_scan; + uint32_t disable_4way_hs_offload; + bool bmiss_skip_full_scan; vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, WLAN_MLME_NB_ID); @@ -190,9 +191,14 @@ QDF_STATUS wlan_cm_tgt_send_roam_offload_init(struct wlan_objmgr_psoc *psoc, WLAN_ROAM_BMISS_FINAL_SCAN_ENABLE; wlan_mlme_get_4way_hs_offload(psoc, &disable_4way_hs_offload); - if (disable_4way_hs_offload) + if (!disable_4way_hs_offload) init_msg.roam_offload_flag |= - WLAN_ROAM_SKIP_EAPOL_4WAY_HANDSHAKE; + WLAN_ROAM_SKIP_SAE_ROAM_4WAY_HANDSHAKE; + if (disable_4way_hs_offload & + CFG_DISABLE_4WAY_HS_OFFLOAD_DEFAULT) + init_msg.roam_offload_flag |= + (WLAN_ROAM_SKIP_EAPOL_4WAY_HANDSHAKE | + WLAN_ROAM_SKIP_SAE_ROAM_4WAY_HANDSHAKE); wlan_mlme_get_bmiss_skip_full_scan_value(psoc, &bmiss_skip_full_scan); diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index b650a8151b81..2064c6a5f424 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -6921,6 +6921,12 @@ int wma_rx_service_ready_ext_event(void *handle, uint8_t *event, else wlan_res_cfg->pktcapture_support = false; + if (wmi_service_enabled(wmi_handle, + wmi_service_sae_eapol_offload_support)) + wlan_res_cfg->sae_eapol_offload = true; + else + wlan_res_cfg->sae_eapol_offload = false; + wma_debug("num_vdevs: %u", wlan_res_cfg->num_vdevs); wma_init_dbr_params(wma_handle);