Browse Source

qcacld-3.0: Check SAE & OWE target capability to enable RSO

Currently the host driver blocks roam scan offload command to
the target if the connected akm is OWE or SAE.

Add changes to read the WMI_SERVICE_WPA3_SAE_ROAM_SUPPORT and
WMI_SERVICE_WPA3_OWE_ROAM_SUPPORT service capability advertised
by the target and set it to the mlme fw_akm_bitmap. Read this
bitmap in csr_roam_offload_scan() to allow RSO command.

Also the connected akm is sent to the target via the
WMI_AP_PROFILE command. Translate the CSR akm type for OWE and
SAE akm also.

Change-Id: I68527722ab099e0c8e1681ed64ea416b9a6e9936
CRs-Fixed: 2491021
Pragaspathi Thilagaraj 5 years ago
parent
commit
ba42a982b3

+ 11 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -2236,4 +2236,15 @@ wlan_mlme_get_4way_hs_offload(struct wlan_objmgr_psoc *psoc, bool *value);
 QDF_STATUS
 mlme_get_peer_phymode(struct wlan_objmgr_psoc *psoc, uint8_t *mac,
 		      enum wlan_phymode *peer_phymode);
+
+/**
+ * mlme_set_tgt_wpa3_roam_cap() - Set the target WPA3 roam support
+ * to mlme
+ * @psoc: pointer to PSOC object
+ * @akm_bitmap: Bitmap of akm suites supported for roaming by the firmware
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS mlme_set_tgt_wpa3_roam_cap(struct wlan_objmgr_psoc *psoc,
+				      uint32_t akm_bitmap);
 #endif /* _WLAN_MLME_API_H_ */

+ 3 - 2
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1315,12 +1315,13 @@ struct bss_load_trigger {
 };
 
 /*
- * AKM suites supported by firmware for
- * roaming
+ * AKM suites supported by firmware for roaming
  */
 #define AKM_FT_SAE           0
 #define AKM_FT_SUITEB_SHA384 1
 #define AKM_FT_FILS          2
+#define AKM_SAE              3
+#define AKM_OWE              4
 
 /*
  * @mawc_roam_enabled:              Enable/Disable MAWC during roaming

+ 0 - 12
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -1043,18 +1043,6 @@ QDF_STATUS
 ucfg_mlme_get_first_scan_bucket_threshold(struct wlan_objmgr_psoc *psoc,
 					  uint8_t *val);
 
-/**
- * ucfg_mlme_set_fw_supported_roaming_akm() - update the supported roaming
- * akm suites advertised by the firmware via wmi service capability
- * @psoc: pointer to psoc object
- * @val:  bitmap value based on firmware capabilities
- *
- * Return: QDF Status
- */
-QDF_STATUS
-ucfg_mlme_set_fw_supported_roaming_akm(struct wlan_objmgr_psoc *psoc,
-				       uint32_t val);
-
 /**
  * ucfg_mlme_is_mawc_enabled() - MAWC enabled or not
  * @psoc: pointer to psoc object

+ 14 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -3449,3 +3449,17 @@ QDF_STATUS mlme_get_peer_phymode(struct wlan_objmgr_psoc *psoc, uint8_t *mac,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+QDF_STATUS mlme_set_tgt_wpa3_roam_cap(struct wlan_objmgr_psoc *psoc,
+				      uint32_t akm_bitmap)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_FAILURE;
+
+	mlme_obj->cfg.lfr.fw_akm_bitmap |= akm_bitmap;
+
+	return QDF_STATUS_SUCCESS;
+}

+ 0 - 14
components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c

@@ -701,20 +701,6 @@ ucfg_mlme_get_first_scan_bucket_threshold(struct wlan_objmgr_psoc *psoc,
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS
-ucfg_mlme_set_fw_supported_roaming_akm(struct wlan_objmgr_psoc *psoc,
-				       uint32_t val)
-{
-	struct wlan_mlme_psoc_obj *mlme_obj;
-
-	mlme_obj = mlme_get_psoc_obj(psoc);
-	if (!mlme_obj)
-		return QDF_STATUS_E_INVAL;
-
-	mlme_obj->cfg.lfr.fw_akm_bitmap = val;
-	return QDF_STATUS_SUCCESS;
-}
-
 QDF_STATUS
 ucfg_mlme_is_mawc_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
 {

+ 0 - 5
core/hdd/src/wlan_hdd_main.c

@@ -2152,11 +2152,6 @@ int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
 	hdd_lpass_target_config(hdd_ctx, cfg);
 
 	hdd_ctx->ap_arpns_support = cfg->ap_arpns_support;
-	status = ucfg_mlme_set_fw_supported_roaming_akm(
-						hdd_ctx->psoc,
-						cfg->ft_akm_service_bitmap);
-	if (QDF_IS_STATUS_ERROR(status))
-		hdd_err("Failed to set ft akm suites bitmap");
 
 	hdd_update_tgt_services(hdd_ctx, &cfg->services);
 

+ 7 - 0
core/sme/inc/csr_api.h

@@ -1388,14 +1388,21 @@ typedef QDF_STATUS (*csr_session_close_cb)(uint8_t session_id);
 #define CSR_IS_FW_FT_SAE_SUPPORTED(fw_akm_bitmap) \
 	(((fw_akm_bitmap) & (1 << AKM_FT_SAE)) ? true : false)
 
+#define CSR_IS_FW_SAE_ROAM_SUPPORTED(fw_akm_bitmap) \
+	(((fw_akm_bitmap) & (1 << AKM_SAE)) ? true : false)
 #else
 #define CSR_IS_AUTH_TYPE_SAE(auth_type) (false)
 
 #define CSR_IS_AKM_FT_SAE(auth_type) (false)
 
 #define CSR_IS_FW_FT_SAE_SUPPORTED(fw_akm_bitmap) (false)
+
+#define CSR_IS_FW_SAE_ROAM_SUPPORTED(fw_akm_bitmap) (false)
 #endif
 
+#define CSR_IS_FW_OWE_ROAM_SUPPORTED(fw_akm_bitmap) \
+	(((fw_akm_bitmap) & (1 << AKM_OWE)) ? true : false)
+
 #define CSR_IS_AKM_FT_SUITEB_SHA384(auth_type) \
 	(eCSR_AUTH_TYPE_FT_SUITEB_EAP_SHA384 == (auth_type))
 

+ 5 - 3
core/sme/src/csr/csr_api_roam.c

@@ -19220,14 +19220,17 @@ csr_roam_offload_scan(struct mac_context *mac_ctx, uint8_t session_id,
 		return QDF_STATUS_SUCCESS;
 	}
 
+	fw_akm_bitmap = mac_ctx->mlme_cfg->lfr.fw_akm_bitmap;
 	/* Roaming is not supported currently for OWE akm */
-	if (roam_profile_akm == eCSR_AUTH_TYPE_OWE) {
+	if (roam_profile_akm == eCSR_AUTH_TYPE_OWE &&
+	    !CSR_IS_FW_OWE_ROAM_SUPPORTED(fw_akm_bitmap)) {
 		sme_info("OWE Roaming not suppprted by fw");
 		return QDF_STATUS_SUCCESS;
 	}
 
 	/* Roaming is not supported for SAE authentication */
-	if (CSR_IS_AUTH_TYPE_SAE(roam_profile_akm)) {
+	if (CSR_IS_AUTH_TYPE_SAE(roam_profile_akm) &&
+	    !CSR_IS_FW_SAE_ROAM_SUPPORTED(fw_akm_bitmap)) {
 		sme_info("Roaming not suppprted for SAE connection");
 		return QDF_STATUS_SUCCESS;
 	}
@@ -19236,7 +19239,6 @@ csr_roam_offload_scan(struct mac_context *mac_ctx, uint8_t session_id,
 	 * If fw doesn't advertise FT SAE, FT-FILS or FT-Suite-B capability,
 	 * don't support roaming to that profile
 	 */
-	fw_akm_bitmap = mac_ctx->mlme_cfg->lfr.fw_akm_bitmap;
 	if (CSR_IS_AKM_FT_SAE(roam_profile_akm)) {
 		if (!CSR_IS_FW_FT_SAE_SUPPORTED(fw_akm_bitmap)) {
 			sme_info("Roaming not suppprted for FT SAE akm");

+ 0 - 2
core/wma/inc/wma_tgt_cfg.h

@@ -173,7 +173,6 @@ struct board_info {
  * @obss_color_collision_offloaded: obss color collision offloaded to firmware
  * @sar_version: Version of SAR supported by firmware
  * @bcast_twt_support: braodcast twt support
- * @ft_akm_service_bitmap: bitmap of FT akm supported by firmware
  */
 struct wma_tgt_cfg {
 	uint32_t target_fw_version;
@@ -214,6 +213,5 @@ struct wma_tgt_cfg {
 	enum sar_version sar_version;
 	struct nan_tgt_caps nan_caps;
 	bool bcast_twt_support;
-	uint32_t ft_akm_service_bitmap;
 };
 #endif /* WMA_TGT_CFG_H */

+ 31 - 10
core/wma/src/wma_main.c

@@ -5630,16 +5630,6 @@ static int wma_update_hdd_cfg(tp_wma_handle wma_handle)
 
 	tgt_cfg.max_intf_count = wlan_res_cfg->num_vdevs;
 
-	if (wmi_service_enabled(wmi_handle, wmi_service_wpa3_ft_sae_support))
-		tgt_cfg.ft_akm_service_bitmap |= (1 << AKM_FT_SAE);
-
-	if (wmi_service_enabled(wmi_handle,
-				wmi_service_wpa3_ft_suite_b_support))
-		tgt_cfg.ft_akm_service_bitmap |= (1 << AKM_FT_SUITEB_SHA384);
-
-	if (wmi_service_enabled(wmi_handle, wmi_service_ft_fils))
-		tgt_cfg.ft_akm_service_bitmap |= (1 << AKM_FT_FILS);
-
 	qdf_mem_copy(tgt_cfg.hw_macaddr.bytes, wma_handle->hwaddr,
 		     ATH_MAC_LEN);
 
@@ -5811,6 +5801,7 @@ static void wma_set_mlme_caps(struct wlan_objmgr_psoc *psoc)
 {
 	tp_wma_handle wma;
 	bool tgt_cap;
+	uint32_t akm_bitmap = 0;
 	QDF_STATUS status;
 
 	wma = cds_get_context(QDF_MODULE_ID_WMA);
@@ -5825,6 +5816,36 @@ static void wma_set_mlme_caps(struct wlan_objmgr_psoc *psoc)
 	status = ucfg_mlme_set_tgt_adaptive_11r_cap(psoc, tgt_cap);
 	if (QDF_IS_STATUS_ERROR(status))
 		WMA_LOGE("Failed to set adaptive 11r cap");
+
+	tgt_cap = wmi_service_enabled(wma->wmi_handle,
+				      wmi_service_wpa3_ft_sae_support);
+	if (tgt_cap)
+		 akm_bitmap |= (1 << AKM_FT_SAE);
+
+	tgt_cap = wmi_service_enabled(wma->wmi_handle,
+				      wmi_service_wpa3_ft_suite_b_support);
+	if (tgt_cap)
+		akm_bitmap |= (1 << AKM_FT_SUITEB_SHA384);
+
+	tgt_cap = wmi_service_enabled(wma->wmi_handle,
+				      wmi_service_ft_fils);
+	if (tgt_cap)
+		akm_bitmap |= (1 << AKM_FT_FILS);
+
+	tgt_cap = wmi_service_enabled(wma->wmi_handle,
+				      wmi_service_owe_roam_support);
+	if (tgt_cap)
+		akm_bitmap |= (1 << AKM_OWE);
+
+	tgt_cap = wmi_service_enabled(wma->wmi_handle,
+				      wmi_service_sae_roam_support);
+	if (tgt_cap)
+		akm_bitmap |= (1 << AKM_SAE);
+
+
+	status = mlme_set_tgt_wpa3_roam_cap(psoc, akm_bitmap);
+	if (QDF_IS_STATUS_ERROR(status))
+		WMA_LOGE("Failed to set sae roam support");
 }
 
 static void wma_set_component_caps(struct wlan_objmgr_psoc *psoc)

+ 4 - 0
core/wma/src/wma_scan_roam.c

@@ -779,6 +779,10 @@ A_UINT32 e_csr_auth_type_to_rsn_authmode(enum csr_akm_type authtype,
 		return WMI_AUTH_RSNA_SUITE_B_8021X_SHA256;
 	case eCSR_AUTH_TYPE_SUITEB_EAP_SHA384:
 		return WMI_AUTH_RSNA_SUITE_B_8021X_SHA384;
+	case eCSR_AUTH_TYPE_OWE:
+		return WMI_AUTH_WPA3_OWE;
+	case eCSR_AUTH_TYPE_SAE:
+		return WMI_AUTH_WPA3_SAE;
 	case eCSR_AUTH_TYPE_FT_SAE:
 		return WMI_AUTH_FT_RSNA_SAE;
 	case eCSR_AUTH_TYPE_FT_SUITEB_EAP_SHA384: