Ver código fonte

qcacmn: Replace channel with frequency for 6G

Replace WLAN_REG_IS_24GHZ_CH with WLAN_REG_IS_24GHZ_CH_FREQ

Change-Id: Ia2ff3a317f0286b0a6ca4d8642007e1a608c3e3d
CRs-Fixed: 2714721
Jianmin Zhu 5 anos atrás
pai
commit
4f9ae24e67

+ 4 - 4
umac/dfs/dispatcher/src/wlan_dfs_utils_api.c

@@ -858,8 +858,8 @@ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev,
 
 	chan_num = dfs->dfs_curchan->dfs_ch_ieee;
 	center_freq = dfs->dfs_curchan->dfs_ch_freq;
-	is_curchan_5g = WLAN_REG_IS_5GHZ_CH(chan_num);
-	is_curchan_24g = WLAN_REG_IS_24GHZ_CH(chan_num);
+	is_curchan_5g = WLAN_REG_IS_5GHZ_CH_FREQ(center_freq);
+	is_curchan_24g = WLAN_REG_IS_24GHZ_CH_FREQ(center_freq);
 	is_curchan_49g = WLAN_REG_IS_49GHZ_FREQ(center_freq);
 
 	for (i = 0; i < *num_chan; i++) {
@@ -870,13 +870,13 @@ static void utils_dfs_get_channel_list(struct wlan_objmgr_pdev *pdev,
 		if (!dfs_mlme_check_allowed_prim_chanlist(pdev, chan_num))
 			continue;
 
-		if ((is_curchan_5g) && WLAN_REG_IS_5GHZ_CH(chan_num)) {
+		if ((is_curchan_5g) && WLAN_REG_IS_5GHZ_CH_FREQ(center_freq)) {
 			chan_list[j].dfs_ch_ieee = chan_num;
 			chan_list[j].dfs_ch_freq = center_freq;
 			chan_list[j].dfs_ch_flagext = flagext;
 			j++;
 		} else if ((is_curchan_24g) &&
-				WLAN_REG_IS_24GHZ_CH(chan_num)) {
+				WLAN_REG_IS_24GHZ_CH_FREQ(center_freq)) {
 			chan_list[j].dfs_ch_ieee = chan_num;
 			chan_list[j].dfs_ch_freq = center_freq;
 			j++;

+ 14 - 0
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -555,6 +555,20 @@ enum channel_state wlan_reg_get_bonded_channel_state(
 	enum phy_ch_width bw, uint8_t sec_ch);
 #endif /* CONFIG_CHAN_NUM_API */
 
+/**
+ * wlan_reg_get_bonded_channel_state_for_freq() - Get bonded channel freq state
+ * @freq: channel frequency
+ * @bw: channel band width
+ * @sec_freq: secondary frequency
+ *
+ * Return: channel state
+ */
+enum channel_state
+wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
+					   qdf_freq_t freq,
+					   enum phy_ch_width bw,
+					   qdf_freq_t sec_freq);
+
 /**
  * wlan_reg_set_dfs_region() - set the dfs region
  * @pdev: pdev ptr

+ 19 - 3
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -243,9 +243,10 @@ qdf_export_symbol(wlan_reg_get_bw_value);
  *
  * Return: channel state
  */
-enum channel_state wlan_reg_get_bonded_channel_state(
-	struct wlan_objmgr_pdev *pdev, uint8_t ch,
-	enum phy_ch_width bw, uint8_t sec_ch)
+enum channel_state
+wlan_reg_get_bonded_channel_state(struct wlan_objmgr_pdev *pdev,
+				  uint8_t ch,
+				  enum phy_ch_width bw, uint8_t sec_ch)
 {
 	if (WLAN_REG_IS_24GHZ_CH(ch))
 		return reg_get_2g_bonded_channel_state(pdev, ch,
@@ -254,6 +255,7 @@ enum channel_state wlan_reg_get_bonded_channel_state(
 		return reg_get_5g_bonded_channel_state(pdev, ch,
 						       bw);
 }
+
 #endif /* CONFIG_CHAN_NUM_API */
 
 /**
@@ -1106,6 +1108,20 @@ wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
 						  bonded_chan_ptr_ptr);
 }
 
+enum channel_state
+wlan_reg_get_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
+					   qdf_freq_t freq,
+					   enum phy_ch_width bw,
+					   qdf_freq_t sec_freq)
+{
+	if (WLAN_REG_IS_24GHZ_CH_FREQ(freq))
+		return reg_get_2g_bonded_channel_state_for_freq(pdev, freq,
+						       sec_freq, bw);
+	else
+		return reg_get_5g_bonded_channel_state_for_freq(pdev, freq,
+						       bw);
+}
+
 qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_freq);
 
 #endif /* CONFIG CHAN FREQ API */