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

qcacld-3.0: Handle T2LM teardown action frame

When a T2LM teardown action frame is received clear the
previously negotiated peer level t2lm mapping and update
FW with established mapping if valid or default mapping
applies.

Change-Id: I7951c76fe3d6c1bf231300675f2b954ff7697b39
CRs-Fixed: 3420421
Amruta Kulkarni 2 жил өмнө
parent
commit
8ffbb6dd25

+ 17 - 0
components/umac/mlme/mlo_mgr/inc/wlan_t2lm_api.h

@@ -133,6 +133,7 @@ QDF_STATUS t2lm_handle_rx_resp(struct wlan_objmgr_vdev *vdev,
 /**
  * t2lm_handle_rx_teardown - Handler for parsing T2LM action frame
  * @vdev: vdev pointer
+ * @peer: peer pointer
  * @event_data: T2LM event data pointer
  *
  * This api will be called to parsing T2LM teardown action frame.
@@ -140,6 +141,7 @@ QDF_STATUS t2lm_handle_rx_resp(struct wlan_objmgr_vdev *vdev,
  * Return: qdf_status
  */
 QDF_STATUS t2lm_handle_rx_teardown(struct wlan_objmgr_vdev *vdev,
+				   struct wlan_objmgr_peer *peer,
 				   void *event_data);
 
 /**
@@ -183,6 +185,16 @@ QDF_STATUS wlan_t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
 				   enum wlan_t2lm_evt event,
 				   void *event_data,
 				   uint8_t *dialog_token);
+
+/**
+ * wlan_t2lm_clear_peer_negotiation - Clear previously
+ * negotiated peer level TID-to-link-mapping.
+ * @peer: pointer to peer
+ *
+ * Return: none
+ */
+void
+wlan_t2lm_clear_peer_negotiation(struct wlan_objmgr_peer *peer);
 #else
 static inline QDF_STATUS
 t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
@@ -215,6 +227,7 @@ t2lm_handle_rx_resp(struct wlan_objmgr_vdev *vdev,
 
 static inline QDF_STATUS
 t2lm_handle_rx_teardown(struct wlan_objmgr_vdev *vdev,
+			struct wlan_objmgr_peer *peer,
 			void *event_data)
 {
 	return QDF_STATUS_E_NOSUPPORT;
@@ -234,6 +247,10 @@ wlan_t2lm_validate_candidate(struct cnx_mgr *cm_ctx,
 	return QDF_STATUS_E_NOSUPPORT;
 }
 
+static inline void
+wlan_t2lm_clear_peer_negotiation(struct wlan_objmgr_peer *peer)
+{}
+
 static inline
 QDF_STATUS wlan_t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
 				   struct wlan_objmgr_peer *peer,

+ 55 - 1
components/umac/mlme/mlo_mgr/src/wlan_t2lm_api.c

@@ -179,8 +179,38 @@ QDF_STATUS t2lm_handle_rx_resp(struct wlan_objmgr_vdev *vdev,
 }
 
 QDF_STATUS t2lm_handle_rx_teardown(struct wlan_objmgr_vdev *vdev,
+				   struct wlan_objmgr_peer *peer,
 				   void *event_data)
 {
+	struct wlan_mlo_dev_context *mlo_dev_ctx;
+	struct wlan_t2lm_context *t2lm_ctx;
+
+	if (!peer) {
+		t2lm_err("peer is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	if (!vdev) {
+		t2lm_err("vdev is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	mlo_dev_ctx = vdev->mlo_dev_ctx;
+	if (!mlo_dev_ctx) {
+		t2lm_err("mlo dev ctx is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	t2lm_ctx = &mlo_dev_ctx->t2lm_ctx;
+	if (!t2lm_ctx) {
+		t2lm_err("t2lm ctx is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	wlan_t2lm_clear_peer_negotiation(peer);
+	wlan_send_tid_to_link_mapping(vdev,
+				      &t2lm_ctx->established_t2lm.t2lm);
+
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -219,7 +249,7 @@ QDF_STATUS t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
 		status = t2lm_handle_rx_resp(vdev, event_data, token);
 		break;
 	case WLAN_T2LM_EV_ACTION_FRAME_RX_TEARDOWN:
-		status = t2lm_handle_rx_teardown(vdev, event_data);
+		status = t2lm_handle_rx_teardown(vdev, peer, event_data);
 		break;
 	case WLAN_T2LM_EV_ACTION_FRAME_TX_TEARDOWN:
 		status = t2lm_handle_tx_teardown(vdev, event_data);
@@ -347,6 +377,30 @@ end:
 	return status;
 }
 
+void
+wlan_t2lm_clear_peer_negotiation(struct wlan_objmgr_peer *peer)
+{
+	struct wlan_mlo_peer_context *ml_peer;
+	struct wlan_prev_t2lm_negotiated_info *t2lm_negotiated_info;
+
+	uint8_t i;
+
+	ml_peer = peer->mlo_peer_ctx;
+	if (!ml_peer) {
+		t2lm_err("ml peer is null");
+		return;
+	}
+
+	qdf_mem_zero(&ml_peer->t2lm_policy.t2lm_negotiated_info.t2lm_info,
+		     sizeof(struct wlan_t2lm_info) * WLAN_T2LM_MAX_DIRECTION);
+
+	ml_peer->t2lm_policy.t2lm_negotiated_info.dialog_token = 0;
+	t2lm_negotiated_info = &ml_peer->t2lm_policy.t2lm_negotiated_info;
+	for (i = 0; i < WLAN_T2LM_MAX_DIRECTION; i++)
+		t2lm_negotiated_info->t2lm_info[i].direction =
+				WLAN_T2LM_INVALID_DIRECTION;
+}
+
 QDF_STATUS wlan_t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
 				   struct wlan_objmgr_peer *peer,
 				   enum wlan_t2lm_evt event,