Преглед на файлове

qcacld-3.0: Select PSC channel from ACS list

Currently, when the ACS frequency list contains only
6GHz frequency and mandatory channel list doesn't
contain any 6GHz frequencies, then the 6GHz frequencies
are filtered out from PCL.

Therefore, driver falls back to the master ACS frequency
list to choose the SAP operating frequency. Add a check
to not choose non-PSC channels, if the frequency is
6GHz.

Change-Id: I7539a99987df200d50a812409cc5df7c3dfb05a7
CRs-Fixed: 3198675
Surya Prakash Sivaraj преди 2 години
родител
ревизия
78f492d53c
променени са 1 файла, в които са добавени 44 реда и са изтрити 5 реда
  1. 44 5
      core/hdd/src/wlan_hdd_cfg80211.c

+ 44 - 5
core/hdd/src/wlan_hdd_cfg80211.c

@@ -2982,6 +2982,38 @@ void wlan_hdd_trim_acs_channel_list(uint32_t *pcl, uint8_t pcl_count,
 	*org_ch_list_count = ch_list_count;
 }
 
+/* wlan_hdd_dump_freq_list() - Dump the ACS master frequency list
+ *
+ * @freq_list: Frequency list
+ * @num_freq: num of frequencies in list
+ *
+ * Dump the ACS master frequency list.
+ */
+static inline
+void wlan_hdd_dump_freq_list(uint32_t *freq_list, uint8_t num_freq)
+{
+	uint32_t buf_len = 0;
+	uint32_t i = 0, j = 0;
+	uint8_t *master_chlist;
+
+	if (num_freq >= NUM_CHANNELS)
+		return;
+
+	buf_len = NUM_CHANNELS * 4;
+	master_chlist = qdf_mem_malloc(buf_len);
+
+	if (!master_chlist)
+		return;
+
+	for (i = 0; i < num_freq && j < buf_len; i++) {
+		j += qdf_scnprintf(master_chlist + j, buf_len - j,
+				   "%d ", freq_list[i]);
+	}
+
+	hdd_debug("Master channel list: %s", master_chlist);
+	qdf_mem_free(master_chlist);
+}
+
 void wlan_hdd_handle_zero_acs_list(struct hdd_context *hdd_ctx,
 				   uint32_t *acs_freq_list,
 				   uint8_t *acs_ch_list_count,
@@ -3010,12 +3042,19 @@ void wlan_hdd_handle_zero_acs_list(struct hdd_context *hdd_ctx,
 	if (!sta_count && !force_sap_allowed)
 		return;
 
+	wlan_hdd_dump_freq_list(org_freq_list, org_ch_list_count);
+
 	for (i = 0; i < org_ch_list_count; i++) {
-		if (!wlan_reg_is_dfs_for_freq(hdd_ctx->pdev,
-					      org_freq_list[i])) {
-			acs_chan_default = org_freq_list[i];
-			break;
-		}
+		if (wlan_reg_is_dfs_for_freq(hdd_ctx->pdev,
+					     org_freq_list[i]))
+			continue;
+
+		if (wlan_reg_is_6ghz_chan_freq(org_freq_list[i]) &&
+		    !wlan_reg_is_6ghz_psc_chan_freq(org_freq_list[i]))
+			continue;
+
+		acs_chan_default = org_freq_list[i];
+		break;
 	}
 	if (!acs_chan_default)
 		acs_chan_default = org_freq_list[0];