diff options
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 1 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_tdls.c | 91 |
2 files changed, 42 insertions, 50 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 38522ea9c829..9e8ef1dcc1db 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1447,7 +1447,6 @@ struct hdd_context_s { #ifdef FEATURE_WLAN_TDLS eTDLSSupportMode tdls_mode; - bool concurrency_marked; eTDLSSupportMode tdls_mode_last; tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA]; /* maximum TDLS station number allowed upon runtime condition */ diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 208a2c8bdfbd..0a7142944aa5 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -690,7 +690,6 @@ void hdd_tdls_context_init(hdd_context_t *hdd_ctx, bool ssr) */ hdd_ctx->enable_tdls_connection_tracker = false; hdd_info("hdd_ctx->enable_tdls_connection_tracker: 0"); - hdd_ctx->concurrency_marked = false; } /** @@ -704,7 +703,6 @@ void hdd_tdls_context_init(hdd_context_t *hdd_ctx, bool ssr) void hdd_tdls_context_destroy(hdd_context_t *hdd_ctx) { hdd_ctx->tdls_external_peer_count = 0; - hdd_ctx->concurrency_marked = false; hdd_ctx->enable_tdls_connection_tracker = false; hdd_info("hdd_ctx->enable_tdls_connection_tracker: 0"); mutex_destroy(&hdd_ctx->tdls_lock); @@ -1915,6 +1913,7 @@ void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, tdlsCtx_t *hdd_tdls_ctx; tdlsInfo_t *tdls_param; QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE; + uint16_t staIdx; /* If TDLS support is disabled then no need to update target */ if (false == hdd_ctx->config->fEnableTDLSSupport) { @@ -1959,6 +1958,18 @@ void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, goto done; } + tdls_param->notification_interval_ms = + hdd_tdls_ctx->threshold_config.tx_period_t; + tdls_param->tx_discovery_threshold = + hdd_tdls_ctx->threshold_config.tx_packet_n; + tdls_param->tx_teardown_threshold = + hdd_tdls_ctx->threshold_config.idle_packet_n; + tdls_param->rssi_teardown_threshold = + hdd_tdls_ctx->threshold_config.rssi_teardown_threshold; + tdls_param->rssi_delta = hdd_tdls_ctx->threshold_config.rssi_delta; + + mutex_unlock(&hdd_ctx->tdls_lock); + /* If any concurrency detected, teardown all TDLS links and disable * the tdls support */ @@ -1969,13 +1980,29 @@ 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); if (hdd_ctx->connected_peer_count >= 1) { - hdd_ctx->concurrency_marked = true; - mutex_unlock(&hdd_ctx->tdls_lock); - wlan_hdd_tdls_disable_offchan_and_teardown_links( - hdd_ctx); - qdf_mem_free(tdls_param); - goto done; + /* clean up the tdls peers if any */ + for (staIdx = 0; staIdx < hdd_ctx->max_num_tdls_sta; + staIdx++) { + if ((hdd_ctx->tdlsConnInfo[staIdx].sessionId == + adapter->sessionId) + && (hdd_ctx->tdlsConnInfo[staIdx].staId)) { + uint8_t *mac; + mac = hdd_ctx->tdlsConnInfo[staIdx]. + peerMac.bytes; + hdd_notice("call sme_delete_tdls_peer_" + "sta staId %d sessionId %d " + MAC_ADDRESS_STR, + hdd_ctx->tdlsConnInfo + [staIdx].staId, + adapter->sessionId, + MAC_ADDR_ARRAY(mac)); + sme_delete_tdls_peer_sta( + WLAN_HDD_GET_HAL_CTX(adapter), + adapter->sessionId, mac); + } + } } tdls_prohibited = true; hdd_ctx->tdls_mode = eTDLS_SUPPORT_NOT_ENABLED; @@ -1985,20 +2012,8 @@ void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, } tdls_param->tdls_state = hdd_ctx->tdls_mode; - tdls_param->notification_interval_ms = - hdd_tdls_ctx->threshold_config.tx_period_t; - tdls_param->tx_discovery_threshold = - hdd_tdls_ctx->threshold_config.tx_packet_n; - tdls_param->tx_teardown_threshold = - hdd_tdls_ctx->threshold_config.idle_packet_n; - tdls_param->rssi_teardown_threshold = - hdd_tdls_ctx->threshold_config.rssi_teardown_threshold; - tdls_param->rssi_delta = hdd_tdls_ctx->threshold_config.rssi_delta; - tdls_param->tdls_options = 0; - mutex_unlock(&hdd_ctx->tdls_lock); - /* Do not enable TDLS offchannel, if AP prohibited TDLS channel switch */ if ((hdd_ctx->config->fEnableTDLSOffChannel) && (!tdls_chan_swit_prohibited)) { @@ -2069,14 +2084,11 @@ done: void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, tCsrRoamInfo *csr_roam_info) { - hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); - hdd_info("Check and update TDLS state"); /* Association event */ - if ((adapter->device_mode == QDF_STA_MODE || - adapter->device_mode == QDF_P2P_CLIENT_MODE) && - !hdd_ctx->concurrency_marked) { + if (adapter->device_mode == QDF_STA_MODE || + adapter->device_mode == QDF_P2P_CLIENT_MODE) { wlan_hdd_update_tdls_info(adapter, csr_roam_info->tdls_prohibited, csr_roam_info->tdls_chan_swit_prohibited); @@ -2103,17 +2115,15 @@ void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter, bool lfr_roam) hdd_info("Check and update TDLS state"); /* Disassociation event */ - if ((adapter->device_mode == QDF_STA_MODE || - adapter->device_mode == QDF_P2P_CLIENT_MODE) && - !hdd_ctx->concurrency_marked) { + if (adapter->device_mode == QDF_STA_MODE || + adapter->device_mode == QDF_P2P_CLIENT_MODE) { wlan_hdd_update_tdls_info(adapter, true, true); } - /* If concurrency is not marked, then we have to - * check, whether TDLS could be enabled in the - * system after this disassoc event. + /* Check TDLS could be enabled in the system + * after this disassoc event. */ - if (!lfr_roam && !hdd_ctx->concurrency_marked) { + if (!lfr_roam) { temp_adapter = wlan_hdd_tdls_get_adapter( hdd_ctx); if (NULL != temp_adapter) @@ -2635,7 +2645,6 @@ void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter) void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter) { hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - hdd_adapter_t *tdls_adapter; uint16_t connected_peer_count; ENTER(); @@ -2654,22 +2663,6 @@ void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter) hdd_notice("Connected peer count %d", connected_peer_count); - if (connected_peer_count == 0 && - pHddCtx->concurrency_marked) { - tdls_adapter = hdd_get_adapter_by_vdev(pHddCtx, - pHddCtx->set_state_info.vdev_id); - if (tdls_adapter) { - wlan_hdd_update_tdls_info(tdls_adapter, true, true); - pHddCtx->concurrency_marked = false; - } else { - hdd_err("TDLS set state is not cleared correctly !!!"); - pHddCtx->concurrency_marked = false; - } - tdls_adapter = wlan_hdd_tdls_get_adapter(pHddCtx); - if (tdls_adapter) - wlan_hdd_update_tdls_info(tdls_adapter, false, false); - } - EXIT(); } |
