[openwrt/openwrt] mac80211: rt2x00: fix eeprom load issue for PCIe NICs
LEDE Commits
lede-commits at lists.infradead.org
Sun Sep 22 10:16:58 PDT 2024
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9a157292e2b7e86110478d1781b75d8b95478f22
commit 9a157292e2b7e86110478d1781b75d8b95478f22
Author: Shiji Yang <yangshiji66 at qq.com>
AuthorDate: Sat Aug 17 12:04:43 2024 +0800
mac80211: rt2x00: fix eeprom load issue for PCIe NICs
The support for assigning PCIe eeprom via device tree was
accidentally removed when adding NVMEM eeprom patches.
Fixes: bea4f5020790 ("mac80211: rt2x00: improve EEPROM load patches")
Signed-off-by: Shiji Yang <yangshiji66 at qq.com>
Link: https://github.com/openwrt/openwrt/pull/16318
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
...-Add-support-for-loading-EEPROM-from-user.patch | 24 ++++++++++++++++------
...introduce-accessors-for-CHIP_VER-register.patch | 4 ++--
2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch
index f90e109a88..1516c6cb43 100644
--- a/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch
+++ b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch
@@ -198,11 +198,23 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC);
retval = rt2x00soc_alloc_reg(rt2x00dev);
---- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h
-@@ -26,4 +26,13 @@ int rt2x00soc_resume(struct platform_dev
- #define rt2x00soc_resume NULL
- #endif /* CONFIG_PM */
+--- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
++++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
+@@ -278,6 +278,9 @@ static int rt2800pci_read_eeprom(struct
+ {
+ int retval;
+
++ if (!rt2x00lib_read_eeprom(rt2x00dev))
++ return 0;
++
+ if (rt2800pci_efuse_detect(rt2x00dev))
+ retval = rt2800pci_read_eeprom_efuse(rt2x00dev);
+ else
+--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
+@@ -270,4 +270,13 @@ void rt2800_get_txwi_rxwi_size(struct rt
+ unsigned short *rxwi_size);
+ void rt2800_pre_reset_hw(struct rt2x00_dev *rt2x00dev);
+/*
+ * EEPROM file handlers.
@@ -213,4 +225,4 @@ Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+#define rt2x00lib_read_eeprom NULL
+#endif /* CPTCFG_RT2X00_LIB_EEPROM */
+
- #endif /* RT2X00SOC_H */
+ #endif /* RT2800LIB_H */
diff --git a/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch b/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch
index b3828052e9..cb7a3617ee 100644
--- a/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch
+++ b/package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch
@@ -40,7 +40,7 @@
const u8 arg0, const u8 arg1);
--- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
-@@ -286,6 +286,10 @@ static int rt2800pci_read_eeprom(struct
+@@ -289,6 +289,10 @@ static int rt2800pci_read_eeprom(struct
return retval;
}
@@ -51,7 +51,7 @@
static const struct ieee80211_ops rt2800pci_mac80211_ops = {
.add_chanctx = ieee80211_emulate_add_chanctx,
.remove_chanctx = ieee80211_emulate_remove_chanctx,
-@@ -333,6 +337,9 @@ static const struct rt2800_ops rt2800pci
+@@ -336,6 +340,9 @@ static const struct rt2800_ops rt2800pci
.drv_init_registers = rt2800mmio_init_registers,
.drv_get_txwi = rt2800mmio_get_txwi,
.drv_get_dma_done = rt2800mmio_get_dma_done,
More information about the lede-commits
mailing list