Browse Source

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
Srikanth Marepalli 4 years ago
parent
commit
e4323e039d

+ 16 - 7
components/mlme/dispatcher/inc/cfg_mlme_generic.h

@@ -651,11 +651,16 @@ enum wlan_wds_mode {
  * <ini>
  * disable_4way_hs_offload - Enable/Disable 4 way handshake offload to firmware
  * @Min: 0
- * @Max: 1
- * @Default: 0
+ * @Max: 0x2
+ * @Default: 0x2
+ *
+ * 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
  *
- * 0  4-way HS to be handled in firmware
- * 1  4-way HS to be handled in supplicant
+ * Based on the requirement the Max value can be increased per AKM.
  *
  * Related: None
  *
@@ -665,9 +670,13 @@ enum wlan_wds_mode {
  *
  * </ini>
  */
-#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")
 
 /*
  * <ini>

+ 1 - 1
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -2423,7 +2423,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

+ 1 - 1
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1366,7 +1366,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;

+ 1 - 1
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -3773,7 +3773,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;
 

+ 4 - 0
components/target_if/connection_mgr/src/target_if_cm_roam_offload.c

@@ -799,6 +799,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;
 }
 

+ 7 - 2
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h

@@ -511,15 +511,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)
 };
 
 /**

+ 3 - 0
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

+ 9 - 3
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);

+ 6 - 0
core/wma/src/wma_main.c

@@ -6920,6 +6920,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);