diff --git a/os_if/linux/wifi_pos/src/os_if_wifi_pos.c b/os_if/linux/wifi_pos/src/os_if_wifi_pos.c index a73591f4cfb6..1c75ce709a2c 100644 --- a/os_if/linux/wifi_pos/src/os_if_wifi_pos.c +++ b/os_if/linux/wifi_pos/src/os_if_wifi_pos.c @@ -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. * diff --git a/umac/regulatory/core/src/reg_priv.h b/umac/regulatory/core/src/reg_priv.h index fd6a48235a18..0dd737f1933d 100644 --- a/umac/regulatory/core/src/reg_priv.h +++ b/umac/regulatory/core/src/reg_priv.h @@ -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 diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index e4574b496e70..cfe550b2c577 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -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; diff --git a/umac/regulatory/core/src/reg_services.h b/umac/regulatory/core/src/reg_services.h index afa867b8fc53..41c1f4b47bfd 100644 --- a/umac/regulatory/core/src/reg_services.h +++ b/umac/regulatory/core/src/reg_services.h @@ -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 diff --git a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h index 2f690fee397f..72269d09c37d 100644 --- a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h +++ b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h @@ -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; }; diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h index 0a780af6a422..04b1916cd402 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h @@ -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 diff --git a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c b/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c index b367438884f8..97c34a85d591 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c @@ -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