blob: dd28dc9ad2ca37df50a1f98a8ebdd173e042cb2e [file] [log] [blame]
developerabdbf252023-02-06 16:02:21 +08001From e66fbcb72e09e9e6a88fcedc84f4eda0d53ef65d Mon Sep 17 00:00:00 2001
2From: 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 +++
9 dma.c | 2 +-
10 eeprom.c | 8 +++++++-
11 mcu.c | 1 +
12 mt7615/mcu.c | 1 +
13 mt76_connac_mcu.c | 1 +
14 mt7915/mcu.c | 1 +
15 mt7996/dma.c | 4 ++--
16 mt7996/eeprom.c | 1 +
17 mt7996/mcu.c | 1 +
18 10 files changed, 19 insertions(+), 4 deletions(-)
19
20diff --git a/debugfs.c b/debugfs.c
21index 79064a4d..e10d4cbc 100644
22--- a/debugfs.c
23+++ b/debugfs.c
24@@ -33,8 +33,11 @@ mt76_napi_threaded_set(void *data, u64 val)
25 if (!mt76_is_mmio(dev))
26 return -EOPNOTSUPP;
27
28+#if 0
29+ /* need to backport patch from networking stack */
30 if (dev->napi_dev.threaded != val)
31 return dev_set_threaded(&dev->napi_dev, val);
32+#endif
33
34 return 0;
35 }
36diff --git a/dma.c b/dma.c
37index 50a7a689..beb9f4a4 100644
38--- a/dma.c
39+++ b/dma.c
40@@ -854,7 +854,7 @@ mt76_dma_rx_process(struct mt76_dev *dev, struct mt76_queue *q, int budget)
41 !(dev->drv->rx_check(dev, data, len)))
42 goto free_frag;
43
44- skb = napi_build_skb(data, q->buf_size);
45+ skb = build_skb(data, q->buf_size);
46 if (!skb)
47 goto free_frag;
48
49diff --git a/eeprom.c b/eeprom.c
50index ea54b7af..90d36c8d 100644
51--- a/eeprom.c
52+++ b/eeprom.c
53@@ -106,9 +106,15 @@ void
54 mt76_eeprom_override(struct mt76_phy *phy)
55 {
56 struct mt76_dev *dev = phy->dev;
57+#ifdef CONFIG_OF
58 struct device_node *np = dev->dev->of_node;
59+ const u8 *mac = NULL;
60
61- of_get_mac_address(np, phy->macaddr);
62+ if (np)
63+ mac = of_get_mac_address(np);
64+ if (!IS_ERR_OR_NULL(mac))
65+ ether_addr_copy(phy->macaddr, mac);
66+#endif
67
68 if (!is_valid_ether_addr(phy->macaddr)) {
69 eth_random_addr(phy->macaddr);
70diff --git a/mcu.c b/mcu.c
71index a8cafa39..fa4b0544 100644
72--- a/mcu.c
73+++ b/mcu.c
74@@ -4,6 +4,7 @@
75 */
76
77 #include "mt76.h"
78+#include <linux/moduleparam.h>
79
80 struct sk_buff *
81 __mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data,
82diff --git a/mt7615/mcu.c b/mt7615/mcu.c
83index eea398c7..4593b2e1 100644
84--- a/mt7615/mcu.c
85+++ b/mt7615/mcu.c
86@@ -10,6 +10,7 @@
87 #include "mcu.h"
88 #include "mac.h"
89 #include "eeprom.h"
90+#include <linux/moduleparam.h>
91
92 static bool prefer_offload_fw = true;
93 module_param(prefer_offload_fw, bool, 0644);
94diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
95index efb9bfaa..4a650721 100644
96--- a/mt76_connac_mcu.c
97+++ b/mt76_connac_mcu.c
98@@ -4,6 +4,7 @@
99 #include <linux/firmware.h>
100 #include "mt76_connac2_mac.h"
101 #include "mt76_connac_mcu.h"
102+#include <linux/module.h>
103
104 int mt76_connac_mcu_start_firmware(struct mt76_dev *dev, u32 addr, u32 option)
105 {
106diff --git a/mt7915/mcu.c b/mt7915/mcu.c
107index f151ce86..20d81f05 100644
108--- a/mt7915/mcu.c
109+++ b/mt7915/mcu.c
110@@ -6,6 +6,7 @@
111 #include "mcu.h"
112 #include "mac.h"
113 #include "eeprom.h"
114+#include <linux/moduleparam.h>
115
116 #define fw_name(_dev, name, ...) ({ \
117 char *_fw; \
118diff --git a/mt7996/dma.c b/mt7996/dma.c
119index c09fe427..8c2e060d 100644
120--- a/mt7996/dma.c
121+++ b/mt7996/dma.c
122@@ -343,8 +343,8 @@ int mt7996_dma_init(struct mt7996_dev *dev)
123 if (ret < 0)
124 return ret;
125
126- netif_napi_add_tx(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
127- mt7996_poll_tx);
128+ netif_tx_napi_add(&dev->mt76.tx_napi_dev, &dev->mt76.tx_napi,
129+ mt7996_poll_tx, NAPI_POLL_WEIGHT);
130 napi_enable(&dev->mt76.tx_napi);
131
132 mt7996_dma_enable(dev);
133diff --git a/mt7996/eeprom.c b/mt7996/eeprom.c
134index 2e48c5a4..dd322f62 100644
135--- a/mt7996/eeprom.c
136+++ b/mt7996/eeprom.c
137@@ -98,6 +98,7 @@ static int mt7996_eeprom_parse_efuse_hw_cap(struct mt7996_dev *dev)
138 if (ret)
139 return ret;
140
141+ cap = 0x4b249248; /* internal hardcode */
142 if (cap) {
143 dev->has_eht = !(cap & MODE_HE_ONLY);
144 dev->wtbl_size_group = u32_get_bits(cap, WTBL_SIZE_GROUP);
145diff --git a/mt7996/mcu.c b/mt7996/mcu.c
146index 1e47b0ae..db715195 100644
147--- a/mt7996/mcu.c
148+++ b/mt7996/mcu.c
149@@ -5,6 +5,7 @@
150
151 #include <linux/firmware.h>
152 #include <linux/fs.h>
153+#include <linux/moduleparam.h>
154 #include "mt7996.h"
155 #include "mcu.h"
156 #include "mac.h"
157--
1582.25.1
159