Selaa lähdekoodia

qcacld-3.0: Remove passive/dfs acs channel for LL SAP

Remove passive/dfs acs channel which are configured through
userspace for LL SAP.

Change-Id: If5d3abe920b93af6cb9be02344618e484c3b0778
CRs-Fixed: 3370658
Jyoti Kumari 2 vuotta sitten
vanhempi
sitoutus
a2c2827bad
1 muutettua tiedostoa jossa 53 lisäystä ja 0 poistoa
  1. 53 0
      core/hdd/src/wlan_hdd_cfg80211.c

+ 53 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -3492,6 +3492,51 @@ static bool wlan_hdd_check_is_acs_request_same(struct hdd_adapter *adapter,
 	return true;
 }
 
+/**
+ * hdd_remove_passive_dfs_acs_channel_for_ll_sap(): Remove passive/dfs channel
+ * for LL SAP
+ * @sap_config: Pointer to sap_config
+ * @psoc: Pointer to psoc
+ * @pdev: Pointer to pdev
+ * @curr_mode: Current mode
+ * @vdev_id: Vdev Id
+ *
+ * This function will remove passive/dfs acs channel for low latency SAP
+ * which are configured through userspace.
+ *
+ * Return: void
+ */
+static void hdd_remove_passive_dfs_acs_channel_for_ll_sap(
+					struct sap_config *sap_config,
+					struct wlan_objmgr_psoc *psoc,
+					struct wlan_objmgr_pdev *pdev,
+					enum policy_mgr_con_mode curr_mode,
+					uint8_t vdev_id)
+{
+	uint32_t i, ch_cnt = 0;
+	uint32_t freq = 0;
+
+	if (!policy_mgr_is_ll_sap_present(psoc, curr_mode, vdev_id))
+		return;
+
+	for (i = 0; i < sap_config->acs_cfg.ch_list_count; i++) {
+		freq = sap_config->acs_cfg.freq_list[i];
+
+		/* Remove passive/dfs channel for LL SAP */
+		if (wlan_reg_is_passive_for_freq(pdev, freq) ||
+		    wlan_reg_is_dfs_for_freq(pdev, freq))
+			continue;
+
+		sap_config->acs_cfg.freq_list[ch_cnt++] = freq;
+	}
+
+	if (ch_cnt != sap_config->acs_cfg.ch_list_count) {
+		hdd_debug("New count after modification %d", ch_cnt);
+		sap_config->acs_cfg.ch_list_count = ch_cnt;
+		sap_dump_acs_channel(&sap_config->acs_cfg);
+	}
+}
+
 /**
  * __wlan_hdd_cfg80211_do_acs(): CFG80211 handler function for DO_ACS Vendor CMD
  * @wiphy:  Linux wiphy struct pointer
@@ -3749,6 +3794,14 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy,
 
 	pm_mode =
 	      policy_mgr_convert_device_mode_to_qdf_type(adapter->device_mode);
+
+	/* Remove passive/dfs acs channel for ll sap */
+	hdd_remove_passive_dfs_acs_channel_for_ll_sap(sap_config,
+						      hdd_ctx->psoc,
+						      hdd_ctx->pdev,
+						      pm_mode,
+						      adapter->vdev_id);
+
 	/* consult policy manager to get PCL */
 	qdf_status = policy_mgr_get_pcl(hdd_ctx->psoc, pm_mode,
 					sap_config->acs_cfg.pcl_chan_freq,