Эх сурвалжийг харах

qcacld-3.0: Allow staid with 0 as valid for TDLS Peer

Staid with 0 value is considered invalid for TDLS peer.
But Staid with 0 should not be invalid.

The fix is to allow staid with 0 value as valid for
TDLS peer, and assign 0xFF as invalid staid for TDLS
peer.

Change-Id: Ia175c7f1621e7ac0bb826c60fad4ce98dbd41d44
CRs-Fixed: 2041406
Nishank Aggarwal 8 жил өмнө
parent
commit
4dbbc919f8

+ 1 - 1
core/hdd/inc/wlan_hdd_assoc.h

@@ -45,7 +45,7 @@
 #define HDD_MAX_NUM_TDLS_STA          8
 #define HDD_MAX_NUM_TDLS_STA_P_UAPSD_OFFCHAN  1
 #define TDLS_STA_INDEX_VALID(staId) \
-	(((staId) >= 1) && ((staId) < 0xFF))
+	(((staId) >= 0) && ((staId) < 0xFF))
 #endif
 #define TKIP_COUNTER_MEASURE_STARTED 1
 #define TKIP_COUNTER_MEASURE_STOPED  0

+ 2 - 0
core/hdd/src/wlan_hdd_cfg80211.h

@@ -117,6 +117,8 @@ static inline void wlan_hdd_clear_link_layer_stats(hdd_adapter_t *adapter) {}
 #define USE_CFG80211_DEL_STA_V2
 #endif
 
+#define OL_TXRX_INVALID_TDLS_PEER_ID 0xff
+
 /**
  * enum eDFS_CAC_STATUS: CAC status
  *

+ 5 - 3
core/hdd/src/wlan_hdd_tdls.c

@@ -295,7 +295,8 @@ void wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_context_t *hddctx)
 		hdd_roam_deregister_tdlssta(adapter,
 			hddctx->tdlsConnInfo[staidx].staId);
 		wlan_hdd_tdls_decrement_peer_count(adapter);
-		hddctx->tdlsConnInfo[staidx].staId = 0;
+		hddctx->tdlsConnInfo[staidx].staId =
+						OL_TXRX_INVALID_TDLS_PEER_ID;
 		hddctx->tdlsConnInfo[staidx].sessionId = 255;
 
 		qdf_mem_zero(&hddctx->tdlsConnInfo[staidx].peerMac,
@@ -639,7 +640,7 @@ static void wlan_hdd_tdls_del_non_forced_peers(tdlsCtx_t *hdd_tdls_ctx)
 			} else {
 				peer->link_status = eTDLS_LINK_IDLE;
 				peer->reason = eTDLS_LINK_UNSPECIFIED;
-				peer->staId = 0;
+				peer->staId = OL_TXRX_INVALID_TDLS_PEER_ID;
 				peer->discovery_attempt = 0;
 			}
 		}
@@ -1023,6 +1024,7 @@ hddTdlsPeer_t *wlan_hdd_tdls_get_peer(hdd_adapter_t *pAdapter, const u8 *mac)
 		return NULL;
 	}
 
+	peer->staId = 0xff;
 	pHddTdlsCtx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
 
 	if (NULL == pHddTdlsCtx) {
@@ -2402,7 +2404,7 @@ int wlan_hdd_tdls_reset_peer(hdd_adapter_t *pAdapter, const uint8_t *mac)
 	wlan_hdd_tdls_set_peer_link_status(curr_peer,
 					   eTDLS_LINK_IDLE,
 					   eTDLS_LINK_UNSPECIFIED);
-	curr_peer->staId = 0;
+	curr_peer->staId = OL_TXRX_INVALID_TDLS_PEER_ID;
 ret_status:
 	return status;
 }