summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitesh Shah <niteshs@codeaurora.org>2017-01-25 22:07:07 +0530
committerqcabuildsw <qcabuildsw@localhost>2017-01-28 23:33:10 -0800
commit536378dbfc058c23a09aa0bdc0613740d4464432 (patch)
treea6608df843d8f0d48a7732e9dc705de87fd89da5
parent595aee588da674fa5b656e398bff979987283a71 (diff)
qcacld-3.0: Initialize tdls global context variables after SSR
After SSR is done all the tdls global context variables are not initialized in wlan_hdd_tdls_init() that can create problem in TDLS. Fix is to initialize tdls global context variables after SSR. Change-Id: I6e777d4d61876ea85300e587c5d720e89bad3431 CRs-Fixed: 1116756
-rw-r--r--core/hdd/inc/wlan_hdd_tdls.h4
-rw-r--r--core/hdd/src/wlan_hdd_main.c2
-rw-r--r--core/hdd/src/wlan_hdd_tdls.c10
3 files changed, 10 insertions, 6 deletions
diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h
index fd498fd96bf3..e8808b5eaa73 100644
--- a/core/hdd/inc/wlan_hdd_tdls.h
+++ b/core/hdd/inc/wlan_hdd_tdls.h
@@ -716,7 +716,7 @@ void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter,
void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter,
struct sk_buff *skb);
int hdd_set_tdls_scan_type(hdd_context_t *hdd_ctx, int val);
-void hdd_tdls_context_init(hdd_context_t *hdd_ctx);
+void hdd_tdls_context_init(hdd_context_t *hdd_ctx, bool ssr);
void hdd_tdls_context_destroy(hdd_context_t *hdd_ctx);
int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx,
hdd_adapter_t *adapter,
@@ -787,7 +787,7 @@ static inline void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter,
struct sk_buff *skb)
{
}
-static inline void hdd_tdls_context_init(hdd_context_t *hdd_ctx) { }
+static inline void hdd_tdls_context_init(hdd_context_t *hdd_ctx, bool ssr) { }
static inline void hdd_tdls_context_destroy(hdd_context_t *hdd_ctx) { }
static inline int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx,
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 2ee07244f18b..2bc21d5c580b 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -6580,7 +6580,7 @@ static int hdd_context_init(hdd_context_t *hdd_ctx)
if (ret)
goto list_destroy;
- hdd_tdls_context_init(hdd_ctx);
+ hdd_tdls_context_init(hdd_ctx, false);
hdd_rx_wake_lock_create(hdd_ctx);
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index b02738038af8..8391d1d3b66d 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -625,12 +625,13 @@ static void wlan_hdd_tdls_del_non_forced_peers(tdlsCtx_t *hdd_tdls_ctx)
/**
* hdd_tdls_context_init() - Init TDLS context
* @hdd_ctx: HDD context
+ * @ssr: SSR case
*
* Initialize TDLS global context.
*
* Return: None
*/
-void hdd_tdls_context_init(hdd_context_t *hdd_ctx)
+void hdd_tdls_context_init(hdd_context_t *hdd_ctx, bool ssr)
{
uint8_t sta_idx;
@@ -646,7 +647,6 @@ void hdd_tdls_context_init(hdd_context_t *hdd_ctx)
hdd_ctx->tdls_scan_ctxt.reject = 0;
hdd_ctx->tdls_scan_ctxt.source = 0;
hdd_ctx->tdls_scan_ctxt.scan_request = NULL;
- hdd_ctx->tdls_external_peer_count = 0;
hdd_ctx->set_state_info.set_state_cnt = 0;
hdd_ctx->set_state_info.vdev_id = 0;
hdd_ctx->tdls_nss_teardown_complete = false;
@@ -679,6 +679,10 @@ void hdd_tdls_context_init(hdd_context_t *hdd_ctx)
QDF_MAC_ADDR_SIZE);
}
+ /* Don't reset TDLS external peer count for SSR case */
+ if (!ssr)
+ hdd_ctx->tdls_external_peer_count = 0;
+
/* This flag will set be true, only when device operates in
* standalone STA mode
*/
@@ -780,7 +784,7 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter)
wlan_hdd_tdls_del_non_forced_peers(pHddTdlsCtx);
- pHddCtx->connected_peer_count = 0;
+ hdd_tdls_context_init(pHddCtx, true);
}
sme_set_tdls_power_save_prohibited(WLAN_HDD_GET_HAL_CTX(pAdapter),