TDLS: Optimize TDLS External Control operation handling.
Commit "Initiate the TDLS setup only when externally configured"
defined an additional data structure to represent a force peer.
Optimize this implementation by defining a new field isForcedPeer,
signifying a forced peer, in TDLS peer data structure (hddTdlsPeer_t).
CRs-fixed: 537537
Change-Id: Ibf55499fc648868e04a2ec9f18f5dce94fe61108
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index fd64ef6..76a770c 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -8572,8 +8572,6 @@
return -ENOTSUPP;
}
- if ( 0 != wlan_hdd_tdls_remove_force_peer(pAdapter, peer) )
- return -EINVAL;
pTdlsPeer = wlan_hdd_tdls_find_peer(pAdapter, peer, TRUE);
@@ -8581,11 +8579,15 @@
hddLog(VOS_TRACE_LEVEL_INFO, "%s: " MAC_ADDRESS_STR
" peer not exsting",
__func__, MAC_ADDR_ARRAY(peer));
+ return -EINVAL;
}
else {
wlan_hdd_tdls_indicate_teardown(pAdapter, pTdlsPeer,
eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON);
}
+
+ if ( 0 != wlan_hdd_tdls_set_force_peer(pAdapter, peer, FALSE) )
+ return -EINVAL;
break;
}
case NL80211_TDLS_SETUP:
@@ -8604,13 +8606,6 @@
return -ENOTSUPP;
}
- if ( 0 != wlan_hdd_tdls_add_force_peer(pAdapter, peer) ) {
-
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
- " %s TDLS Add Force Peer Failed",
- __func__);
- return -EINVAL;
- }
/* To cater the requirement of establishing the TDLS link
* irrespective of the data traffic , get an entry of TDLS peer.
*/
@@ -8621,6 +8616,14 @@
__func__, MAC_ADDR_ARRAY(peer));
return -EINVAL;
}
+
+ if ( 0 != wlan_hdd_tdls_set_force_peer(pAdapter, peer, TRUE) ) {
+
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ " %s TDLS Add Force Peer Failed",
+ __func__);
+ return -EINVAL;
+ }
break;
}
case NL80211_TDLS_DISCOVERY_REQ: