diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 027883b3fe67..a53bcc894c18 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -8743,6 +8743,29 @@ enum dot11p_mode { #define CFG_SAP_INTERNAL_RESTART_MAX (1) #define CFG_SAP_INTERNAL_RESTART_DEFAULT (1) +/* + * + * sap_restart_on_ch_avoid - control SAP restart on channel avoidance + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to control SAP restart on channel avoidance + * sap_restart_on_ch_avoid=0: Don't restart SAP on channel avoidance indication + * sap_restart_on_ch_avoid=1: restart SAP on channel avoidance indication + * + * Related: None + * + * Supported Feature: channel avoidance + * + * Usage: Internal/External + * + * + */ +#define CFG_SAP_RESTART_ON_CH_AVOID_NAME "sap_restart_on_ch_avoid" +#define CFG_SAP_RESTART_ON_CH_AVOID_MIN (0) +#define CFG_SAP_RESTART_ON_CH_AVOID_MAX (1) +#define CFG_SAP_RESTART_ON_CH_AVOID_DEFAULT (1) /* * This parameter will avoid updating ap_sta_inactivity from hostapd.conf * file. If a station does not send anything in ap_max_inactivity seconds, an @@ -11057,6 +11080,7 @@ struct hdd_config { enum hdd_wext_control standard_wext_control; enum hdd_wext_control private_wext_control; bool sap_internal_restart; + bool sap_restart_on_ch_avoid; uint8_t is_per_roam_enabled; uint32_t per_roam_high_rate_threshold; uint32_t per_roam_low_rate_threshold; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index c69c11e180a1..5693fb06423c 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -4223,6 +4223,13 @@ struct reg_table_entry g_registry_table[] = { CFG_SAP_INTERNAL_RESTART_MIN, CFG_SAP_INTERNAL_RESTART_MAX), + REG_VARIABLE(CFG_SAP_RESTART_ON_CH_AVOID_NAME, WLAN_PARAM_Integer, + struct hdd_config, sap_restart_on_ch_avoid, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SAP_RESTART_ON_CH_AVOID_DEFAULT, + CFG_SAP_RESTART_ON_CH_AVOID_MIN, + CFG_SAP_RESTART_ON_CH_AVOID_MAX), + REG_VARIABLE(CFG_PER_ROAM_ENABLE_NAME, WLAN_PARAM_Integer, struct hdd_config, is_per_roam_enabled, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -5940,6 +5947,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_debug("Name = [%s] Value = [%u]", CFG_AUTO_DETECT_POWER_FAIL_MODE_NAME, pHddCtx->config->auto_pwr_save_fail_mode); + hdd_debug("Name = [%s] Value = [%d]", + CFG_SAP_RESTART_ON_CH_AVOID_NAME, + pHddCtx->config->sap_restart_on_ch_avoid); hdd_per_roam_print_ini_config(pHddCtx); hdd_he_print_ini_config(pHddCtx); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 450d3677773f..3d6d4d34db7c 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7097,13 +7097,18 @@ void hdd_ch_avoid_cb(void *hdd_context, void *indi_param) * first update the unsafe channel list to the platform driver and * send the avoid freq event to the application */ - wlan_hdd_send_avoid_freq_event(hdd_ctxt, &hdd_avoid_freq_list); + if (hdd_ctxt->config->sap_restart_on_ch_avoid) { + wlan_hdd_send_avoid_freq_event(hdd_ctxt, &hdd_avoid_freq_list); - if (!hdd_ctxt->unsafe_channel_count) { - hdd_debug("no unsafe channels - not restarting SAP"); - return; + if (!hdd_ctxt->unsafe_channel_count) { + hdd_info("no unsafe channels - not restarting SAP"); + return; + } + + hdd_unsafe_channel_restart_sap(hdd_ctxt); } - hdd_unsafe_channel_restart_sap(hdd_ctxt); + + return; } /**