Przeglądaj źródła

qcacmn: Send mode change event after addkey

On STA connection, mode change event is sent to
userspace after association is completed. This causes
delay in processing of M1 frame at supplicant due to
latency associated with nl80211_get_wiphy_index
function as part of processing mode change vendor event.

Fix is to send mode change event for STA after key
is added.

Change-Id: Id403bfdd26ed3a47449ba3f2967f4b4322ad5da6
CRs-Fixed: 2260483
Yeshwanth Sriram Guntuka 7 lat temu
rodzic
commit
0c45b0848f

+ 11 - 4
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -308,7 +308,7 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc,
 			policy_mgr_get_bw(conn_table_entry.chan_width),
 			conn_table_entry.mac_id,
 			chain_mask,
-			nss, vdev_id, true);
+			nss, vdev_id, true, true);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -1531,7 +1531,7 @@ QDF_STATUS policy_mgr_update_connection_info_utfw(
 	policy_mgr_update_conc_list(psoc, conn_index,
 			policy_mgr_get_mode(type, sub_type),
 			channelid, HW_MODE_20_MHZ,
-			mac_id, chain_mask, 0, vdev_id, true);
+			mac_id, chain_mask, 0, vdev_id, true, true);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -1543,6 +1543,8 @@ QDF_STATUS policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc,
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	uint32_t conn_index = 0;
+	bool update_conn = true;
+	enum policy_mgr_con_mode mode;
 
 	conn_index = policy_mgr_get_connection_count(psoc);
 	if (MAX_NUMBER_OF_CONC_CONNECTIONS <= conn_index) {
@@ -1553,10 +1555,15 @@ QDF_STATUS policy_mgr_incr_connection_count_utfw(struct wlan_objmgr_psoc *psoc,
 	}
 	policy_mgr_debug("--> filling entry at index[%d]", conn_index);
 
+	mode = policy_mgr_get_mode(type, sub_type);
+	if (mode == PM_STA_MODE || mode == PM_P2P_CLIENT_MODE)
+		update_conn = false;
+
 	policy_mgr_update_conc_list(psoc, conn_index,
-				policy_mgr_get_mode(type, sub_type),
+				mode,
 				channelid, HW_MODE_20_MHZ,
-				mac_id, chain_mask, 0, vdev_id, true);
+				mac_id, chain_mask, 0, vdev_id, true,
+				update_conn);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 11 - 2
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -526,6 +526,8 @@ QDF_STATUS policy_mgr_get_old_and_new_hw_index(
  * @chain_mask: Chain mask
  * @vdev_id: vdev id
  * @in_use: Flag to indicate if the index is in use or not
+ * @update_conn: Flag to indicate if mode change event should
+ *  be sent or not
  *
  * Updates the index value of the concurrent connection list
  *
@@ -540,7 +542,8 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 		enum policy_mgr_chain_mode chain_mask,
 		uint32_t original_nss,
 		uint32_t vdev_id,
-		bool in_use)
+		bool in_use,
+		bool update_conn)
 {
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
 	bool mcc_mode;
@@ -568,7 +571,13 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 	pm_conc_connection_list[conn_index].in_use = in_use;
 	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
 
-	if (pm_ctx->mode_change_cb)
+	/*
+	 * For STA and P2P client mode, the mode change event sent as part
+	 * of the callback causes delay in processing M1 frame at supplicant
+	 * resulting in cert test case failure. The mode change event is sent
+	 * as part of add key for STA and P2P client mode.
+	 */
+	if (pm_ctx->mode_change_cb && update_conn)
 		pm_ctx->mode_change_cb();
 
 	policy_mgr_dump_connection_status_info(psoc);

+ 4 - 1
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -1273,6 +1273,7 @@ QDF_STATUS policy_mgr_incr_connection_count(
 	uint8_t chan;
 	uint32_t nss = 0;
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	bool update_conn = true;
 
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {
@@ -1314,6 +1315,8 @@ QDF_STATUS policy_mgr_incr_connection_count(
 		policy_mgr_err("Error in getting nss");
 	}
 
+	if (mode == PM_STA_MODE || mode == PM_P2P_CLIENT_MODE)
+		update_conn = false;
 
 	/* add the entry */
 	policy_mgr_update_conc_list(psoc, conn_index,
@@ -1322,7 +1325,7 @@ QDF_STATUS policy_mgr_incr_connection_count(
 			policy_mgr_get_bw(conn_table_entry.chan_width),
 			conn_table_entry.mac_id,
 			chain_mask,
-			nss, vdev_id, true);
+			nss, vdev_id, true, update_conn);
 	policy_mgr_debug("Add at idx:%d vdev %d mac=%d",
 		conn_index, vdev_id,
 		conn_table_entry.mac_id);

+ 2 - 1
umac/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -349,7 +349,8 @@ void policy_mgr_update_conc_list(struct wlan_objmgr_psoc *psoc,
 		enum policy_mgr_chain_mode chain_mask,
 		uint32_t original_nss,
 		uint32_t vdev_id,
-		bool in_use);
+		bool in_use,
+		bool update_conn);
 void policy_mgr_store_and_del_conn_info(struct wlan_objmgr_psoc *psoc,
 				enum policy_mgr_con_mode mode,
 				bool all_matching_cxn_to_del,