Browse Source

qcacmn: Add new min and max freq APIs

Add new APIs that return minimum and maximum channel frequency,
supported by regulatory domain.

Change-Id: I878bd6f4ff8fdbe28661769033c37a000aebf582
CRs-Fixed: 2538143
Amar Singhal 5 years ago
parent
commit
0c46139fee

+ 10 - 0
umac/regulatory/core/src/reg_services_common.c

@@ -3352,6 +3352,16 @@ bool reg_is_frequency_valid_5g_sbs(uint16_t curfreq, uint16_t newfreq)
 	return REG_IS_FREQUENCY_VALID_5G_SBS(curfreq, newfreq);
 }
 
+uint16_t reg_min_chan_freq(void)
+{
+	return channel_map[MIN_24GHZ_CHANNEL].center_freq;
+}
+
+uint16_t reg_max_chan_freq(void)
+{
+	return channel_map[NUM_CHANNELS - 1].center_freq;
+}
+
 bool reg_is_same_band_freqs(uint16_t freq1, uint16_t freq2)
 {
 	return (freq1 && freq2 && ((REG_IS_6GHZ_FREQ(freq1) &&

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

@@ -889,5 +889,20 @@ bool reg_is_frequency_valid_5g_sbs(uint16_t curfreq, uint16_t newfreq);
  * Return: wifi band
  */
 enum reg_wifi_band reg_freq_to_band(uint16_t freq);
+
+/**
+ * reg_min_chan_freq() - minimum channel frequency supported
+ *
+ * Return: channel frequency
+ */
+uint16_t reg_min_chan_freq(void);
+
+/**
+ * reg_max_chan_freq() - maximum channel frequency supported
+ *
+ * Return: channel frequency
+ */
+uint16_t reg_max_chan_freq(void);
+
 #endif /* CONFIG_CHAN_FREQ_API */
 #endif

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

@@ -1087,5 +1087,20 @@ bool wlan_reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq);
  * Return: wifi band
  */
 enum reg_wifi_band wlan_reg_freq_to_band(uint16_t freq);
+
+/**
+ * wlan_reg_min_chan_freq () - minimum channel frequency supported
+ *
+ * Return: frequency
+ */
+uint16_t wlan_reg_min_chan_freq(void);
+
+/**
+ * wlan_reg_max_chan_freq () - Checks chan state f
+ *
+ * Return: frequency
+ */
+uint16_t wlan_reg_max_chan_freq(void);
+
 #endif /*CONFIG_CHAN_FREQ_API */
 #endif

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

@@ -959,4 +959,15 @@ enum reg_wifi_band wlan_reg_freq_to_band(uint16_t freq)
 {
 	return reg_freq_to_band(freq);
 }
+
+uint16_t wlan_reg_min_chan_freq(void)
+{
+	return reg_min_chan_freq();
+}
+
+uint16_t wlan_reg_max_chan_freq(void)
+{
+	return reg_max_chan_freq();
+}
+
 #endif /* CONFIG CHAN FREQ API */