diff options
| author | Xiaochang Duan <xduan@qca.qualcomm.com> | 2014-06-02 00:00:57 -0700 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-06-03 15:48:35 -0700 |
| commit | 28e59c76c8d323ba0f6a213d50b3b70988fcd121 (patch) | |
| tree | ae4785a9bc023c0d58a588cffea6c0686eaed58a | |
| parent | e90aa4233c7f1ca112b4f7e2338670fd156a5176 (diff) | |
qcacld-new: Allow up to 1 TDLS peer number if P-UAPSD is enabled
Limit the maximum number of TDLS peer number to be 1 if either
Sleep STA or Buffer STA is enabled in P-UAPSD
Change-Id: Ie81ae564bcd874c72bde8efa8a3f89ff2dea56c8
CRs-Fixed: 673828
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_assoc.h | 5 | ||||
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_main.h | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_assoc.c | 4 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 10 | ||||
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 8 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_tdls.c | 6 |
6 files changed, 24 insertions, 11 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_assoc.h b/CORE/HDD/inc/wlan_hdd_assoc.h index 6bb8ed97419e..034a0a057b1a 100644 --- a/CORE/HDD/inc/wlan_hdd_assoc.h +++ b/CORE/HDD/inc/wlan_hdd_assoc.h @@ -29,9 +29,10 @@ #if !defined( HDD_CONNECTION_H__ ) #define HDD_CONNECTION_H__ #include <wlan_hdd_mib.h> -#define HDD_MAX_NUM_IBSS_STA ( 32 ) +#define HDD_MAX_NUM_IBSS_STA ( 32 ) #ifdef FEATURE_WLAN_TDLS -#define HDD_MAX_NUM_TDLS_STA ( 8 ) +#define HDD_MAX_NUM_TDLS_STA ( 8 ) +#define HDD_MAX_NUM_TDLS_STA_P_UAPSD ( 1 ) #ifdef QCA_WIFI_2_0 #define TDLS_STA_INDEX_VALID(staId) \ (((staId) >= 1) && ((staId) < 0xFF)) diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 5276bac5827c..387e5b4f32c4 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -1373,6 +1373,8 @@ struct hdd_context_s eTDLSSupportMode tdls_mode; eTDLSSupportMode tdls_mode_last; tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA]; + /* maximum TDLS station number allowed upon runtime condition */ + tANI_U16 max_num_tdls_sta; /* TDLS peer connected count */ tANI_U16 connected_peer_count; tdls_scan_context_t tdls_scan_ctxt; diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index 8b98c2a6dc85..e240692cf2b8 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -2450,7 +2450,7 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, { /* check if there is available index for this new TDLS STA */ - for ( staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++ ) + for ( staIdx = 0; staIdx < pHddCtx->max_num_tdls_sta; staIdx++ ) { if (0 == pHddCtx->tdlsConnInfo[staIdx].staId ) { @@ -2469,7 +2469,7 @@ eHalStatus hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, break ; } } - if (staIdx < HDD_MAX_NUM_TDLS_STA) + if (staIdx < pHddCtx->max_num_tdls_sta) { if (-1 == wlan_hdd_tdls_set_sta_id(pAdapter, pRoamInfo->peerMac, pRoamInfo->staId)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 8d1952ef167b..b29abc2f96e7 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -3806,14 +3806,14 @@ static int wlan_hdd_tdls_add_station(struct wiphy *wiphy, TODO: for now, return -EPERM looks working fine, but need to check if any other errno fit into this category.*/ numCurrTdlsPeers = wlan_hdd_tdlsConnectedPeers(pAdapter); - if (HDD_MAX_NUM_TDLS_STA <= numCurrTdlsPeers) + if (pHddCtx->max_num_tdls_sta <= numCurrTdlsPeers) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: " MAC_ADDRESS_STR " TDLS Max peer already connected. Request declined." " Num of peers (%d), Max allowed (%d).", __func__, MAC_ADDR_ARRAY(mac), numCurrTdlsPeers, - HDD_MAX_NUM_TDLS_STA); + pHddCtx->max_num_tdls_sta); goto error; } else @@ -9454,7 +9454,7 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d SIR_MAC_TDLS_SETUP_RSP == action_code ) { numCurrTdlsPeers = wlan_hdd_tdlsConnectedPeers(pAdapter); - if (HDD_MAX_NUM_TDLS_STA <= numCurrTdlsPeers) + if (pHddCtx->max_num_tdls_sta <= numCurrTdlsPeers) { /* supplicant still sends tdls_mgmt(SETUP_REQ) even after we return error code at 'add_station()'. Hence we have this @@ -9466,7 +9466,7 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d "%s: " MAC_ADDRESS_STR " TDLS Max peer already connected. action (%d) declined. Num of peers (%d), Max allowed (%d).", __func__, MAC_ADDR_ARRAY(peer), action_code, - numCurrTdlsPeers, HDD_MAX_NUM_TDLS_STA); + numCurrTdlsPeers, pHddCtx->max_num_tdls_sta); return -EINVAL; } else @@ -9478,7 +9478,7 @@ static int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *d "%s: " MAC_ADDRESS_STR " TDLS Max peer already connected, send response status (%d). Num of peers (%d), Max allowed (%d).", __func__, MAC_ADDR_ARRAY(peer), status_code, - numCurrTdlsPeers, HDD_MAX_NUM_TDLS_STA); + numCurrTdlsPeers, pHddCtx->max_num_tdls_sta); max_sta_failed = -EPERM; /* fall through to send setup resp with failure status code */ diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 636c168d3d5b..4baaef8c7c97 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -5836,6 +5836,14 @@ static void hdd_update_tgt_services(hdd_context_t *hdd_ctx, { cfg_ini->fEnableTDLSSleepSta = FALSE; } + if (cfg_ini->fEnableTDLSSleepSta || cfg_ini->fEnableTDLSBufferSta) + { + /* Adjust max TDLS sta number if self is either sleep STA or buf STA */ + hdd_ctx->max_num_tdls_sta = HDD_MAX_NUM_TDLS_STA_P_UAPSD; + hddLog(VOS_TRACE_LEVEL_INFO_HIGH, + "%s: P-UAPSD: sleep or buffer sta enabled, max_tdls_peer_# = %d", + __func__, hdd_ctx->max_num_tdls_sta); + } #endif pMac->beacon_offload = cfg->beacon_offload; } diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c index 2c91d1044613..a9f5c687650f 100644 --- a/CORE/HDD/src/wlan_hdd_tdls.c +++ b/CORE/HDD/src/wlan_hdd_tdls.c @@ -341,7 +341,7 @@ static v_VOID_t wlan_hdd_tdls_update_peer_cb( v_PVOID_t userData ) if (curr_peer->tx_pkt >= pHddTdlsCtx->threshold_config.tx_packet_n) { - if (HDD_MAX_NUM_TDLS_STA > wlan_hdd_tdlsConnectedPeers(pHddTdlsCtx->pAdapter)) + if (pHddCtx->max_num_tdls_sta > wlan_hdd_tdlsConnectedPeers(pHddTdlsCtx->pAdapter)) { VOS_TRACE( VOS_MODULE_ID_HDD, TDLS_LOG_LEVEL, "Tput trigger TDLS pre-setup"); @@ -754,6 +754,8 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) 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; @@ -2714,7 +2716,7 @@ int wlan_hdd_tdls_scan_callback (hdd_adapter_t *pAdapter, hddTdlsPeer_t *curr_peer; hddTdlsPeer_t *connectedPeerList[HDD_MAX_NUM_TDLS_STA]; - for (staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++) + for (staIdx = 0; staIdx < pHddCtx->max_num_tdls_sta; staIdx++) { if (pHddCtx->tdlsConnInfo[staIdx].staId) { |
