[][MAC80211][mt76][rework bin file mode and RED rework]

[Description]
Change bin file mode to directly get bin file name from dts.
This extends bin file mode to support the case that two pcie has
the same NIC.
Rework RED by adding global define for HW_TOKEN_SIZE.

[Release-log]
N/A

Change-Id: I7a8c823ee2fbc3ddd21e459210f3c34d52fb6692
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6926502
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/0006-wifi-mt76-mt7915-add-chip-id-condition-in-mt7915_che.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/0006-wifi-mt76-mt7915-add-chip-id-condition-in-mt7915_che.patch
new file mode 100644
index 0000000..0296e72
--- /dev/null
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/0006-wifi-mt76-mt7915-add-chip-id-condition-in-mt7915_che.patch
@@ -0,0 +1,43 @@
+From ddc4b8bffa97ad1ec9ef0909f38429cd00a4875f Mon Sep 17 00:00:00 2001
+From: Shayne Chen <shayne.chen@mediatek.com>
+Date: Thu, 8 Dec 2022 15:54:19 +0800
+Subject: [PATCH 6/6] wifi: mt76: mt7915: add chip id condition in
+ mt7915_check_eeprom()
+
+When flash mode is enabled, and the eeprom data in the flash is not for
+the current chipset, it'll still be checked valid, and the default
+eeprom bin won't be loaded.
+(e.g., mt7915 NIC inserted with mt7916 eeprom data in the flash.)
+
+Fix this kind of case by adding chip id into consideration in
+mt7915_check_eeprom().
+
+Reported-by: Cheng-Ji Li <cheng-ji.li@mediatek.com>
+Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
+---
+ mt7915/eeprom.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
+index 24efa280..a7962893 100644
+--- a/mt7915/eeprom.c
++++ b/mt7915/eeprom.c
+@@ -33,11 +33,14 @@ static int mt7915_check_eeprom(struct mt7915_dev *dev)
+ 	u8 *eeprom = dev->mt76.eeprom.data;
+ 	u16 val = get_unaligned_le16(eeprom);
+ 
++#define CHECK_EEPROM_ERR(match)	(match ? 0 : -EINVAL)
+ 	switch (val) {
+ 	case 0x7915:
++		return CHECK_EEPROM_ERR(is_mt7915(&dev->mt76));
+ 	case 0x7916:
++		return CHECK_EEPROM_ERR(is_mt7916(&dev->mt76));
+ 	case 0x7986:
+-		return 0;
++		return CHECK_EEPROM_ERR(is_mt7986(&dev->mt76));
+ 	default:
+ 		return -EINVAL;
+ 	}
+-- 
+2.25.1
+