summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwadesong <wadesong@codeaurora.org>2016-12-01 16:21:17 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-13 06:24:59 -0800
commit79bbd593e5846b7bf715db4889a097c355a3b357 (patch)
tree7f003705f28d64fc86bf3fe6a93c941bfd9171db
parent4f27fbee69b891cd68eefd214cf83b6ae2bb5cd8 (diff)
qcacld-2.0: Add conditional check for SAP key clearing
SAP keys should be retained at HDD layer when wlan driver performs internal restarting due to MCC to SCC switch Change-Id: I5458f7602a0e3851d678981e107ef3b5bda17dd7 CRs-Fixed: 1095584
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h15
-rw-r--r--CORE/HDD/src/wlan_hdd_hostapd.c19
-rw-r--r--CORE/HDD/src/wlan_hdd_main.c5
3 files changed, 36 insertions, 3 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 69aa0e531c0e..6dfaed94332d 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -776,6 +776,20 @@ typedef struct hdd_hostapd_state_s
} hdd_hostapd_state_t;
+/**
+ * enum bss_stop_reason - reasons why a BSS is stopped.
+ * @BSS_STOP_REASON_INVALID: no reason specified explicitly.
+ * @BSS_STOP_DUE_TO_MCC_SCC_SWITCH: BSS stopped due to host
+ * driver is trying to switch AP role to a different channel
+ * 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
+ */
+enum bss_stop_reason
+{
+ BSS_STOP_REASON_INVALID = 0,
+ BSS_STOP_DUE_TO_MCC_SCC_SWITCH = 1,
+};
/*
* Per station structure kept in HDD for multiple station support for SoftAP
@@ -875,6 +889,7 @@ struct hdd_ap_ctx_s
v_PVOID_t sapContext;
#endif
v_BOOL_t dfs_cac_block_tx;
+ enum bss_stop_reason bss_stop_reason;
};
typedef struct hdd_scaninfo_s
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index dfbc95b0eada..24f3c22f5644 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -1788,9 +1788,22 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
FL("P2PGO is going down now"));
hdd_issue_stored_joinreq(sta_adapter, pHddCtx);
}
- pHddApCtx->groupKey.keyLength = 0;
- for (i = 0; i < CSR_MAX_NUM_KEY; i++)
- pHddApCtx->wepKey[i].keyLength = 0;
+
+ hddLog(VOS_TRACE_LEVEL_INFO,
+ FL("bss_stop_reason=%d"), pHddApCtx->bss_stop_reason);
+ if (pHddApCtx->bss_stop_reason != BSS_STOP_DUE_TO_MCC_SCC_SWITCH){
+ /* when MCC to SCC switching happens, key storage should not be
+ * cleared due to hostapd will not repopulate the original keys
+ */
+ pHddApCtx->groupKey.keyLength = 0;
+ for (i = 0; i < CSR_MAX_NUM_KEY; i++)
+ pHddApCtx->wepKey[i].keyLength = 0;
+ }
+
+ /* clear the reason code in case BSS is stopped
+ * in another place
+ */
+ pHddApCtx->bss_stop_reason = BSS_STOP_REASON_INVALID;
goto stopbss;
case eSAP_DFS_CAC_START:
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index bba3537a5fd4..14d4c6a51134 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -17905,7 +17905,12 @@ void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *data)
if (intf_ch == 0)
return;
+ hddLog(VOS_TRACE_LEVEL_INFO,
+ FL("SAP restarts due to MCC->SCC switch, orig chan: %d, new chan: %d"),
+ pHddApCtx->sapConfig.channel, intf_ch);
+
pHddApCtx->sapConfig.channel = intf_ch;
+ pHddApCtx->bss_stop_reason = BSS_STOP_DUE_TO_MCC_SCC_SWITCH;
sme_SelectCBMode(hHal,
pHddApCtx->sapConfig.SapHw_mode,
pHddApCtx->sapConfig.channel,