[rdkb][common][bsp][Refactor and sync wifi from openwrt]

[Description]
ced8594f [MAC80211][WiFi6][Misc][Fix the MT76 WiFi6 Makefile]
7221999e [MAC80211][WiFi7][Misc][Correct the MAC80211 WiFi7 Makefile.]
9d87794a [MAC80211][WiFi7][Misc][Correct the MT76 WiFi7 Makefile.]
ff24e1b2 [openwrt-24][Mac80211][Fix patch conflict with upstream openwrt]
3a6c13e2 [mac80211][misc][fix patch fail due to openwrt update]
05763faa [MAC80211][WiFi7][misc][fix patch failed of wifi-scripts]
f34fd014 [mac80211][misc][fix patch fail due to openwrt update]
f6796660 [openwrt-24][Release][Fix build fail of Wi-Fi7 MT76]
7076d96c [MAC80211][WiFi7][Misc][Fix release build fail because of mt76 version upgradation]
1f748b17 [mac80211][misc][fix patch fail due to openwrt update]
95ba6722 [mac80211][misc][fix patch fail due to openwrt update]
17680d7f [MAC80211][WiFi7][misc][Rename eeprom of eFEM variants]
b97cefa1 [MAC80211][WiFi7][app][Add Griffin support for atenl/iwpriv]
6de718a4 [MAC80211][WiFi7][misc][fix wifi-scripts patch failed]
9f1ace86 [MAC80211][WiFi7][misc][fix hostapd Makefile patch]
e4d0d28e [MAC80211][Misc][Add MT7990 Firmware OpenWrt config]
f3a8a8f7 [MAC80211][Release][Fix build fail of Wi-Fi6 MT76]
dabe8eae [openwrt-24][common][bsp][Fix line ending]
6d438a9d [openwrt-24][common][bsp][Use zstd to compress rootfs debug symbols for unified autobuild]
c268e47e [openwrt][common][bsp][Change SMC ID of wdt nonrst reg of reset-boot-count to 0x570]
c6819fbc [openwrt-24][Release][Update release note for Filogic 880 alpha release]
6897b4de [openwrt-24][common][bsp][Adjust unified autobuild for internal build detection]
fb9b9762 [MAC80211][WiFi6/7][app][Add ext eeprom write back cmd support]
d42b42a3 [openwrt-24][common][bsp][Add kernel6.6 Filogic880 BE19000/BE14000]
3806f047 [MAC80211][misc][Add Bpi-R4 support]
ddbda753 [MAC80211][WiFi7][Misc][Fix build fail because of mt76 version upgradation]
90959b08 [MAC80211][WiFi6][mt76][Rebase mt76 pathes]
728a3362 [MAC80211][WiFi6][mt76][Refactor Qos Map]
b46277b5 [MAC80211][WiFi6][mt76][Fix add ba issue on tid not equal to zero]
c084ee8b [MAC80211][WiFi7][mt76][split mt76 Makefile patch]
bbaec094 [MAC80211][Release][Update Filogic 830/820/630 firmware]
5ce2eece [MAC80211][wifi6][MT76][Fix build fail]
5ac1121f [MAC80211][wifi6][MT76][Fix mt76 version to 2024-07-13]
485f92b1 [MAC80211][WiFi7][misc][synchronize PP bitmap when association]
84db8818 [MAC80211][WiFi6/7][app][Add ATETXNSS in iwpriv wrapper]
cc5a4605 [MAC80211][WiFi7][mt76][fix patch failed of Makefile]

[Release-log]

Change-Id: I06704c04c4b5571af4ffd189d636c1fc9f0567fd
diff --git a/recipes-wifi/linux-mt76/files/patches-3.x/0109-mtk-mt76-mt7996-add-linux-tracing-support.patch b/recipes-wifi/linux-mt76/files/patches-3.x/0109-mtk-mt76-mt7996-add-linux-tracing-support.patch
new file mode 100644
index 0000000..9705ef9
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/0109-mtk-mt76-mt7996-add-linux-tracing-support.patch
@@ -0,0 +1,395 @@
+From 72119323570a647a238c6d3dfb2c07c190e062c4 Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Wed, 7 Sep 2022 12:13:20 +0800
+Subject: [PATCH 109/223] mtk: mt76: mt7996: add linux tracing support
+
+Add static tracepoint support for besra.
+
+Change-Id: I3209ba360b49c28e49c7cf464ea130aeba993ef7
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+---
+ agg-rx.c              |   2 +
+ mac80211.c            |   3 +
+ mt7996/Makefile       |   2 +-
+ mt7996/mac.c          |   6 ++
+ mt7996/mcu.c          |   8 +++
+ mt7996/mt7996_trace.h | 141 ++++++++++++++++++++++++++++++++++++++++++
+ mt7996/trace.c        |  12 ++++
+ trace.h               |  58 +++++++++++++++++
+ 8 files changed, 231 insertions(+), 1 deletion(-)
+ create mode 100644 mt7996/mt7996_trace.h
+ create mode 100644 mt7996/trace.c
+
+diff --git a/agg-rx.c b/agg-rx.c
+index 07c386c7..b48943c4 100644
+--- a/agg-rx.c
++++ b/agg-rx.c
+@@ -3,6 +3,7 @@
+  * Copyright (C) 2018 Felix Fietkau <nbd@nbd.name>
+  */
+ #include "mt76.h"
++#include "trace.h"
+ 
+ static unsigned long mt76_aggr_tid_to_timeo(u8 tidno)
+ {
+@@ -187,6 +188,7 @@ void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames)
+ 	seqno = status->seqno;
+ 	size = tid->size;
+ 	sn_less = ieee80211_sn_less(seqno, head);
++	trace_mt76_rx_aggr_reorder(tid->dev, wcid, head, seqno, sn_less);
+ 
+ 	if (!tid->started) {
+ 		if (sn_less)
+diff --git a/mac80211.c b/mac80211.c
+index a2b111c0..75674462 100644
+--- a/mac80211.c
++++ b/mac80211.c
+@@ -5,6 +5,7 @@
+ #include <linux/sched.h>
+ #include <linux/of.h>
+ #include "mt76.h"
++#include "trace.h"
+ 
+ static const struct ieee80211_channel mt76_channels_2ghz[] = {
+ 	CHAN2G(1, 2412),
+@@ -1332,6 +1333,7 @@ void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
+ 
+ 		mt76_check_ccmp_pn(skb);
+ 		skb_shinfo(skb)->frag_list = NULL;
++		trace_mt76_rx_complete(dev, (struct mt76_rx_status *)skb->cb, 0);
+ 		mt76_rx_convert(dev, skb, &hw, &sta);
+ 		ieee80211_rx_list(hw, sta, skb, &list);
+ 
+@@ -1341,6 +1343,7 @@ void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
+ 			nskb = nskb->next;
+ 			skb->next = NULL;
+ 
++			trace_mt76_rx_complete(dev, (struct mt76_rx_status *)skb->cb, 1);
+ 			mt76_rx_convert(dev, skb, &hw, &sta);
+ 			ieee80211_rx_list(hw, sta, skb, &list);
+ 		}
+diff --git a/mt7996/Makefile b/mt7996/Makefile
+index 49ec9154..936edc61 100644
+--- a/mt7996/Makefile
++++ b/mt7996/Makefile
+@@ -12,4 +12,4 @@ mt7996e-y := pci.o init.o dma.o eeprom.o main.o mcu.o mac.o \
+ mt7996e-$(CONFIG_DEV_COREDUMP) += coredump.o
+ mt7996e-$(CONFIG_NL80211_TESTMODE) += testmode.o
+ 
+-mt7996e-y += mtk_debugfs.o mtk_mcu.o mtk_debugfs_i.o
++mt7996e-y += mtk_debugfs.o mtk_mcu.o mtk_debugfs_i.o trace.o
+diff --git a/mt7996/mac.c b/mt7996/mac.c
+index 2e27e3b3..1c0d3676 100644
+--- a/mt7996/mac.c
++++ b/mt7996/mac.c
+@@ -11,6 +11,7 @@
+ #include "mac.h"
+ #include "mcu.h"
+ #include "vendor.h"
++#include "mt7996_trace.h"
+ 
+ static const struct mt7996_dfs_radar_spec etsi_radar_specs = {
+ 	.pulse_th = { 110, -10, -80, 40, 5200, 128, 5200 },
+@@ -344,6 +345,8 @@ mt7996_mac_fill_rx(struct mt7996_dev *dev, enum mt76_rxq_id q,
+ 	phy = mphy->priv;
+ 	status->phy_idx = mphy->band_idx;
+ 
++	trace_mt7996_fill_rx(phy, skb->data, skb->len);
++
+ 	if (!test_bit(MT76_STATE_RUNNING, &mphy->state))
+ 		return -EINVAL;
+ 
+@@ -621,6 +624,8 @@ mt7996_mac_fill_rx(struct mt7996_dev *dev, enum mt76_rxq_id q,
+ 		}
+ 	}
+ 
++	trace_mt7996_fill_rx_done(phy, status->seqno, hdr_gap);
++
+ 	if (!status->wcid || !ieee80211_is_data_qos(fc) || hw_aggr)
+ 		return 0;
+ 
+@@ -1010,6 +1015,7 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
+ 		mt7996_packet_log_to_host(dev, t->skb->data, t->skb->len, PKT_BIN_DEBUG_TX, 0);
+ 	mt7996_dump_bmac_txd_info(NULL, dev, (__le32 *)txwi, true, false);
+ #endif
++	trace_mt7996_tx_prepare(dev, wcid, qid, txwi, t->skb->data, t->skb->len);
+ 
+ 	return 0;
+ }
+diff --git a/mt7996/mcu.c b/mt7996/mcu.c
+index 956bd396..d1aa19cb 100644
+--- a/mt7996/mcu.c
++++ b/mt7996/mcu.c
+@@ -10,6 +10,7 @@
+ #include "mcu.h"
+ #include "mac.h"
+ #include "eeprom.h"
++#include "mt7996_trace.h"
+ 
+ #define fw_name(_dev, name, ...)	({			\
+ 	char *_fw;						\
+@@ -310,6 +311,9 @@ mt7996_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
+ 		else if (cmd & __MCU_CMD_FIELD_WM)
+ 			uni_txd->s2d_index = MCU_S2D_H2N;
+ 
++		trace_mt7996_mcu_cmd(dev, 1, uni_txd->cid, 0,
++				    skb->data, skb->len);
++
+ 		goto exit;
+ 	}
+ 
+@@ -337,6 +341,8 @@ mt7996_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
+ 	else
+ 		mcu_txd->s2d_index = MCU_S2D_H2N;
+ 
++	trace_mt7996_mcu_cmd(dev, 0, mcu_txd->cid, mcu_txd->ext_cid,
++			    skb->data, skb->len);
+ exit:
+ #ifdef CONFIG_MTK_DEBUG
+ 	if (dev->dbg.dump_mcu_pkt)
+@@ -1182,6 +1188,8 @@ void mt7996_mcu_rx_event(struct mt7996_dev *dev, struct sk_buff *skb)
+ {
+ 	struct mt7996_mcu_rxd *rxd = (struct mt7996_mcu_rxd *)skb->data;
+ 
++	trace_mt7996_mcu_event(dev, rxd->option & MCU_UNI_CMD_UNSOLICITED_EVENT,
++			      rxd->eid, rxd->ext_eid, skb->data, skb->len);
+ 	if (rxd->option & MCU_UNI_CMD_UNSOLICITED_EVENT) {
+ 		mt7996_mcu_uni_rx_unsolicited_event(dev, skb);
+ 		return;
+diff --git a/mt7996/mt7996_trace.h b/mt7996/mt7996_trace.h
+new file mode 100644
+index 00000000..5fa73482
+--- /dev/null
++++ b/mt7996/mt7996_trace.h
+@@ -0,0 +1,141 @@
++/* SPDX-License-Identifier: ISC */
++/*
++ * Copyright (C) 2022 MediaTek Inc.
++ */
++
++#if !defined(__MT7996_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
++#define __MT7996_TRACE_H
++
++#include <linux/types.h>
++#include <linux/tracepoint.h>
++#include "mt7996.h"
++
++#undef TRACE_SYSTEM
++#define TRACE_SYSTEM mt7996
++
++#define MAXNAME		32
++#define DEV_ENTRY	__array(char, wiphy_name, 32)
++#define DEV_ASSIGN(_w)	strlcpy(__entry->wiphy_name, wiphy_name(_w), MAXNAME)
++#define DEV_PR_FMT	"%s"
++#define DEV_PR_ARG	__entry->wiphy_name
++
++DECLARE_EVENT_CLASS(mt7996_mcu_debug,
++	TP_PROTO(struct mt7996_dev *dev, bool uni, u8 id, u8 ext_id,
++		 const void *data, size_t len),
++	TP_ARGS(dev, uni, id, ext_id, data, len),
++	TP_STRUCT__entry(
++		__field(bool, uni)
++		__field(u8, id)
++		__field(u8, ext_id)
++		__field(size_t, len)
++		__dynamic_array(u8, data, len)
++	),
++	TP_fast_assign(
++		__entry->uni = uni;
++		__entry->id = id;
++		__entry->ext_id = ext_id;
++		__entry->len = len;
++		memcpy(__get_dynamic_array(data), data, len);
++	),
++	TP_printk(
++		"uni: %d, id: %u, ext_id: %u, len: %zu",
++		__entry->uni,
++		__entry->id,
++		__entry->ext_id,
++		__entry->len
++	)
++);
++
++DEFINE_EVENT(mt7996_mcu_debug, mt7996_mcu_cmd,
++	TP_PROTO(struct mt7996_dev *dev, bool uni, u8 id, u8 ext_id,
++		 const void *data, size_t len),
++	TP_ARGS(dev, uni, id, ext_id, data, len)
++);
++
++DEFINE_EVENT(mt7996_mcu_debug, mt7996_mcu_event,
++	TP_PROTO(struct mt7996_dev *dev, bool uni, u8 id, u8 ext_id,
++		 const void *data, size_t len),
++	TP_ARGS(dev, uni, id, ext_id, data, len)
++);
++
++TRACE_EVENT(mt7996_tx_prepare,
++	TP_PROTO(struct mt7996_dev *dev, struct mt76_wcid *wcid, enum mt76_txq_id qid,
++		 const void *txwi, const void *data, size_t len),
++	TP_ARGS(dev, wcid, qid, txwi, data, len),
++
++	TP_STRUCT__entry(
++		DEV_ENTRY
++		__field(u16, wcid)
++		__field(u8, qid)
++		__array(u8, txwi, MT_TXD_SIZE)
++		__field(size_t, len)
++		__dynamic_array(u8, data, len)
++	),
++
++	TP_fast_assign(
++		DEV_ASSIGN(dev->mt76.phys[wcid->phy_idx]->hw->wiphy);
++		__entry->wcid = wcid->idx;
++		__entry->qid = qid;
++		memcpy(__entry->txwi, txwi, MT_TXD_SIZE);
++		__entry->len = len;
++		memcpy(__get_dynamic_array(data), data, len);
++	),
++
++	TP_printk(
++		DEV_PR_FMT " wcid: %u, qid: %u, len: %zu",
++		DEV_PR_ARG, __entry->wcid, __entry->qid, __entry->len
++	)
++);
++
++TRACE_EVENT(mt7996_fill_rx,
++	TP_PROTO(struct mt7996_phy *phy, const void *data, size_t len),
++	TP_ARGS(phy, data, len),
++
++	TP_STRUCT__entry(
++		DEV_ENTRY
++		__field(size_t, len)
++		__dynamic_array(u8, data, len)
++	),
++
++	TP_fast_assign(
++		DEV_ASSIGN(phy->mt76->hw->wiphy);
++		__entry->len = len;
++		memcpy(__get_dynamic_array(data), data, len);
++	),
++
++	TP_printk(
++		DEV_PR_FMT " len: %zu",
++		DEV_PR_ARG, __entry->len
++	)
++);
++
++TRACE_EVENT(mt7996_fill_rx_done,
++	TP_PROTO(struct mt7996_phy *phy, u16 seqno, u16 hdr_gap),
++	TP_ARGS(phy, seqno, hdr_gap),
++
++	TP_STRUCT__entry(
++		DEV_ENTRY
++		__field(u16, seqno)
++		__field(u16, hdr_gap)
++	),
++
++	TP_fast_assign(
++		DEV_ASSIGN(phy->mt76->hw->wiphy);
++		__entry->seqno = seqno;
++		__entry->hdr_gap = hdr_gap;
++	),
++
++	TP_printk(
++		DEV_PR_FMT " seqno: %u, hdr_gap: %u",
++		DEV_PR_ARG, __entry->seqno, __entry->hdr_gap
++	)
++);
++
++#endif
++
++#undef TRACE_INCLUDE_PATH
++#define TRACE_INCLUDE_PATH ./mt7996
++#undef TRACE_INCLUDE_FILE
++#define TRACE_INCLUDE_FILE mt7996_trace
++
++#include <trace/define_trace.h>
+diff --git a/mt7996/trace.c b/mt7996/trace.c
+new file mode 100644
+index 00000000..ba36f79a
+--- /dev/null
++++ b/mt7996/trace.c
+@@ -0,0 +1,12 @@
++/* SPDX-License-Identifier: ISC */
++/*
++ * Copyright (C) 2022 MediaTek Inc.
++ */
++
++#include <linux/module.h>
++
++#ifndef __CHECKER__
++#define CREATE_TRACE_POINTS
++#include "mt7996_trace.h"
++
++#endif
+diff --git a/trace.h b/trace.h
+index c3d0ef8e..57c94c6b 100644
+--- a/trace.h
++++ b/trace.h
+@@ -101,6 +101,64 @@ DEFINE_EVENT(dev_txid_evt, mac_txdone,
+ 	TP_ARGS(dev, wcid, pktid)
+ );
+ 
++TRACE_EVENT(mt76_rx_complete,
++	TP_PROTO(struct mt76_dev *dev, struct mt76_rx_status *status, bool sub),
++	TP_ARGS(dev, status, sub),
++
++	TP_STRUCT__entry(
++		DEV_ENTRY
++		__field(u16, seqno)
++		__field(u16, wcid)
++		__field(u8, first_amsdu)
++		__field(bool, sub)
++	),
++
++	TP_fast_assign(
++		strlcpy(__entry->wiphy_name,
++			wiphy_name(mt76_dev_phy(dev, status->phy_idx)->hw->wiphy),
++			MAXNAME);
++		__entry->seqno = status->seqno;
++		__entry->wcid = status->wcid ? status->wcid->idx : 0;
++		__entry->first_amsdu = status->first_amsdu;
++		__entry->sub = sub;
++	),
++
++	TP_printk(
++		DEV_PR_FMT " seqno: %u, wcid: %u, first_amsdu: %x, sub: %d",
++		DEV_PR_ARG, __entry->seqno, __entry->wcid, __entry->first_amsdu,
++		__entry->sub
++	)
++);
++
++TRACE_EVENT(mt76_rx_aggr_reorder,
++	TP_PROTO(struct mt76_dev *dev, struct mt76_wcid *wcid, u16 _head, u16 seqno, bool sn_less),
++	TP_ARGS(dev, wcid, _head, seqno, sn_less),
++
++	TP_STRUCT__entry(
++		DEV_ENTRY
++		__field(u16, wcid)
++		__field(u16, _head)
++		__field(u16, seqno)
++		__field(bool, sn_less)
++	),
++
++	TP_fast_assign(
++		strlcpy(__entry->wiphy_name,
++			wiphy_name(dev->phys[wcid->phy_idx]->hw->wiphy),
++			MAXNAME);
++		__entry->wcid = wcid->idx;
++		__entry->_head = _head;
++		__entry->seqno = seqno;
++		__entry->sn_less = sn_less;
++	),
++
++	TP_printk(
++		DEV_PR_FMT " wcid: %u, head: %u, seqno: %u, sn_less: %d",
++		DEV_PR_ARG, __entry->wcid, __entry->_head, __entry->seqno,
++		__entry->sn_less
++	)
++);
++
+ #endif
+ 
+ #undef TRACE_INCLUDE_PATH
+-- 
+2.45.2
+