qcacmn: Use channel frequency instead of channel number

1) Add the API wlan_reg_get_5g_bonded_channel_and_state_for_freq
   that returns  the state for a 5G or 6G channel frequency,
   based on the channel width and and state of the bonded channels.

2) In the API target_if_calculate_center_freq, remove the instances
of IEEE channel number, and provide regulatory support, with the
channel frequency based structure - bonded_channel_freq and the API -
wlan_reg_get_5g_bonded_channel_and_state_for_freq.

3) Remove the usage of band_info and replace it with reg_wifi_band within
the target_if of the spectral module.

Change-Id: If5108b55097208d33fafb48968ea8b6dc83011fa
CRs-Fixed: 2571906
This commit is contained in:
Hariharan Basuthkar
2019-11-04 17:48:23 +05:30
committed by nshrivas
parent 1e974a9312
commit 379ebfe4e3
6 changed files with 87 additions and 50 deletions

View File

@@ -1160,6 +1160,24 @@ void wlan_reg_freq_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
uint8_t *op_class,
uint8_t *chan_num);
/**
* wlan_reg_get_5g_bonded_channel_and_state_for_freq()- Return the channel
* state for a 5G or 6G channel frequency based on the channel width and
* bonded channel.
* @pdev: Pointer to pdev.
* @freq: Channel center frequency.
* @bw Channel Width.
* @bonded_chan_ptr_ptr: Pointer to bonded_channel_freq.
*
* Return: Channel State
*/
enum channel_state
wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width bw,
const
struct bonded_channel_freq
**bonded_chan_ptr_ptr);
#endif /*CONFIG_CHAN_FREQ_API */
/**

View File

@@ -966,6 +966,8 @@ enum reg_wifi_band wlan_reg_freq_to_band(uint16_t freq)
return reg_freq_to_band(freq);
}
qdf_export_symbol(wlan_reg_freq_to_band);
uint16_t wlan_reg_min_chan_freq(void)
{
return reg_min_chan_freq();
@@ -1005,6 +1007,23 @@ void wlan_reg_freq_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
chan_num);
}
enum channel_state
wlan_reg_get_5g_bonded_channel_and_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width bw,
const
struct bonded_channel_freq
**bonded_chan_ptr_ptr)
{
/*
* Get channel frequencies and state from regulatory
*/
return reg_get_5g_bonded_channel_for_freq(pdev, freq, bw,
bonded_chan_ptr_ptr);
}
qdf_export_symbol(wlan_reg_get_5g_bonded_channel_and_state_for_freq);
#endif /* CONFIG CHAN FREQ API */
uint16_t wlan_reg_get_op_class_width(struct wlan_objmgr_pdev *pdev,