diff options
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_tdls.h | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 12 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_early_suspend.c | 1 | ||||
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 3 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_tdls.c | 56 |
5 files changed, 46 insertions, 28 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_tdls.h b/CORE/HDD/inc/wlan_hdd_tdls.h index 47243a217d31..c443ea0d55a1 100644 --- a/CORE/HDD/inc/wlan_hdd_tdls.h +++ b/CORE/HDD/inc/wlan_hdd_tdls.h @@ -219,6 +219,8 @@ typedef struct { int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter); +void wlan_hdd_global_tdls_init(hdd_context_t * pHddCtx); + void wlan_hdd_tdls_exit(hdd_adapter_t *pAdapter); void wlan_hdd_tdls_extract_da(struct sk_buff *skb, u8 *mac); diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index f7ef86f0acc3..bbebf157e0b4 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -10738,6 +10738,18 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d } } + if (hdd_isConnectionInProgress(pHddCtx)) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Connection is in progress" + " TDLS connection is not allowed")); + return -EBUSY; + } + + if (vos_max_concurrent_connections_reached()) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Reached max concurrent connections")); + return -EINVAL; + } + if (WLAN_IS_TDLS_SETUP_ACTION(action_code)) { if (NULL != wlan_hdd_tdls_is_progress(pHddCtx, peer, TRUE)) diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c index dcdb1908b025..813a1f366161 100644 --- a/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -2251,6 +2251,7 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE); pHddCtx->hdd_mcastbcast_filter_set = FALSE; hdd_register_mcast_bcast_filter(pHddCtx); + wlan_hdd_global_tdls_init(pHddCtx); hdd_ssr_timer_del(); #ifdef QCA_WIFI_ISOC diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 182ff9edd264..960dc2af1ae4 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -11788,6 +11788,9 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) /*SME must send channel update configuration to RIVA*/ sme_UpdateChannelConfig(pHddCtx->hHal); #endif + + wlan_hdd_global_tdls_init(pHddCtx); + sme_Register11dScanDoneCallback(pHddCtx->hHal, hdd_11d_scan_done); /* Register with platform driver as client for Suspend/Resume */ diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c index a9f5c687650f..f24d6e13b4a6 100644 --- a/CORE/HDD/src/wlan_hdd_tdls.c +++ b/CORE/HDD/src/wlan_hdd_tdls.c @@ -647,13 +647,39 @@ static void wlan_hdd_tdls_schedule_scan(struct work_struct *work) scan_ctx->scan_request); } - +/* initialize TDLS global context */ +void wlan_hdd_global_tdls_init(hdd_context_t *pHddCtx ) +{ + v_U8_t staIdx; + + pHddCtx->connected_peer_count = 0; + pHddCtx->tdls_scan_ctxt.magic = 0; + pHddCtx->tdls_scan_ctxt.attempt = 0; + pHddCtx->tdls_scan_ctxt.reject = 0; + pHddCtx->tdls_scan_ctxt.scan_request = NULL; + + for (staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++) { + pHddCtx->tdlsConnInfo[staIdx].staId = 0; + pHddCtx->tdlsConnInfo[staIdx].sessionId = 255; + vos_mem_zero(&pHddCtx->tdlsConnInfo[staIdx].peerMac, + sizeof(v_MACADDR_t)) ; + } + + if (VOS_FALSE == pHddCtx->cfg_ini->fEnableTDLSImplicitTrigger) { + pHddCtx->tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY; + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_DEBUG, + FL("TDLS Implicit trigger not enabled!")); + } else { + pHddCtx->tdls_mode = eTDLS_SUPPORT_ENABLED; + } +} + +/* Initialize TDLS */ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) { hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX( pAdapter ); tdlsCtx_t *pHddTdlsCtx; int i; - v_U8_t staIdx; #ifdef QCA_WIFI_2_0 tdlsInfo_t *tInfo; eHalStatus halStatus = eHAL_STATUS_FAILURE; @@ -744,26 +770,9 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) pHddTdlsCtx = pAdapter->sessionCtx.station.pHddTdlsCtx; - /* initialize TDLS global context */ - pHddCtx->connected_peer_count = 0; sme_SetTdlsPowerSaveProhibited(WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, 0); - pHddCtx->tdls_scan_ctxt.magic = 0; - pHddCtx->tdls_scan_ctxt.attempt = 0; - pHddCtx->tdls_scan_ctxt.reject = 0; - pHddCtx->tdls_scan_ctxt.scan_request = NULL; - - pHddCtx->max_num_tdls_sta = HDD_MAX_NUM_TDLS_STA; - - for (staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++) - { - pHddCtx->tdlsConnInfo[staIdx].staId = 0; - pHddCtx->tdlsConnInfo[staIdx].sessionId = 255; - vos_mem_zero(&pHddCtx->tdlsConnInfo[staIdx].peerMac, - sizeof(v_MACADDR_t)) ; - } - pHddTdlsCtx->pAdapter = pAdapter; for (i = 0; i < 256; i++) @@ -788,15 +797,6 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) pHddTdlsCtx->threshold_config.rssi_delta = pHddCtx->cfg_ini->fTDLSRSSIDelta; #endif - if (FALSE == pHddCtx->cfg_ini->fEnableTDLSImplicitTrigger) - { - pHddCtx->tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY; - hddLog(VOS_TRACE_LEVEL_ERROR, "%s TDLS Implicit trigger not enabled!", __func__); - } - else - { - pHddCtx->tdls_mode = eTDLS_SUPPORT_ENABLED; - } #ifdef CONFIG_TDLS_IMPLICIT INIT_WORK(&pHddTdlsCtx->implicit_setup, wlan_hdd_tdls_pre_setup); #endif |
