Parcourir la source

qcacld-3.0: Process SET_FCC_CHANNEL only after scan is finished

Currently SET_FCC_CHANNEL issues "update channel list" to firmware.
If scan is in progress, firmware aborts the scan resuting delay in
results update on the GUI. To avoid this, issue "update channel list"
only after scan is finished.

CRs-Fixed: 972208
Change-Id: I4c34010109443434bbe3abf45df7a0cf2effbee2
Amar Singhal il y a 9 ans
Parent
commit
83a047accb

+ 4 - 1
core/hdd/src/wlan_hdd_ioctl.c

@@ -6753,6 +6753,7 @@ static int drv_cmd_set_fcc_channel(hdd_adapter_t *adapter,
 	uint8_t *value;
 	uint8_t fcc_constraint;
 	QDF_STATUS status;
+	bool scan_pending;
 	int ret = 0;
 
 	/*
@@ -6777,7 +6778,9 @@ static int drv_cmd_set_fcc_channel(hdd_adapter_t *adapter,
 		return -EINVAL;
 	}
 
-	status = sme_handle_set_fcc_channel(hdd_ctx->hHal, !fcc_constraint);
+	scan_pending = !qdf_list_empty(&hdd_ctx->hdd_scan_req_q);
+	status = sme_handle_set_fcc_channel(hdd_ctx->hHal, !fcc_constraint,
+					    scan_pending);
 	if (status != QDF_STATUS_SUCCESS) {
 		hdd_err("sme disable fn. returned err");
 		ret = -EPERM;

+ 1 - 0
core/sme/inc/csr_internal.h

@@ -778,6 +778,7 @@ typedef struct tagCsrScanStruct {
 	csr_scan_completeCallback callback11dScanDone;
 	bool fcc_constraint;
 	uint8_t max_scan_count;
+	bool defer_update_channel_list;
 } tCsrScanStruct;
 
 /*

+ 2 - 1
core/sme/inc/sme_api.h

@@ -1011,7 +1011,8 @@ void sme_set_scan_disable(tHalHandle h_hal, int value);
 void sme_setdef_dot11mode(tHalHandle hal);
 
 QDF_STATUS sme_handle_set_fcc_channel(tHalHandle hHal,
-				      bool fcc_constraint);
+				      bool fcc_constraint,
+				      bool scan_pending);
 
 QDF_STATUS sme_update_roam_scan_hi_rssi_scan_params(tHalHandle hal_handle,
 	uint8_t session_id,

+ 8 - 3
core/sme/src/common/sme_api.c

@@ -15174,11 +15174,13 @@ QDF_STATUS sme_set_peer_authorized(uint8_t *peer_addr,
 /*
  * sme_handle_set_fcc_channel() - set spec. tx power for non-fcc channel
  * @hal: HAL pointer
- * @fcc_constraint: true: disable, false; enable
+ * @fcc_constraint: flag to enable/disable the constraint
+ * @scan_pending: whether there is pending scan
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS sme_handle_set_fcc_channel(tHalHandle hal, bool fcc_constraint)
+QDF_STATUS sme_handle_set_fcc_channel(tHalHandle hal, bool fcc_constraint,
+				      bool scan_pending)
 {
 	QDF_STATUS status;
 	tpAniSirGlobal mac_ptr  = PMAC_STRUCT(hal);
@@ -15189,7 +15191,10 @@ QDF_STATUS sme_handle_set_fcc_channel(tHalHandle hal, bool fcc_constraint)
 
 		if (fcc_constraint != mac_ptr->scan.fcc_constraint) {
 			mac_ptr->scan.fcc_constraint = fcc_constraint;
-
+			if (scan_pending)
+				mac_ptr->scan.defer_update_channel_list = true;
+			else
+				status = csr_update_channel_list(mac_ptr);
 			/* update the channel list in firmware */
 			status = csr_update_channel_list(mac_ptr);
 		}

+ 4 - 2
core/sme/src/csr/csr_api_roam.c

@@ -704,14 +704,16 @@ QDF_STATUS csr_update_channel_list(tpAniSirGlobal pMac)
 						MAX_PWR_FCC_CHAN_12;
 					QDF_TRACE(QDF_MODULE_ID_SME,
 						  QDF_TRACE_LEVEL_INFO,
-					       "txpower for channel 12 is 8db");
+						  "txpow for channel 12 is %d",
+						  MAX_PWR_FCC_CHAN_12);
 				}
 				if (13 == pChanList->chanParam[num_channel].chanId) {
 					pChanList->chanParam[num_channel].pwr =
 						MAX_PWR_FCC_CHAN_13;
 					QDF_TRACE(QDF_MODULE_ID_SME,
 						  QDF_TRACE_LEVEL_INFO,
-					       "txpower for channel 13 is 2db");
+						  "txpow for channel 13 is %d",
+						  MAX_PWR_FCC_CHAN_13);
 				}
 			}
 

+ 19 - 5
core/sme/src/csr/csr_api_scan.c

@@ -4178,11 +4178,7 @@ bool csr_scan_complete(tpAniSirGlobal pMac, tSirSmeScanRsp *pScanRsp)
 		pCommand->u.scanCmd.abortScanDueToBandChange = false;
 	}
 	csr_save_scan_results(pMac, pCommand->u.scanCmd.reason, sessionId);
-	/* filter scan result based on valid channel list number */
-	if (pMac->scan.fcc_constraint) {
-		sms_log(pMac, LOG1, FL("Clear BSS from invalid channels"));
-		csr_scan_filter_results(pMac);
-	}
+
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
 	csr_diag_scan_complete(pMac, pCommand, pScanRsp);
 #endif /* #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR */
@@ -4517,6 +4513,7 @@ static bool csr_scan_process_scan_results(tpAniSirGlobal pMac, tSmeCmd *pCommand
 					  bool *pfRemoveCommand)
 {
 	bool fRet = false, fRemoveCommand = false;
+	QDF_STATUS status;
 
 	sms_log(pMac, LOG1, FL("scan reason = %d, response status code = %d"),
 		pCommand->u.scanCmd.reason, pScanRsp->statusCode);
@@ -4525,6 +4522,23 @@ static bool csr_scan_process_scan_results(tpAniSirGlobal pMac, tSmeCmd *pCommand
 	if (pfRemoveCommand) {
 		*pfRemoveCommand = fRemoveCommand;
 	}
+
+	/*
+	 * Currently SET_FCC_CHANNEL issues updated channel list to fw.
+	 * At the time of driver load, if scan is issued followed with
+	 * SET_FCC_CHANNEL, driver will send update channel list to fw.
+	 * Fw will stop ongoing scan because of that GUI will have very less
+	 * scan list.
+	 * Update channel list should be sent to fw once scan is done
+	 */
+	if (pMac->scan.defer_update_channel_list) {
+		status = csr_update_channel_list(pMac);
+		if (!QDF_IS_STATUS_SUCCESS(status))
+			sms_log(pMac, LOGE,
+			    FL("failed to update the supported channel list"));
+		pMac->scan.defer_update_channel_list = false;
+	}
+
 	return fRet;
 }