Browse Source

qcacld-3.0: Defer the channel switch if it is already in progress

When sta+sap scc enabled on dfs channel then SAP cannot operate on
DFS channel in standalone mode. If STA+SAP are operating in SCC mode
on a DFS channel and STA gets disconnected from reference AP then driver
schedules a workqueue to move the SAP from DFS channel to user configured
channel. At this time if STA again connects to reference AP within few ms
then driver again schedules one more workqueue to move the SAP to STA's
channel. Sometimes the second workqueue may fail to switch the channel
if first one is not yet completed. So added event variable to schedule
second workqueue only when first one is complete.

CRs-Fixed: 2163412
Change-Id: Ia6ce4b6264c35f6d2c809e2a3f65f535e930874e
Bala Venkatesh 6 years ago
parent
commit
7e9c688006
1 changed files with 12 additions and 0 deletions
  1. 12 0
      core/hdd/src/wlan_hdd_hostapd.c

+ 12 - 0
core/hdd/src/wlan_hdd_hostapd.c

@@ -1682,6 +1682,13 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent,
 			pSapEvent->sapevt.sapStartBssCompleteEvent.status;
 
 		qdf_atomic_set(&adapter->dfs_radar_found, 0);
+
+		status = policy_mgr_set_chan_switch_complete_evt(
+						hdd_ctx->hdd_psoc);
+		if (!QDF_IS_STATUS_SUCCESS(status)) {
+			hdd_err("set event failed");
+			goto stopbss;
+		}
 		wlansap_get_dfs_ignore_cac(mac_handle, &ignoreCAC);
 
 		/* DFS requirement: DO NOT transmit during CAC. */
@@ -2731,6 +2738,11 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel,
 		return -EBUSY;
 	}
 
+	status = policy_mgr_reset_chan_switch_complete_evt(hdd_ctx->hdd_psoc);
+	if (!QDF_IS_STATUS_SUCCESS(status)) {
+		hdd_err("clear event failed");
+		return -EINVAL;
+	}
 	/*
 	 * Post the Channel Change request to SAP.
 	 */