1
0

qcacmn: Add frequency based APIs within the regulatory component

The IEEE channel numbers in the 6GHz band overlap with the
IEEE channel numbers in 2.4GHz, 4.9GHz (e.g. Channel number 1) and 5GHz
(e.g. Channel number 149). Currently many APIs in the regulatory
component, have channel number as a parameter. This leads to the channel
number collision.

To overcome this, new APIs with channel center frequency ( in units of
megahertz or MHz) as a parameter are created, as a channel center center
frequency is unique for 2.4 GHz, 4.9 GHz, 5GHz, and 6GHz channels.

Each new API performs the same function as its old counterpart.
For example reg_set_5g_channel_params() and
reg_set_5g_channel_params_for_freq perform the same operation. The
difference in the latter, is that the channel center frequency is given
as an input parameter instead of IEEE channel number, and the function
body is modified to suit channel center frequency.

The new channel frequency based APIs are placed under the macro
"CONFIG_CHAN_FREQ_API" and the existing channel number based APIs are
placed under the macro "CONFIG_CHAN_NUM_API". The APIs under the macro
CONFIG_CHAN_NUM_API can be removed, when when all the references to
the APIs are removed.

Change-Id: I0347e8d31c25e2c3a406aafe1360c7c7b602fda2
CRs-Fixed: 2463009
Este cometimento está contido em:
Hariharan Basuthkar
2019-07-01 17:14:17 +05:30
cometido por nshrivas
ascendente 2082a4c585
cometimento 7eb35947eb
10 ficheiros modificados com 2039 adições e 101 eliminações

Ver ficheiro

@@ -492,22 +492,28 @@ enum ctl_value {
* struct ch_params
* @ch_width: channel width
* @sec_ch_offset: secondary channel offset
* @center_freq_seg0: center freq for segment 0
* @center_freq_seg1: center freq for segment 1
* @center_freq_seg0: channel number for segment 0
* @center_freq_seg1: channel number segment 1
* @mhz_freq_seg0: Center frequency for segment 0
* @mhz_freq_seg1: Center frequency for segment 1
*/
struct ch_params {
enum phy_ch_width ch_width;
uint8_t sec_ch_offset;
uint8_t center_freq_seg0;
uint8_t center_freq_seg1;
uint16_t mhz_freq_seg0;
uint16_t mhz_freq_seg1;
};
/**
* struct channel_power
* @center_freq: Channel Center Frequency
* @chan_num: channel number
* @tx_power: TX power
*/
struct channel_power {
uint32_t center_freq;
uint32_t chan_num;
uint32_t tx_power;
};
@@ -674,6 +680,16 @@ struct bonded_channel {
uint16_t end_ch;
};
/**
* struct bonded_channel_freq
* @start_freq: start channel frequency
* @end_freq: end channel frequency
*/
struct bonded_channel_freq {
uint16_t start_freq;
uint16_t end_freq;
};
struct set_country {
uint8_t country[REG_ALPHA2_LEN + 1];
uint8_t pdev_id;
@@ -734,7 +750,7 @@ struct cur_reg_rule {
* @min_bw_5g: minimum 5G bw
* @max_bw_5g: maximum 5G bw
* @num_2g_reg_rules: number 2G reg rules
* @num_5g_reg_rules: number 5G reg rules
* @num_5g_reg_rules: number 5G and 6G reg rules
* @reg_rules_2g_ptr: ptr to 2G reg rules
* @reg_rules_5g_ptr: ptr to 5G reg rules
*/

Ver ficheiro

@@ -26,6 +26,7 @@
#ifndef __WLAN_REG_SERVICES_API_H
#define __WLAN_REG_SERVICES_API_H
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_min_24ghz_ch_num() - Get minimum 2.4GHz channel number
*
@@ -57,7 +58,43 @@ uint32_t wlan_reg_min_5ghz_ch_num(void);
*/
#define WLAN_REG_MAX_5GHZ_CH_NUM wlan_reg_max_5ghz_ch_num()
uint32_t wlan_reg_max_5ghz_ch_num(void);
#endif /* CONFIG_CHAN_NUM_API */
#ifdef CONFIG_CHAN_FREQ_API
/**
* wlan_reg_min_24ghz_chan_freq() - Get minimum 2.4GHz channel frequency
*
* Return: Minimum 2.4GHz channel frequency
*/
#define WLAN_REG_MIN_24GHZ_CHAN_FREQ wlan_reg_min_24ghz_chan_freq()
uint16_t wlan_reg_min_24ghz_chan_freq(void);
/**
* wlan_reg_max_24ghz_chan_freq() - Get maximum 2.4GHz channel frequency
*
* Return: Maximum 2.4GHz channel frequency
*/
#define WLAN_REG_MAX_24GHZ_CHAN_FREQ wlan_reg_max_24ghz_chan_freq()
uint16_t wlan_reg_max_24ghz_chan_freq(void);
/**
* wlan_reg_min_5ghz_chan_freq() - Get minimum 5GHz channel frequency
*
* Return: Minimum 5GHz channel frequency
*/
#define WLAN_REG_MIN_5GHZ_CHAN_FREQ wlan_reg_min_5ghz_chan_freq()
uint16_t wlan_reg_min_5ghz_chan_freq(void);
/**
* wlan_reg_max_5ghz_chan_freq() - Get maximum 5GHz channel frequency
*
* Return: Maximum 5GHz channel frequency
*/
#define WLAN_REG_MAX_5GHZ_CHAN_FREQ wlan_reg_max_5ghz_chan_freq()
uint16_t wlan_reg_max_5ghz_chan_freq(void);
#endif /* CONFIG_CHAN_FREQ_API */
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_is_24ghz_ch() - Check if the given channel number is 2.4GHz
* @chan: Channel number
@@ -75,6 +112,7 @@ bool wlan_reg_is_24ghz_ch(uint32_t chan);
*/
#define WLAN_REG_IS_5GHZ_CH(chan) wlan_reg_is_5ghz_ch(chan)
bool wlan_reg_is_5ghz_ch(uint32_t chan);
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_is_24ghz_ch_freq() - Check if the given channel frequency is 2.4GHz
@@ -94,8 +132,6 @@ bool wlan_reg_is_24ghz_ch_freq(uint32_t freq);
#define WLAN_REG_IS_5GHZ_CH_FREQ(freq) wlan_reg_is_5ghz_ch_freq(freq)
bool wlan_reg_is_5ghz_ch_freq(uint32_t freq);
#define WLAN_REG_IS_6GHZ_CHAN_FREQ(freq) wlan_reg_is_6ghz_chan_freq(freq)
#ifdef CONFIG_BAND_6GHZ
/**
* wlan_reg_is_6ghz_chan_freq() - Check if the given channel frequency is 6GHz
@@ -103,14 +139,62 @@ bool wlan_reg_is_5ghz_ch_freq(uint32_t freq);
*
* Return: true if channel frequency is 6GHz, else false
*/
#define WLAN_REG_IS_6GHZ_CHAN_FREQ(freq) wlan_reg_is_6ghz_chan_freq(freq)
bool wlan_reg_is_6ghz_chan_freq(uint16_t freq);
/**
* wlan_reg_is_6ghz_psc_chan_freq() - Check if the given 6GHz channel frequency
* is preferred scanning channel frequency.
* @freq: Channel frequency
*
* Return: true if given 6GHz channel frequency is preferred scanning channel
* frequency, else false
*/
#define WLAN_REG_IS_6GHZ_PSC_CHAN_FREQ(freq) \
wlan_reg_is_6ghz_psc_chan_freq(freq)
bool wlan_reg_is_6ghz_psc_chan_freq(uint16_t freq);
/**
* wlan_reg_min_6ghz_chan_freq() - Get minimum 6GHz channel center frequency
*
* Return: Minimum 6GHz channel center frequency
*/
#define WLAN_REG_MIN_6GHZ_CHAN_FREQ wlan_reg_min_6ghz_chan_freq()
uint16_t wlan_reg_min_6ghz_chan_freq(void);
/**
* wlan_reg_max_6ghz_chan_freq() - Get maximum 6GHz channel center frequency
*
* Return: Maximum 6GHz channel center frequency
*/
#define WLAN_REG_MAX_6GHZ_CHAN_FREQ wlan_reg_max_6ghz_chan_freq()
uint16_t wlan_reg_max_6ghz_chan_freq(void);
#else
#define WLAN_REG_IS_6GHZ_CHAN_FREQ(freq) (false)
static inline bool wlan_reg_is_6ghz_chan_freq(uint16_t freq)
{
return false;
}
#endif
#define WLAN_REG_IS_6GHZ_PSC_CHAN_FREQ(freq) (false)
static inline bool wlan_reg_is_6ghz_psc_chan_freq(uint16_t freq)
{
return false;
}
#define WLAN_REG_MIN_6GHZ_CHAN_FREQ (false)
static inline uint16_t wlan_reg_min_6ghz_chan_freq(void)
{
return 0;
}
#define WLAN_REG_MAX_6GHZ_CHAN_FREQ (false)
static inline uint16_t wlan_reg_max_6ghz_chan_freq(void)
{
return 0;
}
#endif /* CONFIG_BAND_6GHZ */
/**
* wlan_reg_is_49ghz_freq() - Check if the given channel frequency is 4.9GHz
@@ -139,6 +223,7 @@ uint32_t wlan_reg_ch_num(uint32_t ch_enum);
#define WLAN_REG_CH_TO_FREQ(ch_enum) wlan_reg_ch_to_freq(ch_enum)
uint32_t wlan_reg_ch_to_freq(uint32_t ch_enum);
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_is_same_band_channels() - Check if given channel numbers have same
* band
@@ -161,10 +246,10 @@ bool wlan_reg_is_same_band_channels(uint32_t chan_num1, uint32_t chan_num2);
#define WLAN_REG_IS_CHANNEL_VALID_5G_SBS(curchan, newchan) \
wlan_reg_is_channel_valid_5g_sbs(curchan, newchan)
bool wlan_reg_is_channel_valid_5g_sbs(uint32_t curchan, uint32_t newchan);
#endif /* CONFIG_CHAN_NUM_API */
#define WLAN_REG_INVALID_CHANNEL_ID
#define WLAN_REG_GET_24_END_CHAN_NUM 14
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_chan_to_band() - Get band from channel number
* @chan_num: channel number
@@ -183,7 +268,7 @@ enum band_info wlan_reg_chan_to_band(uint32_t chan_num);
QDF_STATUS wlan_reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev,
struct channel_power *ch_list,
uint8_t *num_chan);
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_read_default_country() - Read the default country for the regdomain
* @country: pointer to the country code.
@@ -213,6 +298,7 @@ bool wlan_reg_get_fcc_constraint(struct wlan_objmgr_pdev *pdev, uint32_t freq);
QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc,
uint8_t *country);
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_chan_has_dfs_attribute() - check channel has dfs attribute flag
* @ch: channel number.
@@ -233,6 +319,20 @@ wlan_reg_chan_has_dfs_attribute(struct wlan_objmgr_pdev *pdev, uint32_t ch);
*/
bool wlan_reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev,
uint8_t chan_num);
#endif /* CONFIG_CHAN_NUM_API */
#ifdef CONFIG_CHAN_FREQ_API
/**
* wlan_reg_is_etsi13_srd_chan_for_freq () - Checks if the ch is ETSI13 srd ch
* or not
* @pdev: pdev ptr
* @freq: channel center frequency
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_srd_chan_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq);
#endif /*CONFIG_CHAN_FREQ_API*/
/**
* wlan_reg_is_etsi13_regdmn() - Checks if current reg domain is ETSI13 or not
@@ -262,6 +362,7 @@ bool wlan_reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev
*/
bool wlan_reg_is_world(uint8_t *country);
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_get_chan_enum() - Get channel enum for given channel number
* @chan_num: Channel number
@@ -316,7 +417,7 @@ enum channel_state wlan_reg_get_2g_bonded_channel_state(
void wlan_reg_set_channel_params(struct wlan_objmgr_pdev *pdev, uint8_t ch,
uint8_t sec_ch_2g,
struct ch_params *ch_params);
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_get_dfs_region () - Get the current dfs region
* @dfs_reg: pointer to dfs region
@@ -326,9 +427,10 @@ void wlan_reg_set_channel_params(struct wlan_objmgr_pdev *pdev, uint8_t ch,
QDF_STATUS wlan_reg_get_dfs_region(struct wlan_objmgr_pdev *pdev,
enum dfs_reg *dfs_reg);
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_get_channel_reg_power() - Provide the channel regulatory power
* @chan_num: chennal number
* @chan_num: channel number
*
* Return: int
*/
@@ -337,12 +439,13 @@ uint32_t wlan_reg_get_channel_reg_power(struct wlan_objmgr_pdev *pdev,
/**
* wlan_reg_get_channel_freq() - provide the channel center freq
* @chan_num: chennal number
* @chan_num: channel number
*
* Return: int
*/
uint32_t wlan_reg_get_channel_freq(struct wlan_objmgr_pdev *pdev,
uint32_t chan_num);
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_get_current_chan_list() - provide the pdev current channel list
@@ -353,6 +456,8 @@ uint32_t wlan_reg_get_channel_freq(struct wlan_objmgr_pdev *pdev,
*/
QDF_STATUS wlan_reg_get_current_chan_list(struct wlan_objmgr_pdev *pdev,
struct regulatory_channel *chan_list);
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_get_bonded_channel_state() - get bonded channel state
* @pdev: pdev ptr
@@ -365,6 +470,7 @@ QDF_STATUS wlan_reg_get_current_chan_list(struct wlan_objmgr_pdev *pdev,
enum channel_state wlan_reg_get_bonded_channel_state(
struct wlan_objmgr_pdev *pdev, uint8_t ch,
enum phy_ch_width bw, uint8_t sec_ch);
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_set_dfs_region() - set the dfs region
@@ -496,6 +602,7 @@ QDF_STATUS regulatory_pdev_open(struct wlan_objmgr_pdev *pdev);
*/
QDF_STATUS regulatory_pdev_close(struct wlan_objmgr_pdev *pdev);
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_update_nol_ch () - set nol channel
* @pdev: pdev ptr
@@ -547,6 +654,7 @@ bool wlan_reg_is_passive_or_disable_ch(struct wlan_objmgr_pdev *pdev,
* Return: true or false
*/
bool wlan_reg_is_disable_ch(struct wlan_objmgr_pdev *pdev, uint32_t chan);
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_freq_to_chan () - convert channel freq to channel number
@@ -575,6 +683,7 @@ uint32_t wlan_reg_chan_to_freq(struct wlan_objmgr_pdev *pdev,
*/
bool wlan_reg_is_us(uint8_t *country);
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_chan_is_49ghz() - Check if the input channel number is 4.9GHz
* @pdev: Pdev pointer
@@ -582,9 +691,9 @@ bool wlan_reg_is_us(uint8_t *country);
*
* Return: true if the channel is 4.9GHz else false.
*/
bool wlan_reg_chan_is_49ghz(struct wlan_objmgr_pdev *pdev,
uint8_t chan_num);
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_set_country() - Set the current regulatory country
@@ -693,6 +802,7 @@ wlan_reg_get_tx_ops(struct wlan_objmgr_psoc *psoc);
QDF_STATUS wlan_reg_get_curr_regdomain(struct wlan_objmgr_pdev *pdev,
struct cur_regdmn_info *cur_regdmn);
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_update_nol_history_ch() - Set nol-history flag for the channels in
* the list.
@@ -708,7 +818,7 @@ void wlan_reg_update_nol_history_ch(struct wlan_objmgr_pdev *pdev,
uint8_t *ch_list,
uint8_t num_ch,
bool nol_history_ch);
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_is_regdmn_en302502_applicable() - Find if ETSI EN302_502 radar
* pattern is applicable in the current regulatory domain.
@@ -728,4 +838,191 @@ bool wlan_reg_is_regdmn_en302502_applicable(struct wlan_objmgr_pdev *pdev);
* Return : QDF_STATUS
*/
QDF_STATUS wlan_reg_modify_pdev_chan_range(struct wlan_objmgr_pdev *pdev);
#ifdef CONFIG_CHAN_FREQ_API
/**
* wlan_reg_is_same_band_freqs() - Check if two channel frequencies
* have same band
* @freq1: Frequency 1
* @freq2: Frequency 2
*
* Return: true if both the channel frequency has the same band.
*/
#define WLAN_REG_IS_SAME_BAND_FREQS(freq1, freq2) \
wlan_reg_is_same_band_freqs(freq1, freq2)
bool wlan_reg_is_same_band_freqs(uint16_t freq1, uint16_t freq2);
/**
* wlan_reg_get_chan_enum_for_freq() - Get channel enum for given channel center
* frequency
* @freq: Channel center frequency
*
* Return: Channel enum
*/
enum channel_enum wlan_reg_get_chan_enum_for_freq(uint16_t freq);
/**
* wlan_reg_update_nol_history_ch_for_freq() - Set nol-history flag for the
* channels in the list.
*
* @pdev: Pdev ptr
* @ch_list: Input channel list.
* @num_ch: Number of channels.
* @nol_history_ch: Nol history value.
*
* Return: void
*/
void wlan_reg_update_nol_history_ch_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t *ch_list,
uint8_t num_ch,
bool nol_history_ch);
/**
* wlan_reg_is_frequency_valid_5g_sbs() Check if the given frequency is 5G SBS.
* @curfreq: current channel center frequency
* @newfreq:new channel center frequency
*
* Return: true if the given frequency is a valid 5G SBS
*/
#define WLAN_REG_IS_FREQUENCY_VALID_5G_SBS(curfreq, newfreq) \
wlan_reg_is_frequency_valid_5g_sbs(curfreq, newfreq)
bool wlan_reg_is_frequency_valid_5g_sbs(uint16_t curfreq, uint16_t newfreq);
/**
* wlan_reg_chan_has_dfs_attribute_for_freq() - check channel has dfs
* attribute flag
* @freq: channel center frequency.
*
* This API get chan initial dfs attribute from regdomain
*
* Return: true if chan is dfs, otherwise false
*/
bool
wlan_reg_chan_has_dfs_attribute_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq);
/**
* wlan_reg_get_channel_list_with_power_for_freq() - Provide the channel list
* with power
* @ch_list: pointer to the channel list.
*
* Return: QDF_STATUS
*/
QDF_STATUS
wlan_reg_get_channel_list_with_power_for_freq(struct wlan_objmgr_pdev *pdev,
struct channel_power *ch_list,
uint8_t *num_chan);
/**
* wlan_reg_get_5g_bonded_channel_state_for_freq() - Get 5G bonded channel state
* @pdev: The physical dev to program country code or regdomain
* @freq: channel frequency.
* @bw: channel band width
*
* Return: channel state
*/
enum channel_state
wlan_reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width bw);
/**
* wlan_reg_get_2g_bonded_channel_state_for_freq() - Get 2G bonded channel state
* @pdev: The physical dev to program country code or regdomain
* @freq: channel center frequency.
* @sec_ch_freq: Secondary channel center frequency.
* @bw: channel band width
*
* Return: channel state
*/
enum channel_state
wlan_reg_get_2g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
uint16_t sec_ch_freq,
enum phy_ch_width bw);
/**
* wlan_reg_get_channel_state_for_freq() - Get channel state from regulatory
* @pdev: Pointer to pdev
* @freq: channel center frequency.
*
* Return: channel state
*/
enum channel_state
wlan_reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq);
/**
* wlan_reg_set_channel_params_for_freq () - Sets channel parameteres for
* given bandwidth
* @pdev: The physical dev to program country code or regdomain
* @freq: channel center frequency.
* @sec_ch_2g_freq: Secondary channel center frequency.
* @ch_params: pointer to the channel parameters.
*
* Return: None
*/
void wlan_reg_set_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
uint16_t sec_ch_2g_freq,
struct ch_params *ch_params);
/**
* wlan_reg_get_channel_cfreq_reg_power_for_freq() - Provide the channel
* regulatory power
* @freq: channel center frequency
*
* Return: int
*/
uint32_t wlan_reg_get_channel_reg_power_for_freq(struct wlan_objmgr_pdev *pdev,
uint32_t freq);
/**
* wlan_reg_update_nol_ch_for_freq () - set nol channel
* @pdev: pdev ptr
* @ch_list: channel list to be returned
* @num_ch: number of channels
* @nol_ch: nol flag
*
* Return: void
*/
void wlan_reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t *ch_list,
uint8_t num_ch,
bool nol_ch);
/**
* wlan_reg_is_dfs_freq () - Checks the channel state for DFS
* @freq: Channel center frequency
*
* Return: true or false
*/
bool wlan_reg_is_dfs_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq);
/**
* wlan_reg_is_dsrc_freq () - Checks if the channel is dsrc channel or not
* @freq: Channel center frequency
*
* Return: true or false
*/
bool wlan_reg_is_dsrc_freq(uint16_t freq);
/**
* wlan_reg_is_passive_or_disable_for_freq () - Checks chan state for passive
* and disabled
* @pdev: pdev ptr
* @freq: Channel center frequency
*
* Return: true or false
*/
bool wlan_reg_is_passive_or_disable_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq);
/**
* wlan_reg_is_disable_for_freq () - Checks chan state for disabled
* @pdev: pdev ptr
* @freq: Channel center frequency
*
* Return: true or false
*/
bool wlan_reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq);
#endif /*CONFIG_CHAN_FREQ_API */
#endif

Ver ficheiro

@@ -66,7 +66,7 @@ QDF_STATUS ucfg_reg_notify_sap_event(struct wlan_objmgr_pdev *pdev,
*
* Return: QDF_STATUS
*/
#ifdef DISABLE_CHANNEL_LIST
#if defined(DISABLE_CHANNEL_LIST) && defined(CONFIG_CHAN_NUM_API)
void ucfg_reg_cache_channel_state(struct wlan_objmgr_pdev *pdev,
uint32_t *channel_list,
uint32_t num_channels);
@@ -77,7 +77,29 @@ void ucfg_reg_cache_channel_state(struct wlan_objmgr_pdev *pdev,
uint32_t num_channels)
{
}
#endif
#endif /* CONFIG_CHAN_NUM_API */
/**
* ucfg_reg_cache_channel_freq_state() - Cache the current state of the
* channels based on the channel center frequency.
* @pdev: Pointer to pdev.
* @channel_list: List of the channels for which states need to be cached.
* @num_channels: Number of channels in the list.
*
* Return: QDF_STATUS
*/
#if defined(DISABLE_CHANNEL_LIST) && defined(CONFIG_CHAN_FREQ_API)
void ucfg_reg_cache_channel_freq_state(struct wlan_objmgr_pdev *pdev,
uint32_t *channel_list,
uint32_t num_channels);
#else
static inline
void ucfg_reg_cache_channel_freq_state(struct wlan_objmgr_pdev *pdev,
uint32_t *channel_list,
uint32_t num_channels)
{
}
#endif /* CONFIG_CHAN_FREQ_API */
/**
* ucfg_reg_restore_cached_channels() - Cache the current state of the channles

Ver ficheiro

@@ -41,6 +41,7 @@
#include <../../core/src/reg_offload_11d_scan.h>
#include <wlan_objmgr_global_obj.h>
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_get_channel_list_with_power() - Provide the channel list with power
* @ch_list: pointer to the channel list.
@@ -56,6 +57,7 @@ QDF_STATUS wlan_reg_get_channel_list_with_power(struct wlan_objmgr_pdev *pdev,
*/
return reg_get_channel_list_with_power(pdev, ch_list, num_chan);
}
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_read_default_country() - Read the default country for the regdomain
@@ -81,6 +83,7 @@ QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc,
return reg_read_current_country(psoc, country);
}
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_get_channel_state() - Get channel state from regulatory
* @ch: channel number.
@@ -153,6 +156,7 @@ void wlan_reg_set_channel_params(struct wlan_objmgr_pdev *pdev, uint8_t ch,
*/
reg_set_channel_params(pdev, ch, sec_ch_2g, ch_params);
}
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_get_dfs_region () - Get the current dfs region
@@ -171,6 +175,7 @@ QDF_STATUS wlan_reg_get_dfs_region(struct wlan_objmgr_pdev *pdev,
return QDF_STATUS_SUCCESS;
}
#ifdef CONFIG_CHAN_NUM_API
uint32_t wlan_reg_get_channel_reg_power(struct wlan_objmgr_pdev *pdev,
uint32_t chan_num)
{
@@ -188,6 +193,7 @@ uint32_t wlan_reg_get_channel_freq(struct wlan_objmgr_pdev *pdev,
{
return reg_get_channel_freq(pdev, chan_num);
}
#endif /* CONFIG_CHAN_NUM_API */
QDF_STATUS wlan_reg_get_current_chan_list(struct wlan_objmgr_pdev *pdev,
struct regulatory_channel *chan_list)
@@ -206,6 +212,7 @@ uint16_t wlan_reg_get_bw_value(enum phy_ch_width bw)
return reg_get_bw_value(bw);
}
#ifdef CONFIG_CHAN_NUM_API
/**
* wlan_reg_get_bonded_channel_state() - Get 2G bonded channel state
* @ch: channel number.
@@ -224,6 +231,7 @@ enum channel_state wlan_reg_get_bonded_channel_state(
return reg_get_5g_bonded_channel_state(pdev, ch,
bw);
}
#endif /* CONFIG_CHAN_NUM_API */
/**
* wlan_reg_set_dfs_region () - Get the current dfs region
@@ -444,6 +452,7 @@ QDF_STATUS regulatory_pdev_close(struct wlan_objmgr_pdev *pdev)
return QDF_STATUS_SUCCESS;
}
#ifdef CONFIG_CHAN_NUM_API
void wlan_reg_update_nol_ch(struct wlan_objmgr_pdev *pdev, uint8_t *ch_list,
uint8_t num_ch, bool nol_ch)
{
@@ -474,6 +483,7 @@ bool wlan_reg_is_disable_ch(struct wlan_objmgr_pdev *pdev,
{
return reg_is_disable_ch(pdev, chan);
}
#endif /* CONFIG_CHAN_NUM_API */
uint32_t wlan_reg_freq_to_chan(struct wlan_objmgr_pdev *pdev,
uint32_t freq)
@@ -487,11 +497,13 @@ uint32_t wlan_reg_chan_to_freq(struct wlan_objmgr_pdev *pdev,
return reg_chan_to_freq(pdev, chan_num);
}
#ifdef CONFIG_CHAN_NUM_API
bool wlan_reg_chan_is_49ghz(struct wlan_objmgr_pdev *pdev,
uint8_t chan_num)
{
return reg_chan_is_49ghz(pdev, chan_num);
}
#endif /* CONFIG_CHAN_NUM_API */
QDF_STATUS wlan_reg_set_country(struct wlan_objmgr_pdev *pdev,
uint8_t *country)
@@ -540,6 +552,7 @@ bool wlan_reg_11d_enabled_on_host(struct wlan_objmgr_psoc *psoc)
return reg_11d_enabled_on_host(psoc);
}
#ifdef CONFIG_CHAN_NUM_API
bool wlan_reg_is_dsrc_chan(struct wlan_objmgr_pdev *pdev, uint8_t chan_num)
{
return reg_is_dsrc_chan(pdev, chan_num);
@@ -550,6 +563,7 @@ bool wlan_reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev,
{
return reg_is_etsi13_srd_chan(pdev, chan_num);
}
#endif /* CONFIG_CHAN_NUM_API */
bool wlan_reg_is_etsi13_regdmn(struct wlan_objmgr_pdev *pdev)
{
@@ -626,6 +640,7 @@ QDF_STATUS wlan_reg_get_curr_regdomain(struct wlan_objmgr_pdev *pdev,
return reg_get_curr_regdomain(pdev, cur_regdmn);
}
#ifdef CONFIG_CHAN_NUM_API
uint32_t wlan_reg_min_24ghz_ch_num(void)
{
return reg_min_24ghz_ch_num();
@@ -645,7 +660,31 @@ uint32_t wlan_reg_max_5ghz_ch_num(void)
{
return reg_max_5ghz_ch_num();
}
#endif /* CONFIG_CHAN_NUM_API */
#ifdef CONFIG_CHAN_FREQ_API
uint16_t wlan_reg_min_24ghz_chan_freq(void)
{
return reg_min_24ghz_chan_freq();
}
uint16_t wlan_reg_max_24ghz_chan_freq(void)
{
return reg_max_24ghz_chan_freq();
}
uint16_t wlan_reg_min_5ghz_chan_freq(void)
{
return reg_min_5ghz_chan_freq();
}
uint16_t wlan_reg_max_5ghz_chan_freq(void)
{
return reg_max_5ghz_chan_freq();
}
#endif /* CONFIG_CHAN_FREQ_API */
#ifdef CONFIG_CHAN_NUM_API
bool wlan_reg_is_24ghz_ch(uint32_t chan)
{
return reg_is_24ghz_ch(chan);
@@ -655,6 +694,7 @@ bool wlan_reg_is_5ghz_ch(uint32_t chan)
{
return reg_is_5ghz_ch(chan);
}
#endif /* CONFIG_CHAN_NUM_API */
bool wlan_reg_is_24ghz_ch_freq(uint32_t freq)
{
@@ -671,7 +711,23 @@ bool wlan_reg_is_6ghz_chan_freq(uint16_t freq)
{
return reg_is_6ghz_chan_freq(freq);
}
#endif
uint16_t wlan_reg_min_6ghz_chan_freq(void)
{
return reg_min_6ghz_chan_freq();
}
uint16_t wlan_reg_max_6ghz_chan_freq(void)
{
return reg_max_6ghz_chan_freq();
}
bool wlan_reg_is_6ghz_psc_chan_freq(uint16_t freq)
{
return reg_is_6ghz_psc_chan_freq(freq);
}
#endif /* CONFIG_BAND_6GHZ */
bool wlan_reg_is_49ghz_freq(uint32_t freq)
{
return reg_is_49ghz_freq(freq);
@@ -687,6 +743,7 @@ uint32_t wlan_reg_ch_to_freq(uint32_t ch_enum)
return reg_ch_to_freq(ch_enum);
}
#ifdef CONFIG_CHAN_NUM_API
bool wlan_reg_is_same_band_channels(uint32_t chan_num1, uint32_t chan_num2)
{
return reg_is_same_band_channels(chan_num1, chan_num2);
@@ -712,6 +769,7 @@ enum channel_enum wlan_reg_get_chan_enum(uint32_t chan_num)
{
return reg_get_chan_enum(chan_num);
}
#endif /* CONFIG_CHAN_NUM_API */
bool wlan_reg_is_regdmn_en302502_applicable(struct wlan_objmgr_pdev *pdev)
{
@@ -728,3 +786,124 @@ QDF_STATUS wlan_reg_modify_pdev_chan_range(struct wlan_objmgr_pdev *pdev)
{
return reg_modify_pdev_chan_range(pdev);
}
#ifdef CONFIG_CHAN_FREQ_API
bool wlan_reg_is_same_band_freqs(uint16_t freq1, uint16_t freq2)
{
return reg_is_same_band_freqs(freq1, freq2);
}
bool wlan_reg_is_frequency_valid_5g_sbs(uint16_t curfreq, uint16_t newfreq)
{
return reg_is_frequency_valid_5g_sbs(curfreq, newfreq);
}
enum channel_enum wlan_reg_get_chan_enum_for_freq(uint16_t freq)
{
return reg_get_chan_enum_for_freq(freq);
}
bool wlan_reg_is_etsi13_srd_chan_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq)
{
return reg_is_etsi13_srd_chan_for_freq(pdev, freq);
}
bool wlan_reg_is_dsrc_freq(uint16_t freq)
{
return reg_is_dsrc_freq(freq);
}
void wlan_reg_update_nol_ch_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t *ch_list,
uint8_t num_ch,
bool nol_ch)
{
reg_update_nol_ch_for_freq(pdev, ch_list, num_ch, nol_ch);
}
void wlan_reg_update_nol_history_ch_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t *ch_list,
uint8_t num_ch,
bool nol_history_ch)
{
reg_update_nol_history_ch_for_freq(pdev,
ch_list,
num_ch,
nol_history_ch);
}
bool wlan_reg_is_dfs_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq)
{
return reg_is_dfs_for_freq(pdev, freq);
}
bool wlan_reg_is_passive_or_disable_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq)
{
return reg_is_passive_or_disable_for_freq(pdev, freq);
}
bool wlan_reg_is_disable_for_freq(struct wlan_objmgr_pdev *pdev, uint16_t freq)
{
return reg_is_disable_for_freq(pdev, freq);
}
QDF_STATUS
wlan_reg_get_channel_list_with_power_for_freq(struct wlan_objmgr_pdev *pdev,
struct channel_power *ch_list,
uint8_t *num_chan)
{
return reg_get_channel_list_with_power_for_freq(pdev,
ch_list,
num_chan);
}
bool
wlan_reg_chan_has_dfs_attribute_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq)
{
return reg_chan_has_dfs_attribute_for_freq(pdev, freq);
}
enum channel_state
wlan_reg_get_5g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
enum phy_ch_width bw)
{
return reg_get_5g_bonded_channel_state_for_freq(pdev, freq, bw);
}
enum channel_state
wlan_reg_get_2g_bonded_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
uint16_t sec_ch_freq,
enum phy_ch_width bw)
{
return reg_get_2g_bonded_channel_state_for_freq(pdev,
freq,
sec_ch_freq,
bw);
}
void wlan_reg_set_channel_params_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq,
uint16_t sec_ch_2g_freq,
struct ch_params *ch_params)
{
reg_set_channel_params_for_freq(pdev, freq, sec_ch_2g_freq, ch_params);
}
enum channel_state
wlan_reg_get_channel_state_for_freq(struct wlan_objmgr_pdev *pdev,
uint16_t freq)
{
return reg_get_channel_state_for_freq(pdev, freq);
}
uint32_t wlan_reg_get_channel_reg_power_for_freq(struct wlan_objmgr_pdev *pdev,
uint32_t freq)
{
return reg_get_channel_reg_power_for_freq(pdev, freq);
}
#endif /* CONFIG CHAN FREQ API */

Ver ficheiro

@@ -287,6 +287,24 @@ QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
qdf_export_symbol(ucfg_reg_set_hal_reg_cap);
#ifdef DISABLE_CHANNEL_LIST
#ifdef CONFIG_CHAN_FREQ_API
/**
* ucfg_reg_cache_channel_freq_state() - Cache the current state of the channels
* based of the channel center frequency.
* @pdev: The physical dev to cache the channels for
* @channel_list: List of the channels for which states needs to be cached
* @num_channels: Number of channels in the list
*
*/
void ucfg_reg_cache_channel_freq_state(struct wlan_objmgr_pdev *pdev,
uint32_t *channel_list,
uint32_t num_channels)
{
reg_cache_channel_freq_state(pdev, channel_list, num_channels);
}
#endif /* CONFIG_CHAN_FREQ_API */
#ifdef CONFIG_CHAN_NUM_API
/**
* ucfg_reg_cache_channel_state() - Cache the current state of the channles
* @pdev: The physical dev to cache the channels for
@@ -299,6 +317,7 @@ void ucfg_reg_cache_channel_state(struct wlan_objmgr_pdev *pdev,
{
reg_cache_channel_state(pdev, channel_list, num_channels);
}
#endif /* CONFIG_CHAN_NUM_API */
/**
* ucfg_reg_restore_cached_channels() - Cache the current state of the channles