diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 4231e813edfe..919f74d29b06 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -689,10 +689,13 @@ struct hdd_hostapd_state { * to maintain SCC mode with the STA role on the same card. * this usually happens when STA is connected to an external * AP that runs on a different channel + * @BSS_STOP_DUE_TO_VENDOR_CONFIG_CHAN: BSS stopped due to + * vendor subcmd set sap config channel */ enum bss_stop_reason { BSS_STOP_REASON_INVALID = 0, BSS_STOP_DUE_TO_MCC_SCC_SWITCH = 1, + BSS_STOP_DUE_TO_VENDOR_CONFIG_CHAN = 2, }; /** diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 0452cc5ed662..ff351db05a09 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -10091,6 +10091,7 @@ __wlan_hdd_cfg80211_sap_configuration_set(struct wiphy *wiphy, ap_ctx->sapConfig.channel = config_channel; ap_ctx->sapConfig.ch_params.ch_width = ap_ctx->sapConfig.ch_width_orig; + ap_ctx->bss_stop_reason = BSS_STOP_DUE_TO_VENDOR_CONFIG_CHAN; wlan_reg_set_channel_params(hdd_ctx->hdd_pdev, ap_ctx->sapConfig.channel, diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 21c93d5e4f3f..b06af259d1db 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1826,9 +1826,13 @@ QDF_STATUS hdd_hostapd_sap_event_cb(tpSap_Event pSapEvent, hdd_ctx->dev_dfs_cac_status = DFS_CAC_NEVER_DONE; } hdd_debug("bss_stop_reason=%d", ap_ctx->bss_stop_reason); - if (ap_ctx->bss_stop_reason != - BSS_STOP_DUE_TO_MCC_SCC_SWITCH) { - /* when MCC to SCC switching happens, key storage + if ((BSS_STOP_DUE_TO_MCC_SCC_SWITCH != + ap_ctx->bss_stop_reason) && + (BSS_STOP_DUE_TO_VENDOR_CONFIG_CHAN != + ap_ctx->bss_stop_reason)) { + /* + * when MCC to SCC switching or vendor subcmd + * setting sap config channel happens, key storage * should not be cleared due to hostapd will not * repopulate the original keys */