Browse Source

qcacmn: Read OWE and SAE roam target capability

Add support for OWE and SAE roam target capability.
Add event mapping for the tgt event
WMI_ROAM_PREAUTH_START_EVENTID.

Add changes to send WMI_ROAM_PREAUTH_STATUS_CMDID after
the SAE external authentication event is received.

Also for SAE/OWE/802.1x, the key management offload
needs to be enabled by default as PMKSA caching if
set_pmksa is received from the supplicant. So remove
the additional key management offload check so that
OKC and PMKSA is enabled by default for SAE and OWE.

Change-Id: I01d3a07e2ce60e25ea8624c030c6a5802205566d
CRs-Fixed: 2491042
Pragaspathi Thilagaraj 5 years ago
parent
commit
fc54cc76a4

+ 3 - 0
wmi/inc/wmi_unified_param.h

@@ -4513,6 +4513,7 @@ typedef enum {
 #endif
 	wmi_coex_report_antenna_isolation_event_id,
 	wmi_chan_rf_characterization_info_event_id,
+	wmi_roam_auth_offload_event_id,
 	wmi_events_max,
 } wmi_conv_event_id;
 
@@ -5006,6 +5007,8 @@ typedef enum {
 	wmi_service_three_way_coex_config_legacy,
 	wmi_service_rx_fse_support,
 	wmi_service_dynamic_hw_mode,
+	wmi_service_sae_roam_support,
+	wmi_service_owe_roam_support,
 	wmi_services_max,
 } wmi_conv_service_ids;
 #define WMI_SERVICE_UNAVAILABLE 0xFFFF

+ 3 - 0
wmi/inc/wmi_unified_priv.h

@@ -593,6 +593,9 @@ QDF_STATUS (*send_disconnect_roam_params)(
 QDF_STATUS (*send_idle_roam_params)(wmi_unified_t wmi_handle,
 				    struct wmi_idle_roam_params *req);
 
+QDF_STATUS (*send_roam_preauth_status)(wmi_unified_t wmi_handle,
+				struct wmi_roam_auth_status_params *params);
+
 QDF_STATUS (*send_btm_config)(wmi_unified_t wmi_handle,
 			      struct wmi_btm_config *params);
 

+ 15 - 0
wmi/inc/wmi_unified_roam_api.h

@@ -342,6 +342,21 @@ QDF_STATUS
 wmi_unified_send_idle_roam_params(wmi_unified_t wmi_handle,
 				  struct wmi_idle_roam_params *req);
 
+/**
+ * wmi_unified_send_roam_preauth_status() - Send roam preauthentication status
+ * to target.
+ * @wmi_handle: wmi handle
+ * @param: Roam auth status params
+ *
+ * This function passes preauth status of WPA3 SAE auth to firmware. It is
+ * called when external_auth_status event is received from userspace.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wmi_unified_send_roam_preauth_status(wmi_unified_t wmi_handle,
+				     struct wmi_roam_auth_status_params *param);
+
 /**
  * wmi_unified_offload_11k_cmd() - send 11k offload command
  * @wmi_handle: wmi handle

+ 18 - 0
wmi/inc/wmi_unified_roam_param.h

@@ -688,6 +688,24 @@ struct wmi_disconnect_roam_params {
 	bool enable;
 };
 
+/**
+ * struct wmi_roam_auth_status_params - WPA3 roam auth response status
+ * parameters
+ * @vdev_id: Vdev on which roam preauth is happening
+ * @preauth_status: Status of the Auth response.
+ *      IEEE80211_STATUS_SUCCESS(0) for success. Corresponding
+ *      IEEE80211 failure status code for failure.
+ *
+ * @bssid: Candidate BSSID
+ * @pmkid: PMKID derived for the auth
+ */
+struct wmi_roam_auth_status_params {
+	uint32_t vdev_id;
+	uint32_t preauth_status;
+	struct qdf_mac_addr bssid;
+	uint8_t pmkid[PMKID_LEN];
+};
+
 /**
  * @time_offset: time offset after 11k offload command to trigger a neighbor
  *	report request (in seconds)

+ 10 - 0
wmi/src/wmi_unified_roam_api.c

@@ -289,6 +289,16 @@ wmi_unified_send_idle_roam_params(wmi_unified_t wmi_handle,
 	return QDF_STATUS_E_FAILURE;
 }
 
+QDF_STATUS
+wmi_unified_send_roam_preauth_status(wmi_unified_t wmi_handle,
+				     struct wmi_roam_auth_status_params *params)
+{
+	if (wmi_handle->ops->send_roam_preauth_status)
+		return wmi_handle->ops->send_roam_preauth_status(wmi_handle,
+								 params);
+	return QDF_STATUS_E_FAILURE;
+}
+
 QDF_STATUS wmi_unified_offload_11k_cmd(wmi_unified_t wmi_handle,
 				       struct wmi_11k_offload_params *params)
 {

+ 65 - 4
wmi/src/wmi_unified_roam_tlv.c

@@ -1322,8 +1322,7 @@ send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
 				roam_offload_11i =
 				     (wmi_roam_11i_offload_tlv_param *) buf_ptr;
 
-				if (roam_req->roam_key_mgmt_offload_enabled &&
-				    roam_req->fw_okc) {
+				if (roam_req->fw_okc) {
 					WMI_SET_ROAM_OFFLOAD_OKC_ENABLED
 						(roam_offload_11i->flags);
 					WMI_LOGI("LFR3:OKC enabled");
@@ -1332,8 +1331,8 @@ send_roam_scan_offload_mode_cmd_tlv(wmi_unified_t wmi_handle,
 						(roam_offload_11i->flags);
 					WMI_LOGI("LFR3:OKC disabled");
 				}
-				if (roam_req->roam_key_mgmt_offload_enabled &&
-				    roam_req->fw_pmksa_cache) {
+
+				if (roam_req->fw_pmksa_cache) {
 					WMI_SET_ROAM_OFFLOAD_PMK_CACHE_ENABLED
 						(roam_offload_11i->flags);
 					WMI_LOGI("LFR3:PMKSA caching enabled");
@@ -2376,6 +2375,60 @@ send_idle_roam_params_tlv(wmi_unified_t wmi_handle,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+/**
+ * send_roam_preauth_status_tlv() - send roam pre-authentication status
+ * @wmi_handle: wmi handle
+ * @params: pre-auth status params
+ *
+ * This function sends the roam pre-authentication status for WPA3 SAE
+ * pre-auth to target.
+ *
+ * Return: QDF status
+ */
+static QDF_STATUS
+send_roam_preauth_status_tlv(wmi_unified_t wmi_handle,
+			     struct wmi_roam_auth_status_params *params)
+{
+	wmi_roam_preauth_status_cmd_fixed_param *cmd;
+	wmi_buf_t buf;
+	uint32_t len;
+	uint8_t *buf_ptr;
+
+	len = sizeof(*cmd) + WMI_TLV_HDR_SIZE + PMKID_LEN;
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf)
+		return QDF_STATUS_E_NOMEM;
+
+	buf_ptr = (uint8_t *)wmi_buf_data(buf);
+	cmd = (wmi_roam_preauth_status_cmd_fixed_param *)buf_ptr;
+	WMITLV_SET_HDR(
+	    &cmd->tlv_header,
+	    WMITLV_TAG_STRUC_wmi_roam_preauth_status_cmd_fixed_param,
+	    WMITLV_GET_STRUCT_TLVLEN(wmi_roam_preauth_status_cmd_fixed_param));
+
+	cmd->vdev_id = params->vdev_id;
+	cmd->preauth_status = params->preauth_status;
+	WMI_CHAR_ARRAY_TO_MAC_ADDR(params->bssid.bytes,
+				   &cmd->candidate_ap_bssid);
+
+	buf_ptr += sizeof(wmi_roam_preauth_status_cmd_fixed_param);
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, PMKID_LEN);
+	buf_ptr += WMI_TLV_HDR_SIZE;
+
+	qdf_mem_copy(buf_ptr, params->pmkid, PMKID_LEN);
+	WMI_LOGD("%s: vdev_id:%d status:%d bssid:%pM", __func__, cmd->vdev_id,
+		 cmd->preauth_status, params->bssid.bytes);
+
+	wmi_mtrace(WMI_ROAM_PREAUTH_STATUS_CMDID, cmd->vdev_id, 0);
+	if (wmi_unified_cmd_send(wmi_handle, buf, len,
+				 WMI_ROAM_PREAUTH_STATUS_CMDID)) {
+		wmi_buf_free(buf);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
 #else
 static inline QDF_STATUS
 send_disconnect_roam_params_tlv(wmi_unified_t wmi_handle,
@@ -2390,6 +2443,13 @@ send_idle_roam_params_tlv(wmi_unified_t wmi_handle,
 {
 	return QDF_STATUS_E_FAILURE;
 }
+
+static inline QDF_STATUS
+send_roam_preauth_status_tlv(wmi_unified_t wmi_handle,
+			     struct wmi_roam_auth_status_params *params)
+{
+	return QDF_STATUS_E_FAILURE;
+}
 #endif
 
 /**
@@ -2563,6 +2623,7 @@ void wmi_roam_attach_tlv(wmi_unified_t wmi_handle)
 	ops->send_roam_bss_load_config = send_roam_bss_load_config_tlv;
 	ops->send_idle_roam_params = send_idle_roam_params_tlv;
 	ops->send_disconnect_roam_params = send_disconnect_roam_params_tlv;
+	ops->send_roam_preauth_status = send_roam_preauth_status_tlv;
 
 	wmi_lfr_subnet_detection_attach_tlv(wmi_handle);
 	wmi_rssi_monitor_attach_tlv(wmi_handle);

+ 6 - 0
wmi/src/wmi_unified_tlv.c

@@ -12349,6 +12349,8 @@ static void populate_tlv_events_id(uint32_t *event_ids)
 				WMI_PEER_RATECODE_LIST_EVENTID;
 	event_ids[wmi_chan_rf_characterization_info_event_id] =
 				WMI_CHAN_RF_CHARACTERIZATION_INFO_EVENTID;
+	event_ids[wmi_roam_auth_offload_event_id] =
+				WMI_ROAM_PREAUTH_START_EVENTID;
 }
 
 /**
@@ -12618,6 +12620,10 @@ static void populate_tlv_service(uint32_t *wmi_service)
 			WMI_SERVICE_THREE_WAY_COEX_CONFIG_LEGACY;
 	wmi_service[wmi_service_rx_fse_support] =
 			WMI_SERVICE_RX_FSE_SUPPORT;
+	wmi_service[wmi_service_sae_roam_support] =
+			WMI_SERVICE_WPA3_SAE_ROAM_SUPPORT;
+	wmi_service[wmi_service_owe_roam_support] =
+			WMI_SERVICE_WPA3_OWE_ROAM_SUPPORT;
 }
 
 /**