From 62a007fefe253643fbcba8bfb8edcc4a13dbc234 Mon Sep 17 00:00:00 2001
From: "sujuan.chen" <sujuan.chen@mediatek.com>
Date: Thu, 13 Apr 2023 14:12:16 +0800
Subject: [PATCH 2007/2010] wifi: mt76: mt7996: wed: add mt7996_net_setup_tc to
 support wifi2wifi offload

Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com>
---
 mt7996/main.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/mt7996/main.c b/mt7996/main.c
index 1a659d1..fdd73d3 100644
--- a/mt7996/main.c
+++ b/mt7996/main.c
@@ -1450,6 +1450,24 @@ mt7996_net_fill_forward_path(struct ieee80211_hw *hw,
 	return 0;
 }
 
+static int mt7996_net_setup_tc(struct ieee80211_hw *hw,
+			       struct ieee80211_vif *vif,
+			       struct net_device *ndev,
+			       enum tc_setup_type type,
+			       void *type_data)
+
+{
+	struct mt7996_dev *dev = mt7996_hw_dev(hw);
+	struct mtk_wed_device *wed = &dev->mt76.mmio.wed;
+
+	if (!mtk_wed_device_active(wed))
+		return -ENODEV;
+
+	mtk_wed_device_setup_tc(wed, ndev, type, type_data);
+
+	return 0;
+}
+
 #endif
 
 const struct ieee80211_ops mt7996_ops = {
@@ -1500,5 +1518,6 @@ const struct ieee80211_ops mt7996_ops = {
 	.set_radar_background = mt7996_set_radar_background,
 #ifdef CONFIG_NET_MEDIATEK_SOC_WED
 	.net_fill_forward_path = mt7996_net_fill_forward_path,
+	.net_setup_tc = mt7996_net_setup_tc,
 #endif
 };
-- 
2.18.0

