瀏覽代碼

qcacld-3.0: Add new files for T2LM handling

Add new files for TID to Link mapping handling.

Change-Id: I296a898e09b67490b85f4f7fba29322dbc3a757f
CRs-Fixed: 3322944
Amruta Kulkarni 2 年之前
父節點
當前提交
67e405ee90
共有 3 個文件被更改,包括 341 次插入1 次删除
  1. 2 1
      Kbuild
  2. 197 0
      components/umac/mlme/mlo_mgr/inc/wlan_t2lm_api.h
  3. 142 0
      components/umac/mlme/mlo_mgr/src/wlan_t2lm_api.c

+ 2 - 1
Kbuild

@@ -1377,7 +1377,8 @@ UMAC_MLO_MGR_OBJS := $(UMAC_MLO_MGR_CMN_DIR)/src/wlan_mlo_mgr_main.o \
 			  $(UMAC_MLO_MGR_CMN_DIR)/src/wlan_mlo_mgr_msgq.o \
 			  $(UMAC_MLO_MGR_CMN_DIR)/src/wlan_mlo_mgr_primary_umac.o \
 			  $(MLO_MGR_TARGET_IF_DIR)/src/target_if_mlo_mgr.o \
-			  $(UMAC_MLO_MGR_CLD_DIR)/src/wlan_mlo_mgr_roam.o
+			  $(UMAC_MLO_MGR_CLD_DIR)/src/wlan_mlo_mgr_roam.o \
+			  $(UMAC_MLO_MGR_CLD_DIR)/src/wlan_t2lm_api.o \
 
 $(call add-wlan-objs,umac_mlomgr,$(UMAC_MLO_MGR_OBJS))
 endif

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

@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * DOC: contains TID to Link mapping related functionality
+ */
+#ifndef _WLAN_T2LM_API_H_
+#define _WLAN_T2LM_API_H_
+
+#include "lim_types.h"
+#include "lim_utils.h"
+#include "lim_send_sme_rsp_messages.h"
+#include "parser_api.h"
+#include "lim_send_messages.h"
+
+#ifdef WLAN_FEATURE_11BE
+/**
+ * struct t2lm_event_data - TID to Link mapping event data
+ * @status: qdf status used to indicate if t2lm action frame status
+ * @data: event data
+ */
+struct t2lm_event_data {
+	QDF_STATUS status;
+	void *data;
+};
+
+/**
+ * enum wlan_t2lm_evt: T2LM manager events
+ * @WLAN_T2LM_EV_ACTION_FRAME_RX_REQ:Handle T2LM request frame received from AP
+ * @WLAN_T2LM_EV_ACTION_FRAME_TX_RESP:Handle T2LM response frame sent to AP
+ * @WLAN_T2LM_EV_ACTION_FRAME_TX_REQ:Handle T2LM request frame sent by STA
+ * @WLAN_T2LM_EV_ACTION_FRAME_RX_RESP:Handle T2LM response frame received from AP
+ * @WLAN_T2LM_EV_ACTION_FRAME_RX_TEARDOWN:Handle received teardown frame event
+ * @WLAN_T2LM_EV_ACTION_FRAME_TX_TEARDOWN:Handle sending teardown frame event
+ */
+enum wlan_t2lm_evt {
+	WLAN_T2LM_EV_ACTION_FRAME_RX_REQ = 0,
+	WLAN_T2LM_EV_ACTION_FRAME_TX_RESP = 1,
+	WLAN_T2LM_EV_ACTION_FRAME_TX_REQ = 2,
+	WLAN_T2LM_EV_ACTION_FRAME_RX_RESP = 3,
+	WLAN_T2LM_EV_ACTION_FRAME_RX_TEARDOWN = 4,
+	WLAN_T2LM_EV_ACTION_FRAME_TX_TEARDOWN = 5,
+	WLAN_T2LM_EV_ACTION_FRAME_MAX = 6,
+};
+
+/**
+ * t2lm_deliver_event - Handler to deliver T2LM event
+ * @vdev: vdev pointer
+ * @event: T2LM event
+ * @event_data: T2LM event data pointer
+ *
+ * This api will be called from lim  layers, to process T2LM event
+ *
+ * Return: qdf_status
+ */
+QDF_STATUS t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
+			      enum wlan_t2lm_evt event,
+			      struct t2lm_event_data *event_data);
+
+/**
+ * t2lm_handle_rx_req - Handler for parsing T2LM action frame
+ * @vdev: vdev pointer
+ * @event_data: T2LM event data pointer
+ *
+ * This api will be called from lim  layers, after T2LM action frame
+ * is received, the api will parse the T2LM request frame.
+ *
+ * Return: qdf_status
+ */
+QDF_STATUS t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
+			      struct t2lm_event_data *event_data);
+
+/**
+ * t2lm_handle_tx_resp - Handler for populating T2LM action frame
+ * @vdev: vdev pointer
+ * @event_data: T2LM event data pointer
+ *
+ * This api will be called to populate T2LM response action frame.
+ *
+ * Return: qdf_status
+ */
+QDF_STATUS t2lm_handle_tx_resp(struct wlan_objmgr_vdev *vdev,
+			       struct t2lm_event_data *event_data);
+
+/**
+ * t2lm_handle_tx_req - Handler for populating T2LM action frame
+ * @vdev: vdev pointer
+ * @event_data: T2LM event data pointer
+ *
+ * This api will be called to populate T2LM request action frame.
+ *
+ * Return: qdf_status
+ */
+QDF_STATUS t2lm_handle_tx_req(struct wlan_objmgr_vdev *vdev,
+			      struct t2lm_event_data *event_data);
+
+/**
+ * t2lm_handle_rx_resp - Handler for parsing T2LM action frame
+ * @vdev: vdev pointer
+ * @event_data: T2LM event data pointer
+ *
+ * This api will be called to parsing T2LM response action frame.
+ *
+ * Return: qdf_status
+ */
+QDF_STATUS t2lm_handle_rx_resp(struct wlan_objmgr_vdev *vdev,
+			       struct t2lm_event_data *event_data);
+
+/**
+ * t2lm_handle_rx_teardown - Handler for parsing T2LM action frame
+ * @vdev: vdev pointer
+ * @event_data: T2LM event data pointer
+ *
+ * This api will be called to parsing T2LM teardown action frame.
+ *
+ * Return: qdf_status
+ */
+QDF_STATUS t2lm_handle_rx_teardown(struct wlan_objmgr_vdev *vdev,
+				   struct t2lm_event_data *event_data);
+
+/**
+ * t2lm_handle_tx_teardown - Handler for populating T2LM action frame
+ * @vdev: vdev pointer
+ * @event_data: T2LM event data pointer
+ *
+ * This api will be called to populate T2LM teardown action frame.
+ *
+ * Return: qdf_status
+ */
+QDF_STATUS t2lm_handle_tx_teardown(struct wlan_objmgr_vdev *vdev,
+				   struct t2lm_event_data *event_data);
+
+#else
+static inline QDF_STATUS
+t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
+		   enum wlan_t2lm_evt event,
+		   struct t2lm_event_data *event_data)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
+		   struct t2lm_event_data *event_data)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+t2lm_handle_tx_resp(struct wlan_objmgr_vdev *vdev,
+		    struct t2lm_event_data *event_data)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
+		   struct t2lm_mgr_event_data *event_data)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
+		   struct t2lm_event_data *event_data)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
+		   struct t2lm_event_data *event_data)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+static inline QDF_STATUS
+t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
+		   struct t2lm_event_data *event_data)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
+#endif

+ 142 - 0
components/umac/mlme/mlo_mgr/src/wlan_t2lm_api.c

@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * DOC: contains TID to Link mapping related functionality
+ */
+#include <wlan_cmn.h>
+#include <wlan_cm_public_struct.h>
+#include "wlan_t2lm_api.h"
+
+static
+const char *t2lm_get_event_str(enum wlan_t2lm_evt event)
+{
+	if (event > WLAN_T2LM_EV_ACTION_FRAME_MAX)
+		return "";
+
+	switch (event) {
+	CASE_RETURN_STRING(WLAN_T2LM_EV_ACTION_FRAME_RX_REQ);
+	CASE_RETURN_STRING(WLAN_T2LM_EV_ACTION_FRAME_TX_RESP);
+	CASE_RETURN_STRING(WLAN_T2LM_EV_ACTION_FRAME_TX_REQ);
+	CASE_RETURN_STRING(WLAN_T2LM_EV_ACTION_FRAME_RX_RESP);
+	CASE_RETURN_STRING(WLAN_T2LM_EV_ACTION_FRAME_RX_TEARDOWN);
+	CASE_RETURN_STRING(WLAN_T2LM_EV_ACTION_FRAME_TX_TEARDOWN);
+	default:
+		return "Unknown";
+	}
+}
+
+QDF_STATUS t2lm_handle_rx_req(struct wlan_objmgr_vdev *vdev,
+			      struct t2lm_event_data *event_data)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS t2lm_handle_tx_resp(struct wlan_objmgr_vdev *vdev,
+			       struct t2lm_event_data *event_data)
+{
+	if (!vdev) {
+		mlme_err("vdev is NULL");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS t2lm_handle_tx_req(struct wlan_objmgr_vdev *vdev,
+			      struct t2lm_event_data *event_data)
+{
+	if (!vdev) {
+		mlme_err("vdev is NULL");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS t2lm_handle_rx_resp(struct wlan_objmgr_vdev *vdev,
+			       struct t2lm_event_data *event_data)
+{
+	if (!vdev) {
+		mlme_err("vdev is NULL");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS t2lm_handle_rx_teardown(struct wlan_objmgr_vdev *vdev,
+				   struct t2lm_event_data *event_data)
+{
+	if (!vdev) {
+		mlme_err("vdev is NULL");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS t2lm_handle_tx_teardown(struct wlan_objmgr_vdev *vdev,
+				   struct t2lm_event_data *event_data)
+{
+	if (!vdev) {
+		mlme_err("vdev is NULL");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS t2lm_deliver_event(struct wlan_objmgr_vdev *vdev,
+			      enum wlan_t2lm_evt event,
+			      struct t2lm_event_data *event_data)
+{
+	struct wlan_objmgr_psoc *psoc;
+	QDF_STATUS status;
+
+	psoc = wlan_vdev_get_psoc(vdev);
+	if (!psoc)
+		return QDF_STATUS_E_FAILURE;
+
+	mlme_debug("T2LM event received: %s(%d)",
+		   t2lm_get_event_str(event), event);
+
+	switch (event) {
+	case WLAN_T2LM_EV_ACTION_FRAME_RX_REQ:
+		status = t2lm_handle_rx_req(vdev, event_data);
+		break;
+	case WLAN_T2LM_EV_ACTION_FRAME_TX_RESP:
+		status = t2lm_handle_tx_resp(vdev, event_data);
+		break;
+	case WLAN_T2LM_EV_ACTION_FRAME_TX_REQ:
+		status = t2lm_handle_tx_req(vdev, event_data);
+		break;
+	case WLAN_T2LM_EV_ACTION_FRAME_RX_RESP:
+		status = t2lm_handle_rx_resp(vdev, event_data);
+		break;
+	case WLAN_T2LM_EV_ACTION_FRAME_RX_TEARDOWN:
+		status = t2lm_handle_rx_teardown(vdev, event_data);
+		break;
+	case WLAN_T2LM_EV_ACTION_FRAME_TX_TEARDOWN:
+		status = t2lm_handle_tx_teardown(vdev, event_data);
+		break;
+	default:
+		status = QDF_STATUS_E_FAILURE;
+		mlme_err("Unhandled T2LM event");
+	}
+
+	return status;
+}