mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 21:19:04 -04:00
qcacmn: Disable indoor channel on sap start
There are scenario where indoor channel operations (like active / passive scan/connect/roam etc) are not desired / permitted specially in sap case. Hence add support of disabling indoor channel on sap start and revert it on sap stop. Change-Id: Id6e01534532e3076a3e662e6a4f71e8be924165a CRs-fixed: 2161319
This commit is contained in:
parent
42398afc08
commit
c42f0c13b7
7 changed files with 124 additions and 15 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ struct wlan_regulatory_psoc_priv_obj {
|
|||
enum restart_beaconing_on_ch_avoid_rule restart_beaconing;
|
||||
struct wlan_psoc_host_hal_reg_capabilities_ext
|
||||
reg_cap[PSOC_MAX_PHY_REG_CAP];
|
||||
bool force_ssc_disable_indoor_channel;
|
||||
qdf_spinlock_t cbk_list_lock;
|
||||
};
|
||||
|
||||
|
|
@ -105,6 +106,8 @@ struct wlan_regulatory_pdev_priv_obj {
|
|||
bool en_chan_144;
|
||||
uint32_t wireless_modes;
|
||||
struct ch_avoid_ind_type freq_avoid_list;
|
||||
bool force_ssc_disable_indoor_channel;
|
||||
bool sap_state;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2024,23 +2024,48 @@ static void reg_modify_chan_list_for_dfs_channels(struct regulatory_channel
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void reg_modify_chan_list_for_indoor_channels(struct regulatory_channel
|
||||
*chan_list, bool
|
||||
indoor_chan_enabled)
|
||||
static void reg_modify_chan_list_for_indoor_channels(
|
||||
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
|
||||
{
|
||||
enum channel_enum chan_enum;
|
||||
struct regulatory_channel *chan_list = pdev_priv_obj->cur_chan_list;
|
||||
|
||||
if (indoor_chan_enabled)
|
||||
if (pdev_priv_obj->indoor_chan_enabled)
|
||||
return;
|
||||
|
||||
for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
|
||||
if (REGULATORY_CHAN_INDOOR_ONLY &
|
||||
chan_list[chan_enum].chan_flags) {
|
||||
chan_list[chan_enum].state =
|
||||
CHANNEL_STATE_DISABLE;
|
||||
chan_list[chan_enum].chan_flags |=
|
||||
REGULATORY_CHAN_DISABLED;
|
||||
if (!pdev_priv_obj->force_ssc_disable_indoor_channel) {
|
||||
for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
|
||||
if (REGULATORY_CHAN_INDOOR_ONLY &
|
||||
chan_list[chan_enum].chan_flags) {
|
||||
chan_list[chan_enum].state =
|
||||
CHANNEL_STATE_DISABLE;
|
||||
chan_list[chan_enum].chan_flags |=
|
||||
REGULATORY_CHAN_DISABLED;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
|
||||
|
||||
if (pdev_priv_obj->sap_state) {
|
||||
|
||||
if (REGULATORY_CHAN_INDOOR_ONLY &
|
||||
chan_list[chan_enum].chan_flags) {
|
||||
chan_list[chan_enum].state =
|
||||
CHANNEL_STATE_DISABLE;
|
||||
chan_list[chan_enum].chan_flags |=
|
||||
REGULATORY_CHAN_DISABLED;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (REGULATORY_CHAN_INDOOR_ONLY &
|
||||
chan_list[chan_enum].chan_flags) {
|
||||
chan_list[chan_enum].state =
|
||||
CHANNEL_STATE_DFS;
|
||||
chan_list[chan_enum].chan_flags |=
|
||||
REGULATORY_CHAN_NO_IR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2301,8 +2326,7 @@ static void reg_compute_pdev_current_chan_list(
|
|||
|
||||
reg_modify_chan_list_for_nol_list(pdev_priv_obj->cur_chan_list);
|
||||
|
||||
reg_modify_chan_list_for_indoor_channels(pdev_priv_obj->cur_chan_list,
|
||||
pdev_priv_obj->indoor_chan_enabled);
|
||||
reg_modify_chan_list_for_indoor_channels(pdev_priv_obj);
|
||||
|
||||
reg_modify_chan_list_for_fcc_channel(pdev_priv_obj->cur_chan_list,
|
||||
pdev_priv_obj->set_fcc_channel);
|
||||
|
|
@ -2873,6 +2897,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
|
|||
soc_reg_obj->band_capability = BAND_ALL;
|
||||
soc_reg_obj->enable_11d_supp = false;
|
||||
soc_reg_obj->indoor_chan_enabled = true;
|
||||
soc_reg_obj->force_ssc_disable_indoor_channel = false;
|
||||
soc_reg_obj->master_vdev_cnt = 0;
|
||||
soc_reg_obj->vdev_cnt_11d = 0;
|
||||
soc_reg_obj->restart_beaconing = CH_AVOID_RULE_RESTART;
|
||||
|
|
@ -2988,6 +3013,46 @@ QDF_STATUS reg_set_band(struct wlan_objmgr_pdev *pdev,
|
|||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS reg_notify_sap_event(struct wlan_objmgr_pdev *pdev,
|
||||
bool sap_state)
|
||||
{
|
||||
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
|
||||
struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
|
||||
pdev_priv_obj = reg_get_pdev_obj(pdev);
|
||||
|
||||
if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
|
||||
reg_err("pdev reg component is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc = wlan_pdev_get_psoc(pdev);
|
||||
if (!psoc) {
|
||||
reg_err("psoc is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc_priv_obj = reg_get_psoc_obj(psoc);
|
||||
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
|
||||
reg_err("psoc reg component is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
reg_info("sap_state: %d", sap_state);
|
||||
|
||||
if (pdev_priv_obj->sap_state == sap_state)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
pdev_priv_obj->sap_state = sap_state;
|
||||
|
||||
reg_compute_pdev_current_chan_list(pdev_priv_obj);
|
||||
status = reg_send_scheduler_msg_sb(psoc, pdev);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev,
|
||||
bool fcc_constraint)
|
||||
{
|
||||
|
|
@ -3122,6 +3187,8 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
|
|||
pdev_priv_obj->en_chan_144 = true;
|
||||
|
||||
reg_cap_ptr = psoc_priv_obj->reg_cap;
|
||||
pdev_priv_obj->force_ssc_disable_indoor_channel =
|
||||
psoc_priv_obj->force_ssc_disable_indoor_channel;
|
||||
|
||||
for (cnt = 0; cnt < PSOC_MAX_PHY_REG_CAP; cnt++) {
|
||||
if (reg_cap_ptr == NULL) {
|
||||
|
|
@ -3425,6 +3492,8 @@ static void reg_change_pdev_for_config(struct wlan_objmgr_psoc *psoc,
|
|||
psoc_priv_obj->dfs_enabled;
|
||||
pdev_priv_obj->indoor_chan_enabled =
|
||||
psoc_priv_obj->indoor_chan_enabled;
|
||||
pdev_priv_obj->force_ssc_disable_indoor_channel =
|
||||
psoc_priv_obj->force_ssc_disable_indoor_channel;
|
||||
pdev_priv_obj->band_capability = psoc_priv_obj->band_capability;
|
||||
|
||||
reg_compute_pdev_current_chan_list(pdev_priv_obj);
|
||||
|
|
@ -3457,6 +3526,8 @@ QDF_STATUS reg_set_config_vars(struct wlan_objmgr_psoc *psoc,
|
|||
config_vars.dfs_enabled;
|
||||
psoc_priv_obj->indoor_chan_enabled =
|
||||
config_vars.indoor_chan_enabled;
|
||||
psoc_priv_obj->force_ssc_disable_indoor_channel =
|
||||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -121,6 +121,15 @@ void reg_set_channel_params(struct wlan_objmgr_pdev *pdev,
|
|||
*/
|
||||
QDF_STATUS reg_set_band(struct wlan_objmgr_pdev *pdev, enum band_info band);
|
||||
|
||||
/**
|
||||
* reg_notify_sap_event() - Notify regulatory domain for sap event
|
||||
* @pdev: The physical dev to set the band for
|
||||
* @sap_state: true for sap start else false
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS reg_notify_sap_event(struct wlan_objmgr_pdev *pdev,
|
||||
bool sap_state);
|
||||
/**
|
||||
* reg_set_fcc_constraint() - Apply fcc constraints on channels 12/13
|
||||
* @pdev: The physical dev to set the band for
|
||||
|
|
|
|||
|
|
@ -772,6 +772,7 @@ enum restart_beaconing_on_ch_avoid_rule {
|
|||
* @band_capability: band capability
|
||||
* @dfs_disable: dfs disabled
|
||||
* @indoor_channel_support: indoor channel support
|
||||
* @force_ssc_disable_indoor_channel: Disable indoor channel on sap start
|
||||
* @restart_beaconing: control the beaconing entity to move
|
||||
* away from active LTE channels
|
||||
*/
|
||||
|
|
@ -782,6 +783,7 @@ struct reg_config_vars {
|
|||
enum band_info band_capability;
|
||||
uint32_t dfs_enabled;
|
||||
uint32_t indoor_chan_enabled;
|
||||
uint32_t force_ssc_disable_indoor_channel;
|
||||
enum restart_beaconing_on_ch_avoid_rule restart_beaconing;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,17 @@ typedef QDF_STATUS (*reg_event_cb)(void *status_struct);
|
|||
*/
|
||||
QDF_STATUS ucfg_reg_set_band(struct wlan_objmgr_pdev *pdev,
|
||||
enum band_info band);
|
||||
|
||||
/**
|
||||
* ucfg_reg_notify_sap_event() - Notify regulatory domain for sap event
|
||||
* @pdev: The physical dev to set the band for
|
||||
* @sap_state: true for sap start else false
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_reg_notify_sap_event(struct wlan_objmgr_pdev *pdev,
|
||||
bool sap_state);
|
||||
|
||||
/**
|
||||
* ucfg_reg_set_fcc_constraint() - apply fcc constraints on channels 12/13
|
||||
* @pdev: The physical pdev to reduce tx power for
|
||||
|
|
|
|||
|
|
@ -113,6 +113,19 @@ QDF_STATUS ucfg_reg_set_band(struct wlan_objmgr_pdev *pdev,
|
|||
return reg_set_band(pdev, band);
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_reg_notify_sap_event() - Notify regulatory domain for sap event
|
||||
* @pdev: The physical dev to set the band for
|
||||
* @sap_state: true for sap start else false
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_reg_notify_sap_event(struct wlan_objmgr_pdev *pdev,
|
||||
bool sap_state)
|
||||
{
|
||||
return reg_notify_sap_event(pdev, sap_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_reg_set_fcc_constraint() - apply fcc constraints on channels 12/13
|
||||
* @pdev: The physical pdev to reduce tx power for
|
||||
|
|
|
|||
Loading…
Reference in a new issue