diff options
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_main.h | 2 | ||||
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_tdls.h | 5 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_ipa.c | 1 | ||||
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 1 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_tdls.c | 24 |
5 files changed, 26 insertions, 7 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 641c25d022a9..dede1fc4d6b8 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -264,6 +264,8 @@ typedef v_U8_t tWlanHddMacAddr[HDD_MAC_ADDR_LEN]; +#define HDD_BW_GET_DIFF(_x, _y) (unsigned long)((ULONG_MAX - (_y)) + (_x) + 1) + /* * Generic asynchronous request/response support * diff --git a/CORE/HDD/inc/wlan_hdd_tdls.h b/CORE/HDD/inc/wlan_hdd_tdls.h index eebec6bfd181..cc96b5128c85 100644 --- a/CORE/HDD/inc/wlan_hdd_tdls.h +++ b/CORE/HDD/inc/wlan_hdd_tdls.h @@ -79,6 +79,9 @@ should not be more than 2000 */ #define TDLS_PEER_LIST_SIZE 256 +#define MAX_TDLS_DISCOVERY_CYCLE_RETRIES 2 +#define MIN_TDLS_DISCOVERY_CYCLE_RETRY_TIME (5 * 60 * 1000) /* 5 minutes */ + typedef struct { tANI_U32 tdls; @@ -274,6 +277,8 @@ typedef struct _hddTdlsPeer_t { /* EXT TDLS */ tTDLSLinkReason reason; cfg80211_exttdls_callback state_change_notification; + uint8_t discovery_cycles_retry_cnt; + uint64_t last_discovery_req_cycle_ts; } hddTdlsPeer_t; typedef struct { diff --git a/CORE/HDD/src/wlan_hdd_ipa.c b/CORE/HDD/src/wlan_hdd_ipa.c index cfc17f2fb7e0..ebbbeb5f371e 100644 --- a/CORE/HDD/src/wlan_hdd_ipa.c +++ b/CORE/HDD/src/wlan_hdd_ipa.c @@ -1621,7 +1621,6 @@ void hdd_ipa_uc_loaded_uc_cb(void *priv_ctxt) return; } -#define HDD_BW_GET_DIFF(_x, _y) (unsigned long)((ULONG_MAX - (_y)) + (_x) + 1) static void hdd_ipa_uc_op_cb(struct op_msg_type *op_msg, void *usr_ctxt) { struct op_msg_type *msg = op_msg; diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 69a435fb55c5..e6134c499a49 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -13728,7 +13728,6 @@ void hdd_cnss_request_bus_bandwidth(hdd_context_t *pHddCtx, pHddCtx->hdd_txrx_hist_idx &= NUM_TX_RX_HISTOGRAM_MASK; } -#define HDD_BW_GET_DIFF(x, y) ((x) >= (y) ? (x) - (y) : (ULONG_MAX - (y) + (x))) static void hdd_bus_bw_compute_cbk(void *priv) { hdd_context_t *pHddCtx = (hdd_context_t *)priv; diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c index 403c44eccbb7..49d5a6091126 100644 --- a/CORE/HDD/src/wlan_hdd_tdls.c +++ b/CORE/HDD/src/wlan_hdd_tdls.c @@ -395,6 +395,12 @@ static v_VOID_t wlan_hdd_tdls_discovery_timeout_peer_cb(v_PVOID_t userData) "%s: " MAC_ADDRESS_STR " to idle state", __func__, MAC_ADDR_ARRAY(tmp->peerMac)); mutex_unlock(&pHddCtx->tdls_lock); + if (tmp->discovery_attempt == + pHddTdlsCtx->threshold_config.discovery_tries_n) { + tmp->discovery_attempt = 0; + tmp->discovery_cycles_retry_cnt++; + tmp->last_discovery_req_cycle_ts = jiffies; + } wlan_hdd_tdls_set_peer_link_status(tmp, eTDLS_LINK_IDLE, eTDLS_LINK_NOT_SUPPORTED); @@ -573,6 +579,7 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) tmp->reason = eTDLS_LINK_UNSPECIFIED; tmp->staId = 0; tmp->discovery_attempt = 0; + tmp->discovery_cycles_retry_cnt = 0; } } } @@ -1034,6 +1041,7 @@ void wlan_hdd_tdls_set_peer_link_status(hddTdlsPeer_t *curr_peer, if (status >= eTDLS_LINK_DISCOVERED) { curr_peer->discovery_attempt = 0; + curr_peer->discovery_cycles_retry_cnt = 0; } mutex_unlock(&pHddCtx->tdls_lock); @@ -1091,6 +1099,7 @@ void wlan_hdd_tdls_set_link_status(hdd_adapter_t *pAdapter, if (linkStatus >= eTDLS_LINK_DISCOVERED) { curr_peer->discovery_attempt = 0; + curr_peer->discovery_cycles_retry_cnt = 0; } mutex_unlock(&pHddCtx->tdls_lock); @@ -2525,14 +2534,19 @@ void wlan_hdd_tdls_implicit_send_discovery_request(tdlsCtx_t * pHddTdlsCtx) */ if (FALSE == curr_peer->isForcedPeer) { - if (curr_peer->discovery_attempt >= - pHddTdlsCtx->threshold_config.discovery_tries_n) - { + if ((curr_peer->discovery_cycles_retry_cnt >= + MAX_TDLS_DISCOVERY_CYCLE_RETRIES) || + ((curr_peer->discovery_cycles_retry_cnt != 0) && + (curr_peer->discovery_cycles_retry_cnt < + MAX_TDLS_DISCOVERY_CYCLE_RETRIES) && + (adf_os_ticks_to_msecs(HDD_BW_GET_DIFF(jiffies, + curr_peer->last_discovery_req_cycle_ts)) <= + MIN_TDLS_DISCOVERY_CYCLE_RETRY_TIME))) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: discovery attempt (%d) reached max (%d) for peer " + "%s: discovery attempt (%d), discovery cycle retry count (%d) for peer " MAC_ADDRESS_STR ", ignore discovery trigger from fw", __func__, curr_peer->discovery_attempt, - pHddTdlsCtx->threshold_config.discovery_tries_n, + curr_peer->discovery_cycles_retry_cnt, MAC_ADDR_ARRAY(curr_peer->peerMac)); curr_peer->tdls_support = eTDLS_CAP_NOT_SUPPORTED; /* Since TDLS discovery attempt reached the |
