summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Agarwal <himanaga@qti.qualcomm.com>2016-08-03 20:14:56 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-08-09 18:00:36 +0530
commit16865bc87bcf8d7f5a4fb17ce8f095394c9dd6a5 (patch)
tree3671c03e65f062ea354125a0355f69d3a65cea09
parent0391f99f6604442eba057109ab85784fd78fad4c (diff)
qcacld-2.0: Add support to add one more cycle of TDLS discoveries
Presently, HOST driver sends a TDLS discovery request and then wait for some time for either the request to get timed out or to get a discovery response. With the current implementation, HOST driver waits for 5 discovery requests to get timed out and then stop sending TDLS discovery requests whenever a trigger is received from fw assuming that the peer is not interested in making a connection. Now, if the peer device has gone in SSR or driver is unloaded then it will not get a response and 5 retries will be over and then whenever the device will come up, TDLS connection will not be set up as maximum retries have already been reached. Add one more cycle of 5 discovery requests after a wait time of 5 minutes. So if 5 retries have happened then driver waits for 5 minutes and then again starts sending TDLS discovery requests until situation of 5 retries occurs again and then go back to the old behaviour of never sending a discovery request. The benefit is that if 5 retries of first cycle gets completed because the peer device is in SSR or in bad state then hopefully it will be recovered in next 5 minutes when it will start sending discovery requests again and form a TDLS connection. Change-Id: If1f5764c517bf79be37cbaecd3e7db895bee01df CRs-Fixed: 1051071
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h2
-rw-r--r--CORE/HDD/inc/wlan_hdd_tdls.h5
-rw-r--r--CORE/HDD/src/wlan_hdd_ipa.c1
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c1
-rw-r--r--CORE/HDD/src/wlan_hdd_tdls.c24
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