qcacmn: Add an API to translate the 6G channel enum

Add an API reg_translate_6g_chan_enum to translate an index between
MIN_6GHZ_CHANNEL and MAX_6GHZ_CHANNEL, to an index between 0 and
NUM_6GHZ_CHANNELS.

Change-Id: I5eaacf36403252a56293b8fadc797ac2aacd751d
CRs-Fixed: 3099080
This commit is contained in:
Hariharan Basuthkar
2021-12-22 17:05:49 +05:30
committad av Madan Koyyalamudi
förälder 3d2e170e10
incheckning 722f740848
2 ändrade filer med 27 tillägg och 0 borttagningar

Visa fil

@@ -6087,6 +6087,23 @@ bool reg_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc)
return psoc_priv_obj->is_upper_6g_edge_ch_disabled;
}
static inline bool reg_is_within_range_inclusive(enum channel_enum left,
enum channel_enum right,
enum channel_enum idx)
{
return (idx >= left) && (idx <= right);
}
uint16_t reg_convert_enum_to_6g_idx(enum channel_enum ch_idx)
{
if (!reg_is_within_range_inclusive(MIN_6GHZ_CHANNEL,
MAX_6GHZ_CHANNEL,
ch_idx))
return INVALID_CHANNEL;
return (ch_idx - MIN_6GHZ_CHANNEL);
}
#endif
#ifdef FEATURE_WLAN_CH_AVOID_EXT

Visa fil

@@ -1718,6 +1718,16 @@ bool reg_is_lower_6g_edge_ch_supp(struct wlan_objmgr_psoc *psoc);
* Return: true if edge channels are supported, else false
*/
bool reg_is_upper_6g_edge_ch_disabled(struct wlan_objmgr_psoc *psoc);
/**
* reg_convert_enum_to_6g_idx() - Convert a channel enum between
* MIN_6GHZ_CHANNEL and MAX_6GHZ_CHANNEL, to an index between 0 and
* NUM_6GHZ_CHANNELS
* @ch_idx: Channel index
*
* Return: enum channel_enum
*/
uint16_t reg_convert_enum_to_6g_idx(enum channel_enum ch_idx);
#endif
#ifdef FEATURE_WLAN_CH_AVOID_EXT