Browse Source

qcacld-3.0: Tune TDLS code for discovery response

Currently, TDLS code sends setup request and then forwards
TDLS discovery response frame. For MLO case, since supplicant
gets the link id from the link identifier element of discovery
response frame, there is issue when supplicant tries to add
new station because link id has not been properly set.

To resolve this issue, tune the TDLS code to forward the TDLS
discovery response frame first and then send setup request event.

Change-Id: I89b501fc4da8615ddb8973e5edce73294793558f
CRs-Fixed: 3528071
Paul Zhang 1 year ago
parent
commit
69dc57263c
2 changed files with 13 additions and 12 deletions
  1. 6 5
      components/tdls/core/src/wlan_tdls_ct.c
  2. 7 7
      components/tdls/core/src/wlan_tdls_mgmt.c

+ 6 - 5
components/tdls/core/src/wlan_tdls_ct.c

@@ -105,7 +105,7 @@ void tdls_discovery_timeout_peer_cb(void *user_data)
 
 	vdev = (struct wlan_objmgr_vdev *)user_data;
 	tdls_soc = wlan_vdev_get_tdls_soc_obj(vdev);
-	if (wlan_vdev_mlme_is_mlo_vdev(vdev) &&
+	if (wlan_vdev_mlme_is_mlo_vdev(vdev) && tdls_soc &&
 	    qdf_atomic_dec_and_test(&tdls_soc->timer_cnt)) {
 		tdls_process_mlo_cal_tdls_link_score(vdev);
 		select_vdev = tdls_process_mlo_choice_tdls_vdev(vdev);
@@ -124,13 +124,14 @@ void tdls_discovery_timeout_peer_cb(void *user_data)
 				tdls_notice("[TDLS] TDLS Discovery Response,"
 					    "QDF_MAC_ADDR_FMT RSSI[%d]<---OTA",
 					    rx_mgmt->rx_rssi);
-				tdls_recv_discovery_resp(tdls_vdev, mac);
-				tdls_set_rssi(tdls_vdev->vdev, mac,
-					      rx_mgmt->rx_rssi);
-				if (tdls_soc && tdls_soc->tdls_rx_cb)
+				if (tdls_soc->tdls_rx_cb)
 					tdls_soc->tdls_rx_cb(
 						     tdls_soc->tdls_rx_cb_data,
 						     rx_mgmt);
+
+				tdls_recv_discovery_resp(tdls_vdev, mac);
+				tdls_set_rssi(tdls_vdev->vdev, mac,
+					      rx_mgmt->rx_rssi);
 			}
 
 			qdf_mem_free(tdls_vdev->rx_mgmt);

+ 7 - 7
components/tdls/core/src/wlan_tdls_mgmt.c

@@ -509,6 +509,9 @@ static QDF_STATUS tdls_process_rx_mgmt(
 			    QDF_MAC_ADDR_FMT " RSSI[%d] <--- OTA",
 			    QDF_MAC_ADDR_REF(mac), rx_mgmt->rx_rssi);
 
+		if (tdls_soc_obj->tdls_rx_cb)
+			tdls_soc_obj->tdls_rx_cb(tdls_soc_obj->tdls_rx_cb_data,
+						 rx_mgmt);
 		tdls_debug("discovery resp on vdev %d", wlan_vdev_get_id(vdev));
 		tdls_recv_discovery_resp(tdls_vdev, mac);
 		tdls_set_rssi(tdls_vdev->vdev, mac, rx_mgmt->rx_rssi);
@@ -525,14 +528,11 @@ static QDF_STATUS tdls_process_rx_mgmt(
 			tdls_notice("[TDLS] %s <--- OTA",
 				   tdls_action_frames_type[action_frame_type]);
 		}
-	}
 
-	/* tdls_soc_obj->tdls_rx_cb ==> wlan_cfg80211_tdls_rx_callback() */
-	if (tdls_soc_obj && tdls_soc_obj->tdls_rx_cb)
-		tdls_soc_obj->tdls_rx_cb(tdls_soc_obj->tdls_rx_cb_data,
-					 rx_mgmt);
-	else
-		tdls_debug("rx mgmt, but no valid up layer callback");
+		if (tdls_soc_obj->tdls_rx_cb)
+			tdls_soc_obj->tdls_rx_cb(tdls_soc_obj->tdls_rx_cb_data,
+						 rx_mgmt);
+	}
 
 	if (tdls_vdev_select && tdls_vdev->rx_mgmt) {
 		qdf_mem_free(tdls_vdev->rx_mgmt);