Переглянути джерело

qcacld-3.0: Fix opportunistic timer start issue in 2x2 DBS mode

In 2x2 DBS mode once STA/SAP change channel from 2.4Ghz to 5Ghz,
policy_mgr_get_current_pref_hw_mode_ptr never return
PM_SINGLE_MAC_UPGRADE to start the opportunistic timer to switch to
single mac mode.

Fix is to check and start opportunistic timer once connection info are
updated. Also start opportunistic timer before
check for SAP to change channel as when SAP change channel it should
stop opportunistic timer and set required HW mode.
If single mac mode is required after channel switch it will start
opportunistic timer again in channel switch callback.

Change-Id: Id6bbc7ea51ba8147e517e7e7bf2b14931c95ea44
CRs-Fixed: 2419645
Abhishek Singh 6 роки тому
батько
коміт
0c652034e1
1 змінених файлів з 47 додано та 3 видалено
  1. 47 3
      cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

+ 47 - 3
cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -363,6 +363,9 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc,
 			chain_mask,
 			nss, vdev_id, true, true);
 
+	/* do we need to change the HW mode */
+	policy_mgr_check_n_start_opportunistic_timer(psoc);
+
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -1922,6 +1925,25 @@ QDF_STATUS policy_mgr_set_hw_mode_before_channel_switch(
 		return QDF_STATUS_E_NOSUPPORT;
 	}
 
+	/*
+	 * Stop opportunistic timer as current connection info will change once
+	 * channel is switched and thus if required it will be started once
+	 * channel switch is completed. With new connection info.
+	 */
+	policy_mgr_stop_opportunistic_timer(psoc);
+
+	/*
+	 * Return if driver is already in the dbs mode, movement to
+	 * Single mac/SBS mode will be decided and changed once channel
+	 * switch is completed. This will avoid changing to SBS/Single mac
+	 * till new channel is configured, while the old channel still
+	 * requires DBS.
+	 */
+	if (policy_mgr_is_current_hwmode_dbs(psoc)) {
+		policy_mgr_err("Already in DBS mode");
+		return QDF_STATUS_E_ALREADY;
+	}
+
 	/*
 	 * Store the connection's parameter and temporarily delete it
 	 * from the concurrency table. This way the allow concurrency
@@ -1934,13 +1956,19 @@ QDF_STATUS policy_mgr_set_hw_mode_before_channel_switch(
 	status = policy_mgr_update_and_wait_for_connection_update(psoc,
 				vdev_id, chan,
 				POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH);
-	if (QDF_IS_STATUS_ERROR(status))
-		policy_mgr_err("Failed to update HW modeStatus %d", status);
-
 	/* Restore the connection entry */
 	if (num_cxn_del)
 		policy_mgr_restore_deleted_conn_info(psoc, &info, num_cxn_del);
 
+	/*
+	 * If hw mode change failed restart the opportunistic timer to
+	 * Switch to single mac if required.
+	 */
+	if (QDF_IS_STATUS_ERROR(status)) {
+		policy_mgr_err("Failed to update HW modeStatus %d", status);
+		policy_mgr_check_n_start_opportunistic_timer(psoc);
+	}
+
 	return status;
 }
 
@@ -1957,6 +1985,13 @@ QDF_STATUS policy_mgr_check_and_set_hw_mode_sta_channel_switch(
 		return QDF_STATUS_E_NOSUPPORT;
 	}
 
+	/*
+	 * Stop opportunistic timer as current connection info will change once
+	 * channel is switched and thus if required it will be started once
+	 * channel switch is completed. With new connection info.
+	 */
+	policy_mgr_stop_opportunistic_timer(psoc);
+
 	if (policy_mgr_is_current_hwmode_dbs(psoc)) {
 		policy_mgr_err("Already in DBS mode");
 		return QDF_STATUS_E_ALREADY;
@@ -1982,6 +2017,15 @@ QDF_STATUS policy_mgr_check_and_set_hw_mode_sta_channel_switch(
 	if (num_cxn_del)
 		policy_mgr_restore_deleted_conn_info(psoc, &info, num_cxn_del);
 
+	/*
+	 * If hw mode change failed restart the opportunistic timer to
+	 * Switch to single mac if required.
+	 */
+	if (status == QDF_STATUS_E_FAILURE) {
+		policy_mgr_err("Failed to update HW modeStatus %d", status);
+		policy_mgr_check_n_start_opportunistic_timer(psoc);
+	}
+
 	return status;
 }