Răsfoiți Sursa

qcacmn: Fill metadata for sawf feature

Fill metadata for transmission in lithium and berrylium
when sawf is enabled.

Change-Id: Icc76ca7b8310c21a98e7f01984d4901afba0526c
CRs-Fixed: 3138558
Varsha Mishra 3 ani în urmă
părinte
comite
0d2ec58510
5 a modificat fișierele cu 125 adăugiri și 0 ștergeri
  1. 36 0
      dp/wifi3.0/be/dp_be_tx.c
  2. 27 0
      dp/wifi3.0/dp_htt.c
  3. 10 0
      dp/wifi3.0/dp_tx.h
  4. 1 0
      dp/wifi3.0/dp_types.h
  5. 51 0
      dp/wifi3.0/li/dp_li_tx.c

+ 36 - 0
dp/wifi3.0/be/dp_be_tx.c

@@ -500,6 +500,37 @@ void dp_tx_mlo_mcast_handler_be(struct dp_soc *soc,
 }
 #endif
 
+#ifdef CONFIG_SAWF
+void dp_sawf_config_be(struct dp_soc *soc, uint32_t *hal_tx_desc_cached,
+		       uint16_t *fw_metadata, qdf_nbuf_t nbuf)
+{
+	uint8_t q_id = 0;
+
+	if (wlan_cfg_get_sawf_config(soc->wlan_cfg_ctx))
+		return;
+
+	dp_sawf_tcl_cmd(fw_metadata, nbuf);
+	q_id = dp_sawf_queue_id_get(nbuf);
+
+	if (q_id == DP_SAWF_DEFAULT_Q_INVALID)
+		return;
+
+	hal_tx_desc_set_hlos_tid(hal_tx_desc_cached, (q_id & 0x0e) >> 1);
+	hal_tx_desc_set_flow_override_enable(hal_tx_desc_cached, 1);
+	hal_tx_desc_set_flow_override(hal_tx_desc_cached, q_id & 0x1);
+	hal_tx_desc_set_who_classify_info_sel(hal_tx_desc_cached,
+					      (q_id & 0x30) >> 4);
+}
+
+#else
+
+static inline
+void dp_sawf_config_be(struct dp_soc *soc, uint32_t *hal_tx_desc_cached,
+		       uint16_t *fw_metadata, qdf_nbuf_t nbuf)
+{
+}
+#endif
+
 QDF_STATUS
 dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev,
 		    struct dp_tx_desc_s *tx_desc, uint16_t fw_metadata,
@@ -540,6 +571,11 @@ dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev,
 
 	hal_tx_desc_cached = (void *)cached_desc;
 
+	if (dp_sawf_tag_valid_get(tx_desc->nbuf)) {
+		dp_sawf_config_be(soc, hal_tx_desc_cached,
+				  &fw_metadata, tx_desc->nbuf);
+	}
+
 	hal_tx_desc_set_buf_addr_be(soc->hal_soc, hal_tx_desc_cached,
 				    tx_desc->dma_addr, bm_id, tx_desc->id,
 				    (tx_desc->flags & DP_TX_DESC_FLAG_FRAG));

+ 27 - 0
dp/wifi3.0/dp_htt.c

@@ -2413,6 +2413,27 @@ static void dp_sawf_def_queues_update_map_report_conf(struct htt_soc *soc,
 {}
 #endif
 
+#ifdef CONFIG_SAWF
+/*
+ * dp_sawf_msduq_map() - Msdu queue creation information received
+ * from target
+ * @soc: soc handle.
+ * @msg_word: Pointer to htt msg word.
+ * @htt_t2h_msg: HTT message nbuf
+ *
+ * @return: void
+ */
+static void dp_sawf_msduq_map(struct htt_soc *soc, uint32_t *msg_word,
+			      qdf_nbuf_t htt_t2h_msg)
+{
+	dp_htt_sawf_msduq_map(soc, msg_word, htt_t2h_msg);
+}
+#else
+static void dp_sawf_msduq_map(struct htt_soc *soc, uint32_t *msg_word,
+			      qdf_nbuf_t htt_t2h_msg)
+{}
+#endif
+
 /*
  * time_allow_print() - time allow print
  * @htt_ring_tt:	ringi_id array of timestamps
@@ -3403,6 +3424,12 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
 							  htt_t2h_msg);
 		break;
 	}
+	case HTT_T2H_SAWF_MSDUQ_INFO_IND:
+	{
+		dp_sawf_msduq_map(soc, msg_word, htt_t2h_msg);
+		break;
+	}
+
 	default:
 		break;
 	};

+ 10 - 0
dp/wifi3.0/dp_tx.h

@@ -28,6 +28,9 @@
 #include "dp_internal.h"
 #include "hal_tx.h"
 #include <qdf_tracepoint.h>
+#ifdef CONFIG_SAWF
+#include "dp_sawf.h"
+#endif
 
 #define DP_INVALID_VDEV_ID 0xFF
 
@@ -981,4 +984,11 @@ void dp_tx_desc_check_corruption(struct dp_tx_desc_s *tx_desc)
 }
 #endif
 
+#ifndef CONFIG_SAWF
+static inline bool dp_sawf_tag_valid_get(qdf_nbuf_t nbuf)
+{
+	return false;
+}
+#endif
+
 #endif

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

@@ -243,6 +243,7 @@ enum dp_mod_id {
 	DP_MOD_ID_MISC,
 	DP_MOD_ID_MSCS,
 	DP_MOD_ID_TX,
+	DP_MOD_ID_SAWF,
 	DP_MOD_ID_MAX,
 };
 

+ 51 - 0
dp/wifi3.0/li/dp_li_tx.c

@@ -327,6 +327,52 @@ void dp_tx_clear_consumed_hw_descs(struct dp_soc *soc,
 }
 #endif /* CLEAR_SW2TCL_CONSUMED_DESC */
 
+#ifdef CONFIG_SAWF
+/**
+ * dp_sawf_config_li - Configure sawf specific fields in tcl
+ *
+ * @soc: DP soc handle
+ * @hhal_tx_desc_cached: tx descriptor
+ * @vdev_id: vdev id
+ * @nbuf: skb buffer
+ *
+ * Return: void
+ */
+static inline
+void dp_sawf_config_li(struct dp_soc *soc, uint32_t *hal_tx_desc_cached,
+		       uint16_t *fw_metadata, uint16_t vdev_id,
+		       qdf_nbuf_t nbuf)
+{
+	uint8_t q_id = 0;
+	uint32_t search_index;
+
+	if (wlan_cfg_get_sawf_config(soc->wlan_cfg_ctx))
+		return;
+
+	dp_sawf_tcl_cmd(fw_metadata, nbuf);
+	q_id = dp_sawf_queue_id_get(nbuf);
+
+	if (q_id == DP_SAWF_DEFAULT_Q_INVALID)
+		return;
+
+	search_index = dp_sawf_get_search_index(soc, nbuf, vdev_id,
+						q_id);
+	hal_tx_desc_set_hlos_tid(hal_tx_desc_cached, (q_id & 0x7));
+	hal_tx_desc_set_search_type_li(soc->hal_soc, hal_tx_desc_cached, 2);
+	hal_tx_desc_set_search_index_li(soc->hal_soc, hal_tx_desc_cached,
+					search_index);
+}
+
+#else
+
+static inline
+void dp_sawf_config_li(struct dp_soc *soc, uint32_t *hal_tx_desc_cached,
+		       uint16_t *fw_metadata, uint16_t vdev_id,
+		       qdf_nbuf_t nbuf)
+{
+}
+#endif
+
 QDF_STATUS
 dp_tx_hw_enqueue_li(struct dp_soc *soc, struct dp_vdev *vdev,
 		    struct dp_tx_desc_s *tx_desc, uint16_t fw_metadata,
@@ -381,6 +427,11 @@ dp_tx_hw_enqueue_li(struct dp_soc *soc, struct dp_vdev *vdev,
 	hal_tx_desc_set_cache_set_num(soc->hal_soc, hal_tx_desc_cached,
 				      (vdev->bss_ast_hash & 0xF));
 
+	if (dp_sawf_tag_valid_get(tx_desc->nbuf)) {
+		dp_sawf_config_li(soc, hal_tx_desc_cached, &fw_metadata,
+				  vdev->vdev_id, tx_desc->nbuf);
+	}
+
 	hal_tx_desc_set_fw_metadata(hal_tx_desc_cached, fw_metadata);
 	hal_tx_desc_set_buf_length(hal_tx_desc_cached, tx_desc->length);
 	hal_tx_desc_set_buf_offset(hal_tx_desc_cached, tx_desc->pkt_offset);