mac80211: rt2x00: fix eeprom load issue for PCIe NICs
authorShiji Yang <yangshiji66@qq.com>
Sat, 17 Aug 2024 04:04:43 +0000 (12:04 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 22 Sep 2024 17:12:16 +0000 (19:12 +0200)
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@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16318
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch
package/kernel/mac80211/patches/rt2x00/995-rt2x00-mt7620-introduce-accessors-for-CHIP_VER-register.patch

index f90e109a88167d7240a20c2cbc17887de4fdd3c6..1516c6cb4349aff2f3225c4e47248366c2f2c0f6 100644 (file)
@@ -198,11 +198,23 @@ Signed-off-by: Christian Marangi <ansuelsmth@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@gmail.com>
 +#define rt2x00lib_read_eeprom NULL
 +#endif /* CPTCFG_RT2X00_LIB_EEPROM */
 +
- #endif /* RT2X00SOC_H */
+ #endif /* RT2800LIB_H */
index b3828052e9a7796762077d13da6ac94c69e737ea..cb7a3617eeca281a008b51d9ff46af5f987dc97a 100644 (file)
@@ -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,