Jelajahi Sumber

qcacmn: Define cdp call for SCS peer lookup and rule match

Add function pointer declaration for SCS peer lookup and rule
match and also define cdp call for the same.

Change-Id: I4329b746a12f019a077652d02625b76c7f5fa21f
CRs-Fixed: 3226475
Harsh Kumar Bijlani 3 tahun lalu
induk
melakukan
4e5e35a746
2 mengubah file dengan 68 tambahan dan 0 penghapusan
  1. 15 0
      dp/inc/cdp_txrx_ops.h
  2. 53 0
      dp/inc/cdp_txrx_scs.h

+ 15 - 0
dp/inc/cdp_txrx_ops.h

@@ -2069,6 +2069,18 @@ struct cdp_mesh_latency_ops {
 };
 #endif
 
+#ifdef WLAN_SUPPORT_SCS
+/**
+ * struct cdp_scs_ops - data path ops for SCS
+ * @scs_peer_lookup_n_rule_match : Handler for peer lookup and scs rule match
+ */
+struct cdp_scs_ops {
+	bool (*scs_peer_lookup_n_rule_match)(struct cdp_soc_t *soc,
+					     uint32_t rule_id,
+					     uint8_t *dst_mac_addr);
+};
+#endif
+
 #ifdef CONFIG_SAWF_DEF_QUEUES
 struct cdp_sawf_ops {
 	QDF_STATUS
@@ -2164,5 +2176,8 @@ struct cdp_ops {
 #ifdef CONFIG_SAWF_DEF_QUEUES
 	struct cdp_sawf_ops  *sawf_ops;
 #endif
+#ifdef WLAN_SUPPORT_SCS
+	struct cdp_scs_ops   *scs_ops;
+#endif
 };
 #endif

+ 53 - 0
dp/inc/cdp_txrx_scs.h

@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+#ifndef _CDP_TXRX_SCS_H_
+#define _CDP_TXRX_SCS_H_
+
+#ifdef WLAN_SUPPORT_SCS
+#include "cdp_txrx_handle.h"
+
+/**
+ * cdp_scs_peer_lookup_n_rule_match() - Find peer and check if SCS rule
+ *  is applicable for the peer or not
+ *
+ * @soc: soc handle
+ * @rule_id: scs rule id
+ * @dst_mac_addr: destination mac addr for peer lookup
+ *
+ * Return: bool true on success and false on failure
+ */
+static inline
+bool cdp_scs_peer_lookup_n_rule_match(ol_txrx_soc_handle soc,
+				      uint32_t rule_id, uint8_t *dst_mac_addr)
+{
+	if (!soc || !soc->ops) {
+		dp_cdp_debug("Invalid Instance");
+		QDF_BUG(0);
+		return false;
+	}
+
+	if (!soc->ops->scs_ops ||
+	    !soc->ops->scs_ops->scs_peer_lookup_n_rule_match)
+		return false;
+
+	return soc->ops->scs_ops->scs_peer_lookup_n_rule_match(soc, rule_id,
+							       dst_mac_addr);
+}
+#endif
+#endif