developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 1 | From a126ad08af718c71b4b05261caefb68996044330 Mon Sep 17 00:00:00 2001 |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Thu, 3 Nov 2022 00:27:17 +0800 |
| 4 | Subject: [PATCH] mt76: mt7996: for build pass |
| 5 | |
| 6 | Change-Id: Ieb44c33ee6e6a2e6058c1ef528404c1a1cbcfdaf |
| 7 | --- |
| 8 | debugfs.c | 3 +++ |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 9 | 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 ++-- |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 15 | mt7996/eeprom.c | 2 ++ |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 16 | mt7996/mcu.c | 1 + |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 17 | 9 files changed, 19 insertions(+), 3 deletions(-) |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 18 | |
| 19 | diff --git a/debugfs.c b/debugfs.c |
| 20 | index 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 | } |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 35 | diff --git a/eeprom.c b/eeprom.c |
| 36 | index 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); |
| 56 | diff --git a/mcu.c b/mcu.c |
| 57 | index 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, |
| 68 | diff --git a/mt7615/mcu.c b/mt7615/mcu.c |
| 69 | index 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); |
| 80 | diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 81 | index 4e4f6b35..e5815227 100644 |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 82 | --- 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 | { |
| 92 | diff --git a/mt7915/mcu.c b/mt7915/mcu.c |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 93 | index d08907f5..99ef8c9c 100644 |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 94 | --- 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; \ |
| 104 | diff --git a/mt7996/dma.c b/mt7996/dma.c |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 105 | index 18ea758c..3e2967f7 100644 |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 106 | --- 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); |
| 119 | diff --git a/mt7996/eeprom.c b/mt7996/eeprom.c |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 120 | index 2e48c5a4..e747cb9f 100644 |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 121 | --- a/mt7996/eeprom.c |
| 122 | +++ b/mt7996/eeprom.c |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 123 | @@ -98,6 +98,8 @@ static int mt7996_eeprom_parse_efuse_hw_cap(struct mt7996_dev *dev) |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 124 | if (ret) |
| 125 | return ret; |
| 126 | |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 127 | + /* for internal testing */ |
| 128 | + cap = 0x4b249248; |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 129 | if (cap) { |
| 130 | dev->has_eht = !(cap & MODE_HE_ONLY); |
| 131 | dev->wtbl_size_group = u32_get_bits(cap, WTBL_SIZE_GROUP); |
| 132 | diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 133 | index 829f7be6..0d9d309f 100644 |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 134 | --- 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 | -- |
developer | f8871e8 | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 145 | 2.39.2 |
developer | f3f5d9b | 2023-02-07 15:24:34 +0800 | [diff] [blame] | 146 | |