From 80368ec6077a98bf144ccbbffc8f7318c0bfe841 Mon Sep 17 00:00:00 2001 From: Ganesh Kondabattini Date: Wed, 16 Aug 2017 20:34:50 +0530 Subject: qcacld-3.0: Donot send fw tdls state disable command for scan During scan and p2p listen host is going to teardown all the active tdls connections based on gEnableTdlsScan flag. At this this host should not send command to FW for disabling the tdls. CRs-Fixed: 2078355 Change-Id: I3852be0879de5739b3ac5c1f23679ecb340b76be --- core/hdd/inc/wlan_hdd_tdls.h | 6 ++++-- core/hdd/src/wlan_hdd_cfg80211.c | 3 ++- core/hdd/src/wlan_hdd_tdls.c | 18 ++++++++++-------- core/mac/inc/sir_api.h | 1 + core/mac/src/pe/lim/lim_process_tdls.c | 24 +++++++++++++----------- core/sme/inc/sme_api.h | 3 ++- core/sme/src/common/sme_api.c | 5 ++++- 7 files changed, 36 insertions(+), 24 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index 3a3dbdb56578..61d08798aa6c 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -715,7 +715,8 @@ bool wlan_hdd_tdls_check_enable_tdls_scan(hdd_context_t *hdd_ctx); bool wlan_hdd_tdls_check_peer_buf_capable(hdd_context_t *hdd_ctx, uint16_t connectedTdlsPeers); void hdd_update_tdls_ct_and_teardown_links(hdd_context_t *hdd_ctx); -void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx); +void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx, + bool disable_tdls_state); hddTdlsPeer_t *wlan_hdd_tdls_find_first_connected_peer(hdd_adapter_t *adapter); int hdd_set_tdls_offchannel(hdd_context_t *hdd_ctx, int offchannel); @@ -851,7 +852,8 @@ static inline void hdd_update_tdls_ct_and_teardown_links(hdd_context_t *hdd_ctx) { } static inline void -wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx) +wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx, + bool disable_tdls_state); { } static inline void wlan_hdd_tdls_exit(hdd_adapter_t *adapter) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 79949e89b0c7..a3d6c129ab2e 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -16765,7 +16765,8 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy, /* First clean up the tdls peers * Send Msg to PE for deleting all the TDLS peers */ - sme_delete_all_tdls_peers(pHddCtx->hHal, pAdapter->sessionId); + sme_delete_all_tdls_peers(pHddCtx->hHal, pAdapter->sessionId, + true); #endif hdd_info("Disconnect request from user space with reason: %d (%s) internal reason code: %d", reason, hdd_ieee80211_reason_code_to_str(reason), reasonCode); diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 1108e989539c..c1a1206112df 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -212,10 +212,11 @@ static u8 wlan_hdd_tdls_hash_key(const u8 *mac) * wlan_hdd_tdls_disable_offchan_and_teardown_links - Disable offchannel * and teardown TDLS links * @hddCtx : pointer to hdd context - * + * @disable_tdls_state: disable FW tdls state * Return: None */ -void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx) +void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx, + bool disable_tdls_state) { u16 connected_tdls_peers = 0; u8 staidx; @@ -259,7 +260,8 @@ void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx) hdd_set_tdls_offchannelmode(adapter, DISABLE_CHANSWITCH); /* Send Msg to PE for deleting all the TDLS peers */ - sme_delete_all_tdls_peers(hddctx->hHal, adapter->sessionId); + sme_delete_all_tdls_peers(hddctx->hHal, adapter->sessionId, + disable_tdls_state); for (staidx = 0; staidx < hddctx->max_num_tdls_sta; staidx++) { @@ -315,7 +317,7 @@ void hdd_update_tdls_ct_and_teardown_links(hdd_context_t *hdd_ctx) { /* set tdls connection tracker state */ cds_set_tdls_ct_mode(hdd_ctx); - wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_ctx); + wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_ctx, true); } /** @@ -1995,7 +1997,7 @@ void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, !tdls_prohibited) { hdd_warn("Concurrency not allowed in TDLS! set state cnt %d", hdd_ctx->set_state_info.set_state_cnt); - wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_ctx); + wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_ctx, true); tdls_prohibited = true; hdd_ctx->tdls_mode = eTDLS_SUPPORT_NOT_ENABLED; tdls_param->vdev_id = hdd_ctx->set_state_info.vdev_id; @@ -2179,7 +2181,7 @@ void wlan_hdd_check_conc_and_update_tdls_state(hdd_context_t *hdd_ctx, return; } wlan_hdd_tdls_disable_offchan_and_teardown_links( - hdd_ctx); + hdd_ctx, true); return; } wlan_hdd_update_tdls_info(temp_adapter, false, false); @@ -2936,7 +2938,7 @@ int wlan_hdd_tdls_scan_callback(hdd_adapter_t *pAdapter, struct wiphy *wiphy, if (connectedTdlsPeers) { hdd_debug("teardown all the active tdls links"); wlan_hdd_tdls_disable_offchan_and_teardown_links( - pHddCtx); + pHddCtx, false); } } @@ -6342,7 +6344,7 @@ void hdd_tdls_notify_p2p_roc(hdd_context_t *hdd_ctx, if (!buf_sta) { hdd_debug("teardown tdls links"); wlan_hdd_tdls_disable_offchan_and_teardown_links( - hdd_ctx); + hdd_ctx, false); } } diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index dc8fede6786a..bd5ec5adae89 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -7999,6 +7999,7 @@ struct sir_del_all_tdls_peers { uint16_t msg_type; uint16_t msg_len; struct qdf_mac_addr bssid; + bool disable_tdls_state; }; /** diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 1e5a93e73502..fc4ff89954a4 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -3344,18 +3344,20 @@ tSirRetStatus lim_process_sme_del_all_tdls_peers(tpAniSirGlobal mac_ctx, lim_check_aid_and_delete_peer(mac_ctx, session_entry); - if (mac_ctx->lim.sme_msg_callback) { - tdls_state_disable = qdf_mem_malloc( - sizeof(*tdls_state_disable)); - if (NULL == tdls_state_disable) { - pe_err("memory allocation failed"); - return eSIR_FAILURE; + if (msg->disable_tdls_state) { + if (mac_ctx->lim.sme_msg_callback) { + tdls_state_disable = qdf_mem_malloc( + sizeof(*tdls_state_disable)); + if (NULL == tdls_state_disable) { + pe_err("memory allocation failed"); + return eSIR_FAILURE; + } + tdls_state_disable->session_id = session_entry->smeSessionId; + cds_msg.type = eWNI_SME_TDLS_NOTIFY_SET_STATE_DISABLE; + cds_msg.bodyptr = tdls_state_disable; + cds_msg.bodyval = 0; + mac_ctx->lim.sme_msg_callback(mac_ctx, &cds_msg); } - tdls_state_disable->session_id = session_entry->smeSessionId; - cds_msg.type = eWNI_SME_TDLS_NOTIFY_SET_STATE_DISABLE; - cds_msg.bodyptr = tdls_state_disable; - cds_msg.bodyval = 0; - mac_ctx->lim.sme_msg_callback(mac_ctx, &cds_msg); } return eSIR_SUCCESS; diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 142eac9fecd1..c0a699c3a87f 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1599,7 +1599,8 @@ QDF_STATUS sme_congestion_register_callback(tHalHandle hal, tCsrScanResultInfo *sme_scan_get_result_for_bssid(tHalHandle hal_handle, struct qdf_mac_addr *bssid); -QDF_STATUS sme_delete_all_tdls_peers(tHalHandle hal, uint8_t session_id); +QDF_STATUS sme_delete_all_tdls_peers(tHalHandle hal, uint8_t session_id, + bool disable_tdls_state); /** * sme_set_random_mac() - Set random mac address filter diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index a06ee3544782..24c5d5928278 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -18061,7 +18061,8 @@ send_flush_cmd: * * Return: QDF_STATUS */ -QDF_STATUS sme_delete_all_tdls_peers(tHalHandle hal, uint8_t session_id) +QDF_STATUS sme_delete_all_tdls_peers(tHalHandle hal, uint8_t session_id, + bool disable_tdls_state) { struct sir_del_all_tdls_peers *msg; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -18082,6 +18083,8 @@ QDF_STATUS sme_delete_all_tdls_peers(tHalHandle hal, uint8_t session_id) qdf_mem_copy(msg->bssid.bytes, session->connectedProfile.bssid.bytes, sizeof(struct qdf_mac_addr)); + msg->disable_tdls_state = disable_tdls_state; + status = cds_send_mb_message_to_mac(msg); if (status != QDF_STATUS_SUCCESS) { -- cgit v1.2.3