qcacmn: Add support for SRD channels in ETSI domain

Add support for Short Range Devices 25 mW max power
channels in ETSI regulatory domain.

Add Short Range Devices 25 mW max power channels only
if DSRC feature is disabled.
Provide service apis to check SRD and DSRC channels.

Change-Id: Ib2a1d7cf191d07319cb29038ad60130f5cbe7f16
CRs-Fixed: 2264790
This commit is contained in:
Kiran Kumar Lokere
2018-05-15 15:48:57 -07:00
committato da nshrivas
parent 661ec9d74a
commit b49263bc0b
14 ha cambiato i file con 277 aggiunte e 46 eliminazioni

Vedi File

@@ -1148,3 +1148,8 @@ QDF_STATUS reg_get_default_country(uint16_t *default_country)
return QDF_STATUS_SUCCESS;
}
bool reg_etsi13_regdmn(uint8_t reg_dmn)
{
return reg_dmn == ETSI13;
}

Vedi File

@@ -156,4 +156,11 @@ QDF_STATUS reg_get_num_reg_dmn_pairs(int *num_reg_dmn);
QDF_STATUS reg_get_default_country(uint16_t *default_country);
/**
* reg_etsi13_regdmn () - Checks if the reg domain is ETSI13 or not
* @reg_dmn: reg domain
*
* Return: true or false
*/
bool reg_etsi13_regdmn(uint8_t reg_dmn);
#endif

Vedi File

@@ -80,6 +80,7 @@ struct wlan_regulatory_psoc_priv_obj {
struct wlan_psoc_host_hal_reg_capabilities_ext
reg_cap[PSOC_MAX_PHY_REG_CAP];
bool force_ssc_disable_indoor_channel;
bool enable_srd_chan_in_master_mode;
qdf_spinlock_t cbk_list_lock;
};

Vedi File

@@ -121,8 +121,10 @@ static const struct chan_map channel_map_old[NUM_CHANNELS] = {
[CHAN_ENUM_157] = {5785, 157, 2, 160},
[CHAN_ENUM_161] = {5805, 161, 2, 160},
[CHAN_ENUM_165] = {5825, 165, 2, 160},
#ifndef WLAN_FEATURE_DSRC
[CHAN_ENUM_169] = {5845, 169, 2, 20},
[CHAN_ENUM_173] = {5865, 173, 2, 20},
#else
[CHAN_ENUM_170] = {5852, 170, 2, 20},
[CHAN_ENUM_171] = {5855, 171, 2, 20},
[CHAN_ENUM_172] = {5860, 172, 2, 20},
@@ -138,6 +140,7 @@ static const struct chan_map channel_map_old[NUM_CHANNELS] = {
[CHAN_ENUM_182] = {5910, 182, 2, 20},
[CHAN_ENUM_183] = {5915, 183, 2, 20},
[CHAN_ENUM_184] = {5920, 184, 2, 20},
#endif
};
#else
@@ -1707,6 +1710,91 @@ bool reg_is_passive_or_disable_ch(struct wlan_objmgr_pdev *pdev,
(ch_state == CHANNEL_STATE_DISABLE);
}
#ifdef WLAN_FEATURE_DSRC
bool reg_is_dsrc_chan(struct wlan_objmgr_pdev *pdev, uint32_t chan)
{
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
uint32_t freq = 0;
pdev_priv_obj = reg_get_pdev_obj(pdev);
if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
reg_err("reg pdev priv obj is NULL");
return false;
}
if (!REG_IS_5GHZ_CH(chan))
return false;
freq = reg_chan_to_freq(pdev, chan);
if (!(freq >= REG_DSRC_START_FREQ && freq <= REG_DSRC_END_FREQ))
return false;
return true;
}
#else
bool reg_is_etsi13_regdmn(struct wlan_objmgr_pdev *pdev)
{
struct cur_regdmn_info cur_reg_dmn;
QDF_STATUS status;
status = reg_get_curr_regdomain(pdev, &cur_reg_dmn);
if (QDF_STATUS_SUCCESS != status) {
reg_err("Failed to get reg domain");
return false;
}
return reg_etsi13_regdmn(cur_reg_dmn.dmn_id_5g);
}
bool reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev, uint32_t chan)
{
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
uint32_t freq = 0;
pdev_priv_obj = reg_get_pdev_obj(pdev);
if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
reg_err("reg pdev priv obj is NULL");
return false;
}
if (!REG_IS_5GHZ_CH(chan))
return false;
freq = reg_chan_to_freq(pdev, chan);
if (!(freq >= REG_ETSI13_SRD_START_FREQ &&
freq <= REG_ETSI13_SRD_END_FREQ))
return false;
return reg_is_etsi13_regdmn(pdev);
}
bool reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc;
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
if (!pdev) {
reg_alert("pdev is NULL");
return true;
}
psoc = wlan_pdev_get_psoc(pdev);
psoc_priv_obj = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
reg_alert("psoc reg component is NULL");
return true;
}
return psoc_priv_obj->enable_srd_chan_in_master_mode &&
reg_is_etsi13_regdmn(pdev);
}
#endif
uint32_t reg_freq_to_chan(struct wlan_objmgr_pdev *pdev,
uint32_t freq)
@@ -3086,6 +3174,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
soc_reg_obj->master_vdev_cnt = 0;
soc_reg_obj->vdev_cnt_11d = 0;
soc_reg_obj->restart_beaconing = CH_AVOID_RULE_RESTART;
soc_reg_obj->enable_srd_chan_in_master_mode = false;
for (i = 0; i < MAX_STA_VDEV_CNT; i++)
soc_reg_obj->vdev_ids_11d[i] = INVALID_VDEV_ID;
@@ -3722,6 +3811,8 @@ QDF_STATUS reg_set_config_vars(struct wlan_objmgr_psoc *psoc,
config_vars.force_ssc_disable_indoor_channel;
psoc_priv_obj->band_capability = config_vars.band_capability;
psoc_priv_obj->restart_beaconing = config_vars.restart_beaconing;
psoc_priv_obj->enable_srd_chan_in_master_mode =
config_vars.enable_srd_chan_in_master_mode;
status = wlan_objmgr_psoc_try_get_ref(psoc, WLAN_REGULATORY_SB_ID);
if (QDF_IS_STATUS_ERROR(status)) {

Vedi File

@@ -40,8 +40,14 @@
#define REG_MAX_24GHZ_CH_NUM channel_map[MAX_24GHZ_CHANNEL].chan_num
#define REG_MIN_5GHZ_CH_NUM channel_map[MIN_5GHZ_CHANNEL].chan_num
#define REG_MAX_5GHZ_CH_NUM channel_map[MAX_5GHZ_CHANNEL].chan_num
#define REG_MIN_11P_CH_NUM channel_map[MIN_11P_CHANNEL].chan_num
#define REG_MAX_11P_CH_NUM channel_map[MAX_11P_CHANNEL].chan_num
#ifdef WLAN_FEATURE_DSRC
#define REG_DSRC_START_FREQ channel_map[MIN_DSRC_CHANNEL].center_freq
#define REG_DSRC_END_FREQ channel_map[MAX_DSRC_CHANNEL].center_freq
#endif
#define REG_ETSI13_SRD_START_FREQ 5745
#define REG_ETSI13_SRD_END_FREQ 5865
#define REG_IS_24GHZ_CH(chan_num) \
((chan_num >= REG_MIN_24GHZ_CH_NUM) && \
@@ -67,10 +73,6 @@
((chan_num >= REG_MIN_5GHZ_CH_NUM) && \
(chan_num <= REG_MAX_5GHZ_CH_NUM))
#define REG_IS_11P_CH(chan_num) \
((chan_num >= REG_MIN_11P_CH_NUM) && \
(chan_num <= REG_MAX_11P_CH_NUM))
#define REG_IS_5GHZ_FREQ(freq) \
((freq >= channel_map[MIN_5GHZ_CHANNEL].center_freq) && \
(freq <= channel_map[MAX_5GHZ_CHANNEL].center_freq))
@@ -308,6 +310,67 @@ void reg_update_nol_ch(struct wlan_objmgr_pdev *pdev, uint8_t *ch_list,
*/
bool reg_is_dfs_ch(struct wlan_objmgr_pdev *pdev, uint32_t chan);
#ifdef WLAN_FEATURE_DSRC
/**
* reg_is_dsrc_chan () - Checks the channel for DSRC or not
* @chan: channel
* @pdev: pdev ptr
*
* Return: true or false
*/
bool reg_is_dsrc_chan(struct wlan_objmgr_pdev *pdev, uint32_t chan);
static inline bool reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev,
uint32_t chan)
{
return false;
}
static inline bool reg_is_etsi13_regdmn(struct wlan_objmgr_pdev *pdev)
{
return false;
}
static inline bool
reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev *pdev)
{
return true;
}
#else
/**
* reg_is_etsi13_regdmn () - Checks if the current reg domain is ETSI13 or not
* @pdev: pdev ptr
*
* Return: true or false
*/
bool reg_is_etsi13_regdmn(struct wlan_objmgr_pdev *pdev);
/**
* reg_is_etsi13_srd_chan () - Checks the channel for ETSI13 srd ch or not
* @chan: channel
* @pdev: pdev ptr
*
* Return: true or false
*/
bool reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev, uint32_t chan);
/**
* reg_is_etsi13_srd_chan_allowed_master_mode() - Checks if regdmn is ETSI13
* and SRD channels are allowed in master mode or not.
*
* @pdev: pdev ptr
*
* Return: true or false
*/
bool reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev *pdev);
static inline bool reg_is_dsrc_chan(struct wlan_objmgr_pdev *pdev,
uint32_t chan)
{
return false;
}
#endif
bool reg_is_passive_or_disable_ch(struct wlan_objmgr_pdev *pdev,
uint32_t chan);

Vedi File

@@ -146,8 +146,10 @@ enum channel_enum {
CHAN_ENUM_157,
CHAN_ENUM_161,
CHAN_ENUM_165,
#ifndef WLAN_FEATURE_DSRC
CHAN_ENUM_169,
CHAN_ENUM_173,
#else
CHAN_ENUM_170,
CHAN_ENUM_171,
CHAN_ENUM_172,
@@ -163,6 +165,7 @@ enum channel_enum {
CHAN_ENUM_182,
CHAN_ENUM_183,
CHAN_ENUM_184,
#endif
NUM_CHANNELS,
@@ -175,12 +178,18 @@ enum channel_enum {
NUM_49GHZ_CHANNELS = MAX_49GHZ_CHANNEL - MIN_49GHZ_CHANNEL + 1,
MIN_5GHZ_CHANNEL = CHAN_ENUM_36,
#ifndef WLAN_FEATURE_DSRC
MAX_5GHZ_CHANNEL = CHAN_ENUM_173,
#else
MAX_5GHZ_CHANNEL = CHAN_ENUM_184,
#endif
NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1),
MIN_11P_CHANNEL = CHAN_ENUM_170,
MAX_11P_CHANNEL = CHAN_ENUM_184,
NUM_11P_CHANNELS = (MAX_11P_CHANNEL - MIN_11P_CHANNEL + 1),
#ifdef WLAN_FEATURE_DSRC
MIN_DSRC_CHANNEL = CHAN_ENUM_170,
MAX_DSRC_CHANNEL = CHAN_ENUM_184,
NUM_DSRC_CHANNELS = (MAX_DSRC_CHANNEL - MIN_DSRC_CHANNEL + 1),
#endif
INVALID_CHANNEL = 0xBAD,
};
@@ -402,9 +411,9 @@ enum channel_enum {
MAX_5GHZ_CHANNEL = CHAN_ENUM_5920,
NUM_5GHZ_CHANNELS = (MAX_5GHZ_CHANNEL - MIN_5GHZ_CHANNEL + 1),
MIN_11P_CHANNEL = CHAN_ENUM_5850,
MAX_11P_CHANNEL = CHAN_ENUM_5920,
NUM_11P_CHANNELS = (MAX_11P_CHANNEL - MIN_11P_CHANNEL + 1),
MIN_DSRC_CHANNEL = CHAN_ENUM_5850,
MAX_DSRC_CHANNEL = CHAN_ENUM_5920,
NUM_DSRC_CHANNELS = (MAX_DSRC_CHANNEL - MIN_DSRC_CHANNEL + 1),
INVALID_CHANNEL = 0xBAD,
};
@@ -789,6 +798,7 @@ enum restart_beaconing_on_ch_avoid_rule {
* @force_ssc_disable_indoor_channel: Disable indoor channel on sap start
* @restart_beaconing: control the beaconing entity to move
* away from active LTE channels
* @enable_srd_chan_in_master_mode: SRD channel support in master mode
*/
struct reg_config_vars {
uint32_t enable_11d_support;
@@ -799,6 +809,7 @@ struct reg_config_vars {
uint32_t indoor_chan_enabled;
uint32_t force_ssc_disable_indoor_channel;
enum restart_beaconing_on_ch_avoid_rule restart_beaconing;
bool enable_srd_chan_in_master_mode;
};
/**

Vedi File

@@ -34,12 +34,9 @@
#define WLAN_REG_MAX_24GHZ_CH_NUM REG_MAX_24GHZ_CH_NUM
#define WLAN_REG_MIN_5GHZ_CH_NUM REG_MIN_5GHZ_CH_NUM
#define WLAN_REG_MAX_5GHZ_CH_NUM REG_MAX_5GHZ_CH_NUM
#define WLAN_REG_MIN_11P_CH_NUM REG_MIN_11P_CH_NUM
#define WLAN_REG_MAX_11P_CH_NUM REG_MAX_11P_CH_NUM
#define WLAN_REG_IS_24GHZ_CH(chan) REG_IS_24GHZ_CH(chan)
#define WLAN_REG_IS_5GHZ_CH(chan) REG_IS_5GHZ_CH(chan)
#define WLAN_REG_IS_11P_CH(chan) REG_IS_11P_CH(chan)
#define WLAN_REG_IS_24GHZ_CH_FREQ(freq) REG_IS_24GHZ_CH_FREQ(freq)
@@ -336,6 +333,44 @@ void wlan_reg_update_nol_ch(struct wlan_objmgr_pdev *pdev,
*/
bool wlan_reg_is_dfs_ch(struct wlan_objmgr_pdev *pdev, uint32_t chan);
/**
* wlan_reg_is_dsrc_chan () - Checks if the channel is dsrc channel or not
* @pdev: pdev ptr
* @chan_num: channel
*
* Return: true or false
*/
bool wlan_reg_is_dsrc_chan(struct wlan_objmgr_pdev *pdev, uint8_t chan_num);
/**
* wlan_reg_is_etsi13_srd_chan () - Checks if the ch is ETSI13 srd ch or not
* @pdev: pdev ptr
* @chan_num: channel
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev,
uint8_t chan_num);
/**
* wlan_reg_is_etsi13_regdmn() - Checks if current reg domain is ETSI13 or not
* @pdev: pdev ptr
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_regdmn(struct wlan_objmgr_pdev *pdev);
/**
* wlan_reg_is_etsi13_srd_chan_allowed_master_mode() - Checks if regdmn is
* ETSI13 and SRD channels are allowed in master mode or not.
*
* @pdev: pdev ptr
*
* Return: true or false
*/
bool wlan_reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev
*pdev);
/**
* wlan_reg_is_passive_or_disable_ch () - Checks chan state for passive
* and disabled

Vedi File

@@ -508,6 +508,28 @@ bool wlan_reg_11d_enabled_on_host(struct wlan_objmgr_psoc *psoc)
return reg_11d_enabled_on_host(psoc);
}
bool wlan_reg_is_dsrc_chan(struct wlan_objmgr_pdev *pdev, uint8_t chan_num)
{
return reg_is_dsrc_chan(pdev, chan_num);
}
bool wlan_reg_is_etsi13_srd_chan(struct wlan_objmgr_pdev *pdev,
uint8_t chan_num)
{
return reg_is_etsi13_srd_chan(pdev, chan_num);
}
bool wlan_reg_is_etsi13_regdmn(struct wlan_objmgr_pdev *pdev)
{
return reg_is_etsi13_regdmn(pdev);
}
bool wlan_reg_is_etsi13_srd_chan_allowed_master_mode(struct wlan_objmgr_pdev
*pdev)
{
return reg_is_etsi13_srd_chan_allowed_master_mode(pdev);
}
QDF_STATUS wlan_reg_get_chip_mode(struct wlan_objmgr_pdev *pdev,
uint32_t *chip_mode)
{