浏览代码

qcacld-3.0: Allow MCC if STA ch is non-preferred and sap ACS 1-11

If STA is present on non-preferred channel i.e. 12, 13, 14 and SAP
ACS channel list is 1-11 then MCC is preferable as SAP don't want
to come up on non-preferable channel.

Change-Id: I82bd707c26258e0bf0b7cc14657185d11f56f757
CRs-Fixed: 2922824
Abhishek Ambure 4 年之前
父节点
当前提交
5920ab273f
共有 1 个文件被更改,包括 24 次插入1 次删除
  1. 24 1
      core/sap/src/sap_fsm.c

+ 24 - 1
core/sap/src/sap_fsm.c

@@ -776,6 +776,26 @@ uint32_t sap_select_default_oper_chan(struct mac_context *mac_ctx,
 	return default_freq;
 }
 
+static bool is_mcc_preferred(struct sap_context *sap_context,
+			     uint32_t con_ch_freq)
+{
+	/*
+	 * If SAP ACS channel list is 1-11 and STA is on non-preferred
+	 * channel i.e. 12, 13, 14 then MCC is unavoidable. This is because
+	 * if SAP is started on 12,13,14 some clients may not be able to
+	 * join dependending on their regulatory country.
+	 */
+	if ((con_ch_freq >= 2467) && (con_ch_freq <= 2484) &&
+	    (sap_context->acs_cfg->start_ch_freq >= 2412 &&
+	     sap_context->acs_cfg->end_ch_freq <= 2462)) {
+		sap_debug("conc ch freq %d & sap acs ch list is 1-11, prefer mcc",
+			  con_ch_freq);
+		return true;
+	}
+
+	return false;
+}
+
 QDF_STATUS
 sap_validate_chan(struct sap_context *sap_context,
 		  bool pre_start_bss,
@@ -865,9 +885,12 @@ sap_validate_chan(struct sap_context *sap_context,
 					mac_ctx->pdev, &ch_params,
 					con_ch_freq) ||
 			    sta_sap_scc_on_dfs_chan)) {
+				if (is_mcc_preferred(sap_context, con_ch_freq))
+					goto validation_done;
+
 				sap_debug("Override ch freq %d to %d due to CC Intf",
 					  sap_context->chan_freq,
-					con_ch_freq);
+					  con_ch_freq);
 				sap_context->chan_freq = con_ch_freq;
 				sap_context->ch_params.ch_width =
 				    wlan_sap_get_concurrent_bw(mac_ctx->pdev,