From 73bccf2d8816eb746b020f0708a5bc0c507556c2 Mon Sep 17 00:00:00 2001 From: hqu Date: Sat, 28 Oct 2017 15:34:17 +0800 Subject: [PATCH] qcacld-3.0: Keep WEP key when vendor subcmd restart sap When vendor subcmd set sap channel, driver will do sap restart, WEP key will be cleared when stop bss, then it will cause WEP shared connection fail. Fix is to keep WEP key when bss stop caused by QCA_WLAN_VENDOR_ATTR_SAP_CONFIG_CHANNEL. Change-Id: Ib91993ae953f04c01dc9130774f91300dd8bd62a CRs-Fixed: 2134346 --- core/hdd/inc/wlan_hdd_main.h | 3 +++ core/hdd/src/wlan_hdd_cfg80211.c | 1 + core/hdd/src/wlan_hdd_hostapd.c | 10 +++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) 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 */