Browse Source

qcacld-3.0: add support for WPS in connection manager

add support for WPS in connection manager.

Change-Id: I07433d4b885d752aab94757062e0cfda35323ff4
CRs-Fixed: 2858788
gaurank kathpalia 4 years ago
parent
commit
bc30a451a3

+ 6 - 0
components/mlme/core/inc/wlan_mlme_main.h

@@ -260,6 +260,8 @@ struct ft_context {
  * derived from JOIN_REQ and REASSOC_REQ. If a particular AC bit is set, it
  * means the AC is both trigger enabled and delivery enabled.
  * @qos_enabled: is qos enabled
+ * @is_wps is wps connection
+ * @ft_info: ft related info
  */
 struct mlme_connect_info {
 	uint8_t timing_meas_cap;
@@ -270,6 +272,7 @@ struct mlme_connect_info {
 #endif
 	uint8_t uapsd_per_ac_bitmask;
 	bool qos_enabled;
+	bool is_wps;
 	struct ft_context ft_info;
 };
 
@@ -644,6 +647,9 @@ void mlme_get_discon_reason_n_from_ap(struct wlan_objmgr_psoc *psoc,
 				      uint8_t vdev_id, bool *from_ap,
 				      uint32_t *reason_code);
 
+bool wlan_is_wps_connection(struct wlan_objmgr_pdev *pdev,
+			    uint8_t vdev_id);
+
 /**
  * wlan_get_opmode_from_vdev_id() - Get opmode from vdevid
  * @psoc: PSOC pointer

+ 27 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -2824,6 +2824,33 @@ void mlme_get_discon_reason_n_from_ap(struct wlan_objmgr_psoc *psoc,
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
 }
 
+bool wlan_is_wps_connection(struct wlan_objmgr_pdev *pdev,
+			    uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct mlme_legacy_priv *mlme_priv;
+	bool wps;
+
+	if (!pdev)
+		return false;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(pdev, vdev_id,
+						    WLAN_LEGACY_MAC_ID);
+	if (!vdev)
+		return false;
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
+		return false;
+	}
+
+	wps = mlme_priv->connect_info.is_wps;
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
+
+	return wps;
+}
+
 enum QDF_OPMODE wlan_get_opmode_from_vdev_id(struct wlan_objmgr_pdev *pdev,
 					     uint8_t vdev_id)
 {

+ 2 - 3
core/hdd/src/wlan_hdd_apf.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -226,8 +226,7 @@ static int hdd_set_reset_apf_offload(struct hdd_context *hdd_ctx,
 	int prog_len;
 	int ret = 0;
 
-	if (!hdd_conn_is_connected(
-	    WLAN_HDD_GET_STATION_CTX_PTR(adapter))) {
+	if (!hdd_cm_is_vdev_associated(adapter)) {
 		hdd_err("Not in Connected state!");
 		return -ENOTSUPP;
 	}

+ 9 - 8
core/hdd/src/wlan_hdd_cm_connect.c

@@ -724,7 +724,7 @@ static void hdd_cm_save_connect_info(struct hdd_adapter *adapter,
 	status = dot11f_unpack_beacon_i_es(MAC_CONTEXT(mac_handle), ie_field,
 					   ie_len, bcn_ie, false);
 
-	if (!DOT11F_SUCCEEDED(status)) {
+	if (DOT11F_FAILED(status)) {
 		hdd_err("Failed to parse beacon ie");
 		qdf_mem_free(bcn_ie);
 		return;
@@ -907,13 +907,14 @@ hdd_cm_connect_success_post_user_update(struct wlan_objmgr_vdev *vdev,
 			       sta_ctx->conn_info.chan_freq);
 	hdd_wmm_assoc(adapter, false, uapsd_mask);
 
-	if (sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_NONE ||
-	    sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_OPEN_SYSTEM ||
-	    sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_SHARED_KEY ||
-	    sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_FILS_SHA256 ||
-	    sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_FILS_SHA384 ||
-	    sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_FT_FILS_SHA256 ||
-	    sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_FT_FILS_SHA384)
+	if (!wlan_is_wps_connection(hdd_ctx->pdev, adapter->vdev_id) &&
+	    (sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_NONE ||
+	     sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_OPEN_SYSTEM ||
+	      sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_SHARED_KEY ||
+	     sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_FILS_SHA256 ||
+	     sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_FILS_SHA384 ||
+	     sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_FT_FILS_SHA256 ||
+	     sta_ctx->conn_info.auth_type == eCSR_AUTH_TYPE_FT_FILS_SHA384))
 		is_auth_required = false;
 
 	hdd_roam_register_sta(adapter, &rsp->bssid, is_auth_required);

+ 1 - 1
core/hdd/src/wlan_hdd_cm_disconnect.c

@@ -268,7 +268,7 @@ int wlan_hdd_cm_disconnect(struct wiphy *wiphy,
 		qdf_dp_trace_dump_all(
 				WLAN_DEAUTH_DPTRACE_DUMP_COUNT,
 				QDF_TRACE_DEFAULT_PDEV_ID);
-	status = wlan_hdd_cm_issue_disconnect(adapter, reason, false);
+	status = wlan_hdd_cm_issue_disconnect(adapter, reason, true);
 
 	return qdf_status_to_os_return(status);
 }

+ 1 - 5
core/mac/inc/ani_system_defs.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2019, 2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -71,10 +71,8 @@ enum ani_akm_type {
 	ANI_AKM_TYPE_FT_RSN_PSK,
 	ANI_AKM_TYPE_RSN_PSK_SHA256,
 	ANI_AKM_TYPE_RSN_8021X_SHA256,
-#ifdef WLAN_FEATURE_SAE
 	ANI_AKM_TYPE_SAE,
 	ANI_AKM_TYPE_FT_SAE,
-#endif
 	ANI_AKM_TYPE_SUITEB_EAP_SHA256,
 	ANI_AKM_TYPE_SUITEB_EAP_SHA384,
 	ANI_AKM_TYPE_FT_SUITEB_EAP_SHA384,
@@ -83,9 +81,7 @@ enum ani_akm_type {
 	ANI_AKM_TYPE_FT_FILS_SHA256,
 	ANI_AKM_TYPE_FT_FILS_SHA384,
 	ANI_AKM_TYPE_OWE,
-#ifdef FEATURE_WLAN_ESE
 	ANI_AKM_TYPE_CCKM,
-#endif
 	ANI_AKM_TYPE_OSEN,
 	ANI_AKM_TYPE_DPP_RSN,
 	ANI_AKM_TYPE_WPA,

+ 80 - 34
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2793,14 +2793,8 @@ lim_is_rsn_profile(struct pe_session *session)
 	return false;
 }
 
-static tAniEdType
-lim_get_encrypt_ed_type(struct pe_session *session)
+static tAniEdType lim_get_encrypt_ed_type(int32_t ucast_cipher)
 {
-	int32_t ucast_cipher;
-
-	ucast_cipher = wlan_crypto_get_param(session->vdev,
-					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
-
 	if (ucast_cipher == -1)
 		return eSIR_ED_NONE;
 
@@ -2893,19 +2887,10 @@ lim_get_rsn_akm(uint32_t akm)
 }
 
 static enum ani_akm_type
-lim_get_connected_akm(struct pe_session *session,
-		      struct scan_cache_entry *entry)
+lim_get_connected_akm(struct pe_session *session, int32_t ucast_cipher,
+		      int32_t auth_mode, int32_t akm)
 {
-	int32_t ucast_cipher;
-	int32_t auth_mode;
-
-	ucast_cipher = wlan_crypto_get_param(session->vdev,
-					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
-
-	auth_mode = wlan_crypto_get_param(session->vdev,
-					  WLAN_CRYPTO_PARAM_AUTH_MODE);
-
-	if (auth_mode == -1 || ucast_cipher == -1)
+	if (auth_mode == -1 || ucast_cipher == -1 || akm == -1)
 		return ANI_AKM_TYPE_NONE;
 
 	if (QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_NONE) ||
@@ -2913,10 +2898,10 @@ lim_get_connected_akm(struct pe_session *session,
 		return ANI_AKM_TYPE_NONE;
 
 	if (lim_is_rsn_profile(session))
-		return lim_get_rsn_akm(entry->neg_sec_info.key_mgmt);
+		return lim_get_rsn_akm(akm);
 
 	if (lim_is_wpa_profile(session))
-		return lim_get_wpa_akm(entry->neg_sec_info.key_mgmt);
+		return lim_get_wpa_akm(akm);
 
 	if (lim_is_wapi_profile(session))
 		return ANI_AKM_TYPE_UNKNOWN;
@@ -3040,6 +3025,66 @@ lim_fill_rsn_ie(struct mac_context *mac_ctx, struct pe_session *session,
 	return QDF_STATUS_SUCCESS;
 }
 
+static void lim_fill_crypto_params(struct mac_context *mac_ctx,
+				   struct pe_session *session,
+				   struct cm_vdev_join_req *req)
+{
+	int32_t ucast_cipher;
+	int32_t auth_mode;
+	int32_t akm;
+	uint8_t wsc_oui[OUI_LENGTH];
+	uint32_t oui_cpu;
+	struct mlme_legacy_priv *mlme_priv;
+
+	ucast_cipher = wlan_crypto_get_param(session->vdev,
+					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+	auth_mode = wlan_crypto_get_param(session->vdev,
+					  WLAN_CRYPTO_PARAM_AUTH_MODE);
+	akm = wlan_crypto_get_param(session->vdev,
+				    WLAN_CRYPTO_PARAM_KEY_MGMT);
+
+	/* set default to open */
+	mac_ctx->mlme_cfg->wep_params.auth_type = eSIR_OPEN_SYSTEM;
+
+	if (QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_AUTO) &&
+	    (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP) ||
+	     QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_40) ||
+	     QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_104)))
+		mac_ctx->mlme_cfg->wep_params.auth_type = eSIR_AUTO_SWITCH;
+	else if (QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_SHARED))
+		mac_ctx->mlme_cfg->wep_params.auth_type = eSIR_SHARED_KEY;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_SAE) ||
+	    QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_SAE))
+		mac_ctx->mlme_cfg->wep_params.auth_type = eSIR_AUTH_TYPE_SAE;
+
+	session->encryptType = lim_get_encrypt_ed_type(ucast_cipher);
+	session->connected_akm = lim_get_connected_akm(session, ucast_cipher,
+						       auth_mode, akm);
+
+	/* check for WPS */
+	oui_cpu = qdf_be32_to_cpu(WSC_OUI);
+	qdf_mem_copy(wsc_oui, &oui_cpu, OUI_LENGTH);
+	if (wlan_get_vendor_ie_ptr_from_oui(wsc_oui, OUI_LENGTH,
+					    req->assoc_ie.ptr,
+					    req->assoc_ie.len))
+		session->wps_registration = true;
+
+	/* check for OSEN */
+	oui_cpu = qdf_be32_to_cpu(OSEN_OUI);
+	qdf_mem_copy(wsc_oui, &oui_cpu, OUI_LENGTH);
+	if (wlan_get_vendor_ie_ptr_from_oui(wsc_oui, OUI_LENGTH,
+					    req->assoc_ie.ptr,
+					    req->assoc_ie.len))
+		session->isOSENConnection = true;
+
+	lim_fill_rsn_ie(mac_ctx, session, req);
+	lim_update_fils_config(mac_ctx, session, req);
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(session->vdev);
+	if (!mlme_priv)
+		return;
+	mlme_priv->connect_info.is_wps = session->wps_registration;
+}
+
 static QDF_STATUS
 lim_fill_session_params(struct mac_context *mac_ctx,
 			struct pe_session *session,
@@ -3112,25 +3157,22 @@ lim_fill_session_params(struct mac_context *mac_ctx,
 
 	session->rateSet.numRates = op_rate_len;
 	session->extRateSet.numRates = ext_rate_len;
-
-	session->encryptType = lim_get_encrypt_ed_type(session);
-	session->connected_akm = lim_get_connected_akm(session, req->entry);
 	pe_debug("Assoc IE len: %d", req->assoc_ie.len);
 	if (req->assoc_ie.len)
 		QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
 				   req->assoc_ie.ptr, req->assoc_ie.len);
+	lim_fill_crypto_params(mac_ctx, session, req);
 
-	lim_fill_rsn_ie(mac_ctx, session, req);
-	lim_update_fils_config(mac_ctx, session, req);
-	qdf_mem_copy(pe_join_req->addIEAssoc.addIEdata,
-		     req->assoc_ie.ptr, req->assoc_ie.len);
 	pe_debug("After stripping Assoc IE len: %d", req->assoc_ie.len);
 	if (req->assoc_ie.len)
 		QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
 				   req->assoc_ie.ptr, req->assoc_ie.len);
-
+	qdf_mem_copy(pe_join_req->addIEAssoc.addIEdata,
+		     req->assoc_ie.ptr, req->assoc_ie.len);
+	pe_join_req->addIEAssoc.length = req->assoc_ie.len;
 	qdf_mem_copy(pe_join_req->addIEScan.addIEdata,
 		     req->scan_ie.ptr, req->scan_ie.len);
+	pe_join_req->addIEScan.length = req->scan_ie.len;
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -3160,7 +3202,7 @@ lim_cm_handle_join_req(struct cm_vdev_join_req *req)
 	if (QDF_IS_STATUS_ERROR(status))
 		goto fail;
 
-	pe_debug("Freq %d width %d freq0 %d freq1 %d, Smps %d: mode %d action %d, nss 1x1 %d vdev_nss %d nss %d cbMode %d dot11mode %d subfer %d subfee %d csn %d is_cisco %d",
+	pe_debug("Freq %d width %d freq0 %d freq1 %d, Smps %d: mode %d action %d, nss 1x1 %d vdev_nss %d nss %d cbMode %d dot11mode %d subfer %d subfee %d csn %d is_cisco %d WPS %d OSEN %d",
 		 pe_session->curr_op_freq, pe_session->ch_width,
 		 pe_session->ch_center_freq_seg0,
 		 pe_session->ch_center_freq_seg1,
@@ -3172,7 +3214,9 @@ lim_cm_handle_join_req(struct cm_vdev_join_req *req)
 		 pe_session->vht_config.su_beam_former,
 		 pe_session->vht_config.su_beam_formee,
 		 pe_session->vht_config.csnof_beamformer_antSup,
-		 pe_session->isCiscoVendorAP);
+		 pe_session->isCiscoVendorAP,
+		 pe_session->wps_registration,
+		 pe_session->isOSENConnection);
 
 	status = lim_send_connect_req_to_mlm(pe_session);
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -3235,9 +3279,10 @@ static void lim_prepare_and_send_disassoc(struct mac_context *mac_ctx,
 	struct pe_session *pe_session;
 	struct scheduler_msg msg = {0};
 	struct disassoc_req disassoc_req = {0};
+	uint8_t pe_session_id;
 
 	pe_session = pe_find_session_by_bssid(mac_ctx, req->req.bssid.bytes,
-					      &req->req.vdev_id);
+					      &pe_session_id);
 	if (!pe_session)
 		return;
 
@@ -3326,6 +3371,7 @@ lim_cm_handle_disconnect_req(struct wlan_cm_vdev_discon_req *req)
 {
 	struct mac_context *mac_ctx;
 	struct pe_session *pe_session;
+	uint8_t pe_session_id;
 
 	if (!req)
 		return QDF_STATUS_E_INVAL;
@@ -3335,10 +3381,10 @@ lim_cm_handle_disconnect_req(struct wlan_cm_vdev_discon_req *req)
 		return QDF_STATUS_E_INVAL;
 
 	pe_session = pe_find_session_by_bssid(mac_ctx, req->req.bssid.bytes,
-					      &req->req.vdev_id);
+					      &pe_session_id);
 	if (!pe_session) {
 		pe_err("vdev_id %d cm_id 0x%x: Session not found for bssid"
-		       QDF_MAC_ADDR_FMT, req->cm_id, req->req.vdev_id,
+		       QDF_MAC_ADDR_FMT, req->req.vdev_id, req->cm_id,
 		       QDF_MAC_ADDR_REF(req->req.bssid.bytes));
 		lim_cm_send_disconnect_rsp(mac_ctx, req->req.vdev_id);
 		return QDF_STATUS_E_INVAL;

+ 1 - 0
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -299,6 +299,7 @@ lim_cm_prepare_join_rsp_from_pe_session(struct mac_context *mac_ctx,
 	}
 
 	if (QDF_IS_STATUS_SUCCESS(connect_status)) {
+		connect_rsp->status_code = STATUS_SUCCESS;
 		populate_fils_connect_params(mac_ctx, pe_session, connect_rsp);
 		connect_rsp->aid = pe_session->limAID;
 

+ 34 - 24
core/sme/src/csr/csr_api_roam.c

@@ -14003,24 +14003,30 @@ static void csr_fill_connected_profile(struct mac_context *mac_ctx,
 	tDot11fBeaconIEs *bcn_ies;
 	sme_QosAssocInfo assoc_info;
 	struct cm_roam_values_copy src_cfg;
+	int32_t ucast_cipher, mcast_cipher;
+	int32_t auth_mode;
+	int32_t akm;
+
+	conn_profile = &session->connectedProfile;
+	conn_profile->modifyProfileFields.uapsd_mask = rsp->uapsd_mask;
+	conn_profile->BSSType = eCSR_BSS_TYPE_INFRASTRUCTURE;
+	conn_profile->op_freq = rsp->connect_rsp.freq;
+	qdf_copy_macaddr(&conn_profile->bssid, &rsp->connect_rsp.bssid);
 
 	filter = qdf_mem_malloc(sizeof(*filter));
 	if (!filter)
 		return;
 
-	wlan_cm_fill_crypto_filter_from_vdev(vdev, filter);
-	filter->num_of_ssid = 1;
-	filter->ssid_list[0].length = rsp->connect_rsp.ssid.length;
-	qdf_mem_copy(filter->ssid_list[0].ssid, rsp->connect_rsp.ssid.ssid,
-		     rsp->connect_rsp.ssid.length);
 	filter->num_of_bssid = 1;
 	qdf_copy_macaddr(&filter->bssid_list[0], &rsp->connect_rsp.bssid);
+	filter->ignore_auth_enc_type = true;
 
-	list = ucfg_scan_get_result(mac_ctx->pdev, filter);
+	list = wlan_scan_get_result(mac_ctx->pdev, filter);
 	qdf_mem_free(filter);
 	if (!list || (list && !qdf_list_size(list)))
 		goto purge_list;
 
+
 	qdf_list_peek_front(list, &cur_lst);
 	if (!cur_lst)
 		goto purge_list;
@@ -14048,24 +14054,23 @@ static void csr_fill_connected_profile(struct mac_context *mac_ctx,
 	}
 	/* update bss desc */
 	session->pConnectBssDesc = bss_desc;
-	conn_profile = &session->connectedProfile;
-	csr_fill_enc_type(&conn_profile->EncryptionType,
-			  cur_node->entry->neg_sec_info.ucastcipherset);
-	csr_fill_enc_type(&conn_profile->mcEncryptionType,
-			  cur_node->entry->neg_sec_info.mcastcipherset);
-	csr_fill_auth_type(&conn_profile->AuthType,
-			   cur_node->entry->neg_sec_info.authmodeset,
-			   cur_node->entry->neg_sec_info.key_mgmt,
-			   cur_node->entry->neg_sec_info.ucastcipherset);
+	ucast_cipher = wlan_crypto_get_param(vdev,
+					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+	auth_mode = wlan_crypto_get_param(vdev,
+					  WLAN_CRYPTO_PARAM_AUTH_MODE);
+	akm = wlan_crypto_get_param(vdev,
+				    WLAN_CRYPTO_PARAM_KEY_MGMT);
+	mcast_cipher = wlan_crypto_get_param(vdev,
+					     WLAN_CRYPTO_PARAM_MCAST_CIPHER);
+	csr_fill_enc_type(&conn_profile->EncryptionType, ucast_cipher);
+	csr_fill_enc_type(&conn_profile->mcEncryptionType, mcast_cipher);
+	csr_fill_auth_type(&conn_profile->AuthType, auth_mode,
+			   akm, ucast_cipher);
 
-	conn_profile->modifyProfileFields.uapsd_mask = rsp->uapsd_mask;
-	conn_profile->BSSType = eCSR_BSS_TYPE_INFRASTRUCTURE;
-	conn_profile->op_freq = rsp->connect_rsp.freq;
 	conn_profile->beaconInterval = bss_desc->beaconInterval;
 	if (!conn_profile->beaconInterval)
 		sme_err("ERROR: Beacon interval is ZERO");
 
-	qdf_copy_macaddr(&conn_profile->bssid, &rsp->connect_rsp.bssid);
 	if (bss_desc->mdiePresent) {
 		src_cfg.bool_value = true;
 		src_cfg.uint_value =
@@ -14096,7 +14101,7 @@ static void csr_fill_connected_profile(struct mac_context *mac_ctx,
 
 purge_list:
 	if (list)
-		ucfg_scan_purge_results(list);
+		wlan_scan_purge_results(list);
 
 }
 
@@ -14166,6 +14171,8 @@ cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
 	struct set_context_rsp install_key_rsp;
 	struct csr_roam_session *session;
 	int32_t rsn_cap;
+	struct mlme_legacy_priv *mlme_priv;
+	bool is_wps = false;
 
 	/*
 	 * This API is to update legacy struct and should be removed once
@@ -14193,14 +14200,17 @@ cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
 
 		return QDF_STATUS_SUCCESS;
 	}
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (mlme_priv)
+		is_wps = mlme_priv->connect_info.is_wps;
 	/*
 	 * For open mode authentication, send dummy install key response to
 	 * send OBSS scan and QOS event.
 	 */
 	ucast_cipher = wlan_crypto_get_param(vdev,
 					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
-	if (!ucast_cipher ||
-	    (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_NONE)) == ucast_cipher) {
+	if (!is_wps && (!ucast_cipher ||
+	    (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_NONE)) == ucast_cipher)) {
 		install_key_rsp.length = sizeof(install_key_rsp);
 		install_key_rsp.status_code = eSIR_SME_SUCCESS;
 		install_key_rsp.sessionId = vdev_id;
@@ -14224,12 +14234,12 @@ cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
 	}
 	csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINED, vdev_id);
 
-	if (csr_cm_is_fils_connection(rsp) || !ucast_cipher ||
+	if (!is_wps && (csr_cm_is_fils_connection(rsp) || !ucast_cipher ||
 	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_NONE) ==
 			  ucast_cipher ||
 	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_40) ||
 	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_104) ||
-	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP)) {
+	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP))) {
 		csr_roam_substate_change(mac_ctx, eCSR_ROAM_SUBSTATE_NONE,
 					 vdev_id);
 	} else {