mt7915e 5GHz/6GHz with multiple cards or dynamic selection - can it be done along these lines?

Adam Hill sidepipeuk at gmail.com
Fri May 15 10:41:49 PDT 2026


Firstly I have to preface this with "I don't know what I'm doing". I
have almost no knowledge of how these ( or any ) wireless cards
operate and little knowledge of the inner workings of kernel modules
etc.... so where I'm going with this might not be possible. I do know
that the current situation with the mt7915e module isn't ideal.

There are two serious-ish concerns as far as I can see:

1) It's currently impossible to have multiple 6GHz capable cards in a
system unless they all operate on either 5GHz or 6GHz, i.e. the same
band for all cards. This removes the very realistic possibility that
you might want two cards, one on 5GHz and one on 6GHz.

2) The band selection is at module load time, and anything looking at
netlink would be unaware that it's even possible to use the other
band.

I've been experimenting, and with the patch below ( simply a proof of
concept ) netlink is supplied with both bands regardless of the one
selected, and changing /sys/module/mt7915e/parameters/enable_6ghz from
Y to N or vice versa, followed by assering /sys.../phy<x>/device/reset
*seems* to allow dynamic switching between bands. However, given my
aforementioned lack of knowledge, I'm unsure whether what I've done is
even valid, and if it gets around the original reason for the single
band selection in the first place ( the original commit, 57af267,
mentions that memory limitations prevent both bands being configured
correctly - and I'm not sure if calling  mt7915_eeprom_parse_hw_cap is
sufficient to replace one with theother ). In any case, I can
successfully switch between bands using this technique ( and also,
coincidentally, use multiple cards on different bands, but that needs
a proper solution ).

Ideally, what I *think* should happen, is that rather than a module
parameter, if a request to set up the band that isn't loaded happens,
the appropriate steps are taken to reconfigure the hardware to the
other band. Probably simpler, but also less desirable, would be a
second module parameter allowing selection on a per-card basis, with a
callback that performs the reset if it's changed.

My current POC is simply:

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
index eb92cbf1a284..87113459fe30 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
@@ -166,6 +166,9 @@ static void mt7915_eeprom_parse_band_config(struct
mt7915_phy *phy)
        val = eeprom[MT_EE_WIFI_CONF + band];
        val = FIELD_GET(MT_EE_WIFI_CONF0_BAND_SEL, val);

+       if (phy->mt76->cap.has_6ghz && phy->mt76->cap.has_6ghz)
+               val = MT_EE_V2_BAND_SEL_5GHZ_6GHZ;
+
        if (!is_mt7915(&dev->mt76)) {
                switch (val) {
                case MT_EE_V2_BAND_SEL_5GHZ:
@@ -175,13 +178,13 @@ static void
mt7915_eeprom_parse_band_config(struct mt7915_phy *phy)
                        phy->mt76->cap.has_6ghz = true;
                        return;
                case MT_EE_V2_BAND_SEL_5GHZ_6GHZ:
+                       phy->mt76->cap.has_6ghz = true;
+                       phy->mt76->cap.has_5ghz = true;
                        if (enable_6ghz) {
-                               phy->mt76->cap.has_6ghz = true;

u8p_replace_bits(&eeprom[MT_EE_WIFI_CONF + band],
                                                 MT_EE_V2_BAND_SEL_6GHZ,
                                                 MT_EE_WIFI_CONF0_BAND_SEL);
                        } else {
-                               phy->mt76->cap.has_5ghz = true;

u8p_replace_bits(&eeprom[MT_EE_WIFI_CONF + band],
                                                 MT_EE_V2_BAND_SEL_5GHZ,
                                                 MT_EE_WIFI_CONF0_BAND_SEL);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index cec2c4208255..56a8ba648b46 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -1297,6 +1297,9 @@ mt7915_mac_restart(struct mt7915_dev *dev)
        ext_phy = dev->mt76.phys[MT_BAND1];
        phy2 = ext_phy ? ext_phy->priv : NULL;

+       if (phy2)
+               mt7915_eeprom_parse_hw_cap(dev, phy2);
+
        if (dev->hif2) {
                mt76_wr(dev, MT_INT1_MASK_CSR, 0x0);
                mt76_wr(dev, MT_INT1_SOURCE_CSR, ~0);



More information about the Linux-mediatek mailing list