qcacmn: Add dispatcher functions for band overlap APIs
Add dispatcher functions for wlan_reg_is_range_overlap_2g and wlan_reg_is_range_overlap_5g. Change-Id: Ib5dc1728227117ea271ef8efa1290e7e5d711757 CRs-Fixed: 2765562
This commit is contained in:

committed by
snandini

parent
32a9cc93a8
commit
fa89410007
@@ -2481,13 +2481,6 @@ static inline bool BAND_5G_PRESENT(uint8_t band_mask)
|
|||||||
return !!(band_mask & (BIT(REG_BAND_5G)));
|
return !!(band_mask & (BIT(REG_BAND_5G)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_BAND_6GHZ
|
|
||||||
bool reg_is_6ghz_chan_freq(uint16_t freq)
|
|
||||||
{
|
|
||||||
return REG_IS_6GHZ_FREQ(freq);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_6G_FREQ_OVERLAP
|
|
||||||
/**
|
/**
|
||||||
* reg_is_freq_in_between() - Check whether freq falls within low_freq and
|
* reg_is_freq_in_between() - Check whether freq falls within low_freq and
|
||||||
* high_freq, inclusively.
|
* high_freq, inclusively.
|
||||||
@@ -2521,20 +2514,32 @@ static bool reg_is_ranges_overlap(qdf_freq_t low_freq, qdf_freq_t high_freq,
|
|||||||
end_edge_freq));
|
end_edge_freq));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool reg_is_range_overlap_6g(qdf_freq_t low_freq,
|
bool reg_is_range_overlap_2g(qdf_freq_t low_freq, qdf_freq_t high_freq)
|
||||||
qdf_freq_t high_freq)
|
|
||||||
{
|
{
|
||||||
return reg_is_ranges_overlap(low_freq, high_freq,
|
return reg_is_ranges_overlap(low_freq, high_freq,
|
||||||
SIXG_STARTING_EDGE_FREQ,
|
TWO_GIG_STARTING_EDGE_FREQ,
|
||||||
SIXG_ENDING_EDGE_FREQ);
|
TWO_GIG_ENDING_EDGE_FREQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool reg_is_range_overlap_5g(qdf_freq_t low_freq,
|
bool reg_is_range_overlap_5g(qdf_freq_t low_freq, qdf_freq_t high_freq)
|
||||||
qdf_freq_t high_freq)
|
|
||||||
{
|
{
|
||||||
return reg_is_ranges_overlap(low_freq, high_freq,
|
return reg_is_ranges_overlap(low_freq, high_freq,
|
||||||
FIVEG_STARTING_EDGE_FREQ,
|
FIVE_GIG_STARTING_EDGE_FREQ,
|
||||||
FIVEG_ENDING_EDGE_FREQ);
|
FIVE_GIG_ENDING_EDGE_FREQ);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_BAND_6GHZ
|
||||||
|
bool reg_is_6ghz_chan_freq(uint16_t freq)
|
||||||
|
{
|
||||||
|
return REG_IS_6GHZ_FREQ(freq);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_6G_FREQ_OVERLAP
|
||||||
|
bool reg_is_range_overlap_6g(qdf_freq_t low_freq, qdf_freq_t high_freq)
|
||||||
|
{
|
||||||
|
return reg_is_ranges_overlap(low_freq, high_freq,
|
||||||
|
SIX_GIG_STARTING_EDGE_FREQ,
|
||||||
|
SIX_GIG_ENDING_EDGE_FREQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool reg_is_range_only6g(qdf_freq_t low_freq, qdf_freq_t high_freq)
|
bool reg_is_range_only6g(qdf_freq_t low_freq, qdf_freq_t high_freq)
|
||||||
|
@@ -81,15 +81,19 @@
|
|||||||
#define HALF_5MHZ_BW 2
|
#define HALF_5MHZ_BW 2
|
||||||
#define HALF_20MHZ_BW 10
|
#define HALF_20MHZ_BW 10
|
||||||
|
|
||||||
#define FIVEG_STARTING_EDGE_FREQ (channel_map_global[MIN_49GHZ_CHANNEL]. \
|
#define TWO_GIG_STARTING_EDGE_FREQ (channel_map_global[MIN_24GHZ_CHANNEL]. \
|
||||||
|
center_freq - HALF_20MHZ_BW)
|
||||||
|
#define TWO_GIG_ENDING_EDGE_FREQ (channel_map_global[MAX_24GHZ_CHANNEL]. \
|
||||||
|
center_freq + HALF_20MHZ_BW)
|
||||||
|
#define FIVE_GIG_STARTING_EDGE_FREQ (channel_map_global[MIN_49GHZ_CHANNEL]. \
|
||||||
center_freq - HALF_5MHZ_BW)
|
center_freq - HALF_5MHZ_BW)
|
||||||
#define FIVEG_ENDING_EDGE_FREQ (channel_map_global[MAX_5GHZ_CHANNEL]. \
|
#define FIVE_GIG_ENDING_EDGE_FREQ (channel_map_global[MAX_5GHZ_CHANNEL]. \
|
||||||
center_freq + HALF_20MHZ_BW)
|
center_freq + HALF_20MHZ_BW)
|
||||||
|
|
||||||
#ifdef CONFIG_BAND_6GHZ
|
#ifdef CONFIG_BAND_6GHZ
|
||||||
#define SIXG_STARTING_EDGE_FREQ (channel_map_global[MIN_6GHZ_CHANNEL]. \
|
#define SIX_GIG_STARTING_EDGE_FREQ (channel_map_global[MIN_6GHZ_CHANNEL]. \
|
||||||
center_freq - HALF_20MHZ_BW)
|
center_freq - HALF_20MHZ_BW)
|
||||||
#define SIXG_ENDING_EDGE_FREQ (channel_map_global[MAX_6GHZ_CHANNEL]. \
|
#define SIX_GIG_ENDING_EDGE_FREQ (channel_map_global[MAX_6GHZ_CHANNEL]. \
|
||||||
center_freq + HALF_20MHZ_BW)
|
center_freq + HALF_20MHZ_BW)
|
||||||
|
|
||||||
#define FREQ_LEFT_SHIFT 55
|
#define FREQ_LEFT_SHIFT 55
|
||||||
@@ -553,6 +557,30 @@ bool reg_is_24ghz_ch_freq(uint32_t freq);
|
|||||||
*/
|
*/
|
||||||
bool reg_is_5ghz_ch_freq(uint32_t freq);
|
bool reg_is_5ghz_ch_freq(uint32_t freq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reg_is_range_overlap_2g() - Check if the given low_freq and high_freq
|
||||||
|
* is in the 2G range.
|
||||||
|
*
|
||||||
|
* @low_freq - Low frequency.
|
||||||
|
* @high_freq - High frequency.
|
||||||
|
*
|
||||||
|
* Return: Return true if given low_freq and high_freq overlaps 2G range,
|
||||||
|
* else false.
|
||||||
|
*/
|
||||||
|
bool reg_is_range_overlap_2g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reg_is_range_overlap_5g() - Check if the given low_freq and high_freq
|
||||||
|
* is in the 5G range.
|
||||||
|
*
|
||||||
|
* @low_freq - Low frequency.
|
||||||
|
* @high_freq - High frequency.
|
||||||
|
*
|
||||||
|
* Return: Return true if given low_freq and high_freq overlaps 5G range,
|
||||||
|
* else false.
|
||||||
|
*/
|
||||||
|
bool reg_is_range_overlap_5g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
||||||
|
|
||||||
#ifdef CONFIG_BAND_6GHZ
|
#ifdef CONFIG_BAND_6GHZ
|
||||||
/**
|
/**
|
||||||
* reg_is_6ghz_chan_freq() - Check if the given channel frequency is 6GHz
|
* reg_is_6ghz_chan_freq() - Check if the given channel frequency is 6GHz
|
||||||
@@ -564,16 +592,28 @@ bool reg_is_6ghz_chan_freq(uint16_t freq);
|
|||||||
|
|
||||||
#ifdef CONFIG_6G_FREQ_OVERLAP
|
#ifdef CONFIG_6G_FREQ_OVERLAP
|
||||||
/**
|
/**
|
||||||
* reg_is_range_only6g() - Check if the given low_freq and high_freq is in
|
* reg_is_range_only6g() - Check if the given low_freq and high_freq is only in
|
||||||
* the 6G range.
|
* the 6G range.
|
||||||
*
|
*
|
||||||
* @low_freq - Low frequency.
|
* @low_freq - Low frequency.
|
||||||
* @high_freq - High frequency.
|
* @high_freq - High frequency.
|
||||||
*
|
*
|
||||||
|
* Return: Return true if given low_freq and high_freq overlaps only the 6G
|
||||||
|
* range, else false.
|
||||||
|
*/
|
||||||
|
bool reg_is_range_only6g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reg_is_range_overlap_6g() - Check if the given low_freq and high_freq
|
||||||
|
* is in the 6G range.
|
||||||
|
*
|
||||||
|
* @low_freq - Low frequency.
|
||||||
|
* @high_freq - High frequency.
|
||||||
|
*
|
||||||
* Return: Return true if given low_freq and high_freq overlaps 6G range,
|
* Return: Return true if given low_freq and high_freq overlaps 6G range,
|
||||||
* else false.
|
* else false.
|
||||||
*/
|
*/
|
||||||
bool reg_is_range_only6g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
bool reg_is_range_overlap_6g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -633,6 +673,12 @@ reg_is_6g_freq_indoor(struct wlan_objmgr_pdev *pdev, qdf_freq_t freq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_6G_FREQ_OVERLAP
|
#ifdef CONFIG_6G_FREQ_OVERLAP
|
||||||
|
static inline bool reg_is_range_overlap_6g(qdf_freq_t low_freq,
|
||||||
|
qdf_freq_t high_freq)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool reg_is_range_only6g(qdf_freq_t low_freq,
|
static inline bool reg_is_range_only6g(qdf_freq_t low_freq,
|
||||||
qdf_freq_t high_freq)
|
qdf_freq_t high_freq)
|
||||||
{
|
{
|
||||||
|
@@ -134,6 +134,30 @@ bool wlan_reg_is_24ghz_ch_freq(qdf_freq_t freq);
|
|||||||
#define WLAN_REG_IS_5GHZ_CH_FREQ(freq) wlan_reg_is_5ghz_ch_freq(freq)
|
#define WLAN_REG_IS_5GHZ_CH_FREQ(freq) wlan_reg_is_5ghz_ch_freq(freq)
|
||||||
bool wlan_reg_is_5ghz_ch_freq(qdf_freq_t freq);
|
bool wlan_reg_is_5ghz_ch_freq(qdf_freq_t freq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_reg_is_range_overlap_2g() - Check if the given low_freq and high_freq
|
||||||
|
* is in the 2G range.
|
||||||
|
*
|
||||||
|
* @low_freq - Low frequency.
|
||||||
|
* @high_freq - High frequency.
|
||||||
|
*
|
||||||
|
* Return: Return true if given low_freq and high_freq overlaps 2G range,
|
||||||
|
* else false.
|
||||||
|
*/
|
||||||
|
bool wlan_reg_is_range_overlap_2g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_reg_is_range_overlap_5g() - Check if the given low_freq and high_freq
|
||||||
|
* is in the 5G range.
|
||||||
|
*
|
||||||
|
* @low_freq - Low frequency.
|
||||||
|
* @high_freq - High frequency.
|
||||||
|
*
|
||||||
|
* Return: Return true if given low_freq and high_freq overlaps 5G range,
|
||||||
|
* else false.
|
||||||
|
*/
|
||||||
|
bool wlan_reg_is_range_overlap_5g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
||||||
|
|
||||||
#ifdef CONFIG_BAND_6GHZ
|
#ifdef CONFIG_BAND_6GHZ
|
||||||
/**
|
/**
|
||||||
* wlan_reg_is_6ghz_chan_freq() - Check if the given channel frequency is 6GHz
|
* wlan_reg_is_6ghz_chan_freq() - Check if the given channel frequency is 6GHz
|
||||||
@@ -155,12 +179,30 @@ bool wlan_reg_is_6ghz_chan_freq(uint16_t freq);
|
|||||||
* else false.
|
* else false.
|
||||||
*/
|
*/
|
||||||
bool wlan_reg_is_range_only6g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
bool wlan_reg_is_range_only6g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_reg_is_range_overlap_6g() - Check if the given low_freq and high_freq
|
||||||
|
* is in the 6G range.
|
||||||
|
*
|
||||||
|
* @low_freq - Low frequency.
|
||||||
|
* @high_freq - High frequency.
|
||||||
|
*
|
||||||
|
* Return: Return true if given low_freq and high_freq overlaps 6G range,
|
||||||
|
* else false.
|
||||||
|
*/
|
||||||
|
bool wlan_reg_is_range_overlap_6g(qdf_freq_t low_freq, qdf_freq_t high_freq);
|
||||||
#else
|
#else
|
||||||
static inline bool wlan_reg_is_range_only6g(qdf_freq_t low_freq,
|
static inline bool wlan_reg_is_range_only6g(qdf_freq_t low_freq,
|
||||||
qdf_freq_t high_freq)
|
qdf_freq_t high_freq)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool wlan_reg_is_range_overlap_6g(qdf_freq_t low_freq,
|
||||||
|
qdf_freq_t high_freq)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -789,6 +789,16 @@ bool wlan_reg_is_5ghz_ch_freq(qdf_freq_t freq)
|
|||||||
return reg_is_5ghz_ch_freq(freq);
|
return reg_is_5ghz_ch_freq(freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wlan_reg_is_range_overlap_2g(qdf_freq_t low_freq, qdf_freq_t high_freq)
|
||||||
|
{
|
||||||
|
return reg_is_range_overlap_2g(low_freq, high_freq);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wlan_reg_is_range_overlap_5g(qdf_freq_t low_freq, qdf_freq_t high_freq)
|
||||||
|
{
|
||||||
|
return reg_is_range_overlap_5g(low_freq, high_freq);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_BAND_6GHZ
|
#ifdef CONFIG_BAND_6GHZ
|
||||||
bool wlan_reg_is_6ghz_chan_freq(uint16_t freq)
|
bool wlan_reg_is_6ghz_chan_freq(uint16_t freq)
|
||||||
{
|
{
|
||||||
@@ -800,6 +810,11 @@ bool wlan_reg_is_range_only6g(qdf_freq_t low_freq, qdf_freq_t high_freq)
|
|||||||
{
|
{
|
||||||
return reg_is_range_only6g(low_freq, high_freq);
|
return reg_is_range_only6g(low_freq, high_freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wlan_reg_is_range_overlap_6g(qdf_freq_t low_freq, qdf_freq_t high_freq)
|
||||||
|
{
|
||||||
|
return reg_is_range_overlap_6g(low_freq, high_freq);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint16_t wlan_reg_min_6ghz_chan_freq(void)
|
uint16_t wlan_reg_min_6ghz_chan_freq(void)
|
||||||
|
Reference in New Issue
Block a user