Browse Source

qcacmn: Define CDP ops and DP context for SAWF

- Add CDP ops for SAWF default queue mapping.
- Initialize DP context per peer.

Change-Id: Ic9c4e7d197aeeaa4ed19376ec4007711e86cbe5f
CRs-Fixed: 3128801
Ripan Deuri 3 years ago
parent
commit
351c175a02
4 changed files with 54 additions and 0 deletions
  1. 17 0
      dp/inc/cdp_txrx_ops.h
  2. 20 0
      dp/wifi3.0/dp_main.c
  3. 14 0
      dp/wifi3.0/dp_peer.h
  4. 3 0
      dp/wifi3.0/dp_types.h

+ 17 - 0
dp/inc/cdp_txrx_ops.h

@@ -1899,6 +1899,20 @@ struct cdp_mesh_latency_ops {
 };
 #endif
 
+#ifdef CONFIG_SAWF_DEF_QUEUES
+struct cdp_sawf_ops {
+	QDF_STATUS
+	(*sawf_def_queues_map_req)(struct cdp_soc_t *soc, uint8_t *mac_addr,
+				   uint8_t svc_class_id);
+	QDF_STATUS
+	(*sawf_def_queues_unmap_req)(struct cdp_soc_t *soc, uint8_t *mac_addr,
+				     uint8_t svc_class_id);
+	QDF_STATUS
+	(*sawf_def_queues_get_map_report)(struct cdp_soc_t *soc,
+					  uint8_t *mac_addr);
+};
+#endif
+
 struct cdp_ops {
 	struct cdp_cmn_ops          *cmn_drv_ops;
 	struct cdp_ctrl_ops         *ctrl_ops;
@@ -1943,5 +1957,8 @@ struct cdp_ops {
 #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
 	struct cdp_mlo_ops  *mlo_ops;
 #endif
+#ifdef CONFIG_SAWF_DEF_QUEUES
+	struct cdp_sawf_ops  *sawf_ops;
+#endif
 };
 #endif

+ 20 - 0
dp/wifi3.0/dp_main.c

@@ -88,6 +88,9 @@ cdp_dump_flow_pool_info(struct cdp_soc_t *soc)
 #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
 #include <dp_swlm.h>
 #endif
+#ifdef CONFIG_SAWF_DEF_QUEUES
+#include "dp_sawf.h"
+#endif
 
 #ifdef WLAN_FEATURE_STATS_EXT
 #define INIT_RX_HW_STATS_LOCK(_soc) \
@@ -7084,6 +7087,9 @@ dp_peer_create_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
 	dp_local_peer_id_alloc(pdev, peer);
 	DP_STATS_INIT(peer);
 
+	if (dp_peer_sawf_ctx_alloc(soc, peer) != QDF_STATUS_SUCCESS)
+		dp_warn("peer sawf context alloc failed");
+
 	dp_peer_update_state(soc, peer, DP_PEER_STATE_INIT);
 
 	dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_CDP);
@@ -8028,6 +8034,8 @@ void dp_peer_unref_delete(struct dp_peer *peer, enum dp_mod_id mod_id)
 		dp_peer_debug("Deleting peer %pK ("QDF_MAC_ADDR_FMT")", peer,
 			      QDF_MAC_ADDR_REF(peer->mac_addr.raw));
 
+		dp_peer_sawf_ctx_free(soc, peer);
+
 		wlan_minidump_remove(peer, sizeof(*peer), soc->ctrl_psoc,
 				     WLAN_MD_DP_PEER, "dp_peer");
 
@@ -12317,6 +12325,15 @@ static struct cdp_mesh_latency_ops dp_ops_mesh_latency = {
 };
 #endif
 
+#ifdef CONFIG_SAWF_DEF_QUEUES
+static struct cdp_sawf_ops dp_ops_sawf = {
+	.sawf_def_queues_map_req = dp_sawf_def_queues_map_req,
+	.sawf_def_queues_unmap_req = dp_sawf_def_queues_unmap_req,
+	.sawf_def_queues_get_map_report =
+		dp_sawf_def_queues_get_map_report,
+};
+#endif
+
 #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
 /**
  * dp_flush_ring_hptp() - Update ring shadow
@@ -13147,6 +13164,9 @@ static void dp_soc_txrx_ops_attach(struct dp_soc *soc)
 #ifdef WLAN_SUPPORT_MESH_LATENCY
 	soc->cdp_soc.ops->mesh_latency_ops = &dp_ops_mesh_latency;
 #endif
+#ifdef CONFIG_SAWF_DEF_QUEUES
+	soc->cdp_soc.ops->sawf_ops = &dp_ops_sawf;
+#endif
 };
 
 /*

+ 14 - 0
dp/wifi3.0/dp_peer.h

@@ -945,6 +945,20 @@ void dp_peer_jitter_stats_ctx_clr(struct dp_txrx_peer *txrx_peer)
 }
 #endif
 
+#ifndef CONFIG_SAWF_DEF_QUEUES
+static inline QDF_STATUS dp_peer_sawf_ctx_alloc(struct dp_soc *soc,
+						struct dp_peer *peer)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS dp_peer_sawf_ctx_free(struct dp_soc *soc,
+					       struct dp_peer *peer)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+#endif
 struct dp_peer *dp_vdev_bss_peer_ref_n_get(struct dp_soc *soc,
 					   struct dp_vdev *vdev,
 					   enum dp_mod_id mod_id);

+ 3 - 0
dp/wifi3.0/dp_types.h

@@ -3863,6 +3863,9 @@ struct dp_peer {
 	uint8_t num_links;
 	DP_MUTEX_TYPE link_peers_info_lock;
 #endif
+#ifdef CONFIG_SAWF_DEF_QUEUES
+	struct dp_peer_sawf *sawf;
+#endif
 };
 
 /*