Răsfoiți Sursa

qcacmn: Get center freq from chan center freq index

AP sends chan center freq index via Bandwidth Indication OPIE
in channel load request.

Call reg_compute_6g_center_freq_from_cfi API to get corresponding
center freq for 6 GHz and 320 MHz case.

Change-Id: I14bbfe75016e40189388f32fd207d21197bc989b
CRs-Fixed: 3629129
Abhinav Kumar 1 an în urmă
părinte
comite
2d444f83ec

+ 2 - 9
umac/regulatory/core/src/reg_services_common.c

@@ -9506,19 +9506,12 @@ reg_get_eirp_from_mas_chan_list(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq,
 	return txpower;
 }
 
-#ifdef CONFIG_AFC_SUPPORT
-/**
- * reg_compute_6g_center_freq_from_cfi() - Given the IEEE value of the
- * 6 GHz center frequency, find the 6 GHz center frequency.
- * @ieee_6g_cfi: IEEE value of 6 GHz cfi
- * Return: Center frequency in MHz
- */
-static qdf_freq_t
-reg_compute_6g_center_freq_from_cfi(uint8_t ieee_6g_cfi)
+qdf_freq_t reg_compute_6g_center_freq_from_cfi(uint8_t ieee_6g_cfi)
 {
 	return (SIXG_START_FREQ + ieee_6g_cfi * FREQ_TO_CHAN_SCALE);
 }
 
+#ifdef CONFIG_AFC_SUPPORT
 #ifdef WLAN_FEATURE_11BE
 /**
  * reg_is_320_opclass: Find out if the opclass computed from freq and

+ 17 - 0
umac/regulatory/core/src/reg_services_common.h

@@ -2707,6 +2707,15 @@ reg_conv_6g_ap_type_to_supported_6g_pwr_types(enum reg_6g_ap_type ap_pwr_type);
 enum phy_ch_width reg_find_chwidth_from_bw(uint16_t bw);
 
 #ifdef CONFIG_BAND_6GHZ
+/**
+ * reg_compute_6g_center_freq_from_cfi() - Given the IEEE value of the
+ * 6 GHz center frequency, find the 6 GHz center frequency.
+ * @ieee_6g_cfi: IEEE value of 6 GHz cfi
+ *
+ * Return: Center frequency in MHz
+ */
+qdf_freq_t reg_compute_6g_center_freq_from_cfi(uint8_t ieee_6g_cfi);
+
 /**
  * reg_get_thresh_priority_freq() - Get the prioritized frequency value
  * @pdev: pdev pointer
@@ -2752,6 +2761,14 @@ int8_t reg_get_eirp_pwr(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq,
 			uint16_t in_punc_pattern,
 			bool is_client_list_lookup_needed,
 			enum reg_6g_client_type client_type);
+
+#else
+static inline
+qdf_freq_t reg_compute_6g_center_freq_from_cfi(uint8_t ieee_6g_cfi)
+{
+	return 0;
+}
+
 #endif /* CONFIG_BAND_6GHZ */
 
 /**

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

@@ -2165,6 +2165,15 @@ uint16_t wlan_reg_chan_opclass_to_freq(uint8_t chan,
 				       uint8_t op_class,
 				       bool global_tbl_lookup);
 
+/**
+ * wlan_reg_compute_6g_center_freq_from_cfi() - Given the IEEE value of the
+ * 6 GHz center frequency, find the 6 GHz center frequency.
+ * @ieee_6g_cfi: IEEE value of 6 GHz cfi
+ *
+ * Return: Center frequency in MHz
+ */
+qdf_freq_t wlan_reg_compute_6g_center_freq_from_cfi(uint8_t ieee_6g_cfi);
+
 /**
  * wlan_reg_chan_opclass_to_freq_auto() - Convert channel number and opclass to
  * frequency

+ 8 - 0
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -1564,6 +1564,14 @@ uint16_t wlan_reg_chan_opclass_to_freq(uint8_t chan,
 	return reg_chan_opclass_to_freq(chan, op_class, global_tbl_lookup);
 }
 
+qdf_freq_t wlan_reg_compute_6g_center_freq_from_cfi(uint8_t ieee_6g_cfi)
+{
+	if (!ieee_6g_cfi)
+		return 0;
+
+	return reg_compute_6g_center_freq_from_cfi(ieee_6g_cfi);
+}
+
 qdf_freq_t wlan_reg_chan_opclass_to_freq_auto(uint8_t chan, uint8_t op_class,
 					      bool global_tbl_lookup)
 {