blob: 2f9a0c3201a10e819146135c6a3e8ddb314ade04 [file] [log] [blame]
developerf8871e82023-03-08 17:22:32 +08001From a126ad08af718c71b4b05261caefb68996044330 Mon Sep 17 00:00:00 2001
developerf3f5d9b2023-02-07 15:24:34 +08002From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Thu, 3 Nov 2022 00:27:17 +0800
4Subject: [PATCH] mt76: mt7996: for build pass
5
6Change-Id: Ieb44c33ee6e6a2e6058c1ef528404c1a1cbcfdaf
7---
8 debugfs.c | 3 +++
developerf3f5d9b2023-02-07 15:24:34 +08009 eeprom.c | 8 +++++++-
10 mcu.c | 1 +
11 mt7615/mcu.c | 1 +
12 mt76_connac_mcu.c | 1 +
13 mt7915/mcu.c | 1 +
14 mt7996/dma.c | 4 ++--
developerf8871e82023-03-08 17:22:32 +080015 mt7996/eeprom.c | 2 ++
developerf3f5d9b2023-02-07 15:24:34 +080016 mt7996/mcu.c | 1 +
developerf8871e82023-03-08 17:22:32 +080017 9 files changed, 19 insertions(+), 3 deletions(-)
developerf3f5d9b2023-02-07 15:24:34 +080018
19diff --git a/debugfs.c b/debugfs.c
20index 79064a4d..e10d4cbc 100644
21--- a/debugfs.c
22+++ b/debugfs.c
23@@ -33,8 +33,11 @@ mt76_napi_threaded_set(void *data, u64 val)
24 if (!mt76_is_mmio(dev))
25 return -EOPNOTSUPP;
26
27+#if 0
28+ /* need to backport patch from networking stack */
29 if (dev->napi_dev.threaded != val)
30 return dev_set_threaded(&dev->napi_dev, val);
31+#endif
32
33 return 0;
34 }
developerf3f5d9b2023-02-07 15:24:34 +080035diff --git a/eeprom.c b/eeprom.c
36index ea54b7af..90d36c8d 100644
37--- a/eeprom.c
38+++ b/eeprom.c
39@@ -106,9 +106,15 @@ void
40 mt76_eeprom_override(struct mt76_phy *phy)
41 {
42 struct mt76_dev *dev = phy->dev;
43+#ifdef CONFIG_OF
44 struct device_node *np = dev->dev->of_node;
45+ const u8 *mac = NULL;
46
47- of_get_mac_address(np, phy->macaddr);
48+ if (np)
49+ mac = of_get_mac_address(np);
50+ if (!IS_ERR_OR_NULL(mac))
51+ ether_addr_copy(phy->macaddr, mac);
52+#endif
53
54 if (!is_valid_ether_addr(phy->macaddr)) {
55 eth_random_addr(phy->macaddr);
56diff --git a/mcu.c b/mcu.c
57index a8cafa39..fa4b0544 100644
58--- a/mcu.c
59+++ b/mcu.c
60@@ -4,6 +4,7 @@
61 */
62
63 #include "mt76.h"
64+#include <linux/moduleparam.h>
65
66 struct sk_buff *
67 __mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data,
68diff --git a/mt7615/mcu.c b/mt7615/mcu.c
69index eea398c7..4593b2e1 100644
70--- a/mt7615/mcu.c
71+++ b/mt7615/mcu.c
72@@ -10,6 +10,7 @@
73 #include "mcu.h"
74 #include "mac.h"
75 #include "eeprom.h"
76+#include <linux/moduleparam.h>
77
78 static bool prefer_offload_fw = true;
79 module_param(prefer_offload_fw, bool, 0644);
80diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
developerf8871e82023-03-08 17:22:32 +080081index 4e4f6b35..e5815227 100644
developerf3f5d9b2023-02-07 15:24:34 +080082--- a/mt76_connac_mcu.c
83+++ b/mt76_connac_mcu.c
84@@ -4,6 +4,7 @@
85 #include <linux/firmware.h>
86 #include "mt76_connac2_mac.h"
87 #include "mt76_connac_mcu.h"
88+#include <linux/module.h>
89
90 int mt76_connac_mcu_start_firmware(struct mt76_dev *dev, u32 addr, u32 option)
91 {
92diff --git a/mt7915/mcu.c b/mt7915/mcu.c
developerf8871e82023-03-08 17:22:32 +080093index d08907f5..99ef8c9c 100644
developerf3f5d9b2023-02-07 15:24:34 +080094--- a/mt7915/mcu.c
95+++ b/mt7915/mcu.c
96@@ -6,6 +6,7 @@
97 #include "mcu.h"
98 #include "mac.h"
99 #include "eeprom.h"
100+#include <linux/moduleparam.h>
101
102 #define fw_name(_dev, name, ...) ({ \
103 char *_fw; \
104diff --git a/mt7996/dma.c b/mt7996/dma.c
developerf8871e82023-03-08 17:22:32 +0800105index 18ea758c..3e2967f7 100644
developerf3f5d9b2023-02-07 15:24:34 +0800106--- a/mt7996/dma.c
107+++ b/mt7996/dma.c
108@@ -343,8 +343,8 @@ int mt7996_dma_init(struct mt7996_dev *dev)
109 if (ret < 0)
110 return ret;
111
112- netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
113- mt7996_poll_tx);
114+ netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
115+ mt7996_poll_tx, NAPI_POLL_WEIGHT);
116 napi_enable(&dev->mt76.tx_napi);
117
118 mt7996_dma_enable(dev);
119diff --git a/mt7996/eeprom.c b/mt7996/eeprom.c
developerf8871e82023-03-08 17:22:32 +0800120index 2e48c5a4..e747cb9f 100644
developerf3f5d9b2023-02-07 15:24:34 +0800121--- a/mt7996/eeprom.c
122+++ b/mt7996/eeprom.c
developerf8871e82023-03-08 17:22:32 +0800123@@ -98,6 +98,8 @@ static int mt7996_eeprom_parse_efuse_hw_cap(struct mt7996_dev *dev)
developerf3f5d9b2023-02-07 15:24:34 +0800124 if (ret)
125 return ret;
126
developerf8871e82023-03-08 17:22:32 +0800127+ /* for internal testing */
128+ cap = 0x4b249248;
developerf3f5d9b2023-02-07 15:24:34 +0800129 if (cap) {
130 dev->has_eht = !(cap & MODE_HE_ONLY);
131 dev->wtbl_size_group = u32_get_bits(cap, WTBL_SIZE_GROUP);
132diff --git a/mt7996/mcu.c b/mt7996/mcu.c
developerf8871e82023-03-08 17:22:32 +0800133index 829f7be6..0d9d309f 100644
developerf3f5d9b2023-02-07 15:24:34 +0800134--- a/mt7996/mcu.c
135+++ b/mt7996/mcu.c
136@@ -5,6 +5,7 @@
137
138 #include <linux/firmware.h>
139 #include <linux/fs.h>
140+#include <linux/moduleparam.h>
141 #include "mt7996.h"
142 #include "mcu.h"
143 #include "mac.h"
144--
developerf8871e82023-03-08 17:22:32 +08001452.39.2
developerf3f5d9b2023-02-07 15:24:34 +0800146