Skip to contentSkip to conversation

mt76: mt76x2: Add support for LiteOn: WN4516R, WN4519R

PATCH Superseded Henk Vergonet 2 participants 8 messages Apr 18, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mt76: mt76x2: Add support for LiteOn: WN4516R, WN4519R

From: Henk Vergonet <[email protected]>

Ads support for:
LiteOn WN4516R
LiteOn WN4519R
Both use nonstandard USB connectors.

Chipset: MT7600U
ASIC revision: 76320044

---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c +2 -0
index 84ef80ab4afb..96cecc576a98 100644
@@ -17,6 +17,8 @@ static const struct usb_device_id mt76x2u_device_table[] = {
 	{ USB_DEVICE(0x057c, 0x8503) },	/* Avm FRITZ!WLAN AC860 */
 	{ USB_DEVICE(0x7392, 0xb711) },	/* Edimax EW 7722 UAC */
 	{ USB_DEVICE(0x0e8d, 0x7632) },	/* HC-M7662BU1 */
+	{ USB_DEVICE(0x0471, 0x2126) }, /* LiteOn WN4516R module, nonstandard USB connector */
+	{ USB_DEVICE(0x0471, 0x7600) }, /* LiteOn WN4519R module, nonstandard USB connector */
 	{ USB_DEVICE(0x2c4e, 0x0103) },	/* Mercury UD13 */
 	{ USB_DEVICE(0x0846, 0x9014) },	/* Netgear WNDA3100v3 */
 	{ USB_DEVICE(0x0846, 0x9053) },	/* Netgear A6210 */
Signature · 1 line
2.45.2
#1 lore raw

PATCH 2/2 mt76: mt76x2: Disable VHT on 0x76320044 ASIC

From: Henk Vergonet <[email protected]>

VHT is not supported on ASIC revision 0x76320044

This fixes the 5G connectibity issue on LiteOn WN4519R module see https://github.com/openwrt/mt76/issues/971

And may also fix the 5G issues on the XBox One Wireless Adapter see https://github.com/openwrt/mt76/issues/200

---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +10 -1
index 33a14365ec9b..fbb337ef6b68 100644
@@ -191,6 +191,7 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 {
 	struct ieee80211_hw *hw = mt76_hw(dev);
 	struct mt76_usb *usb = &dev->mt76.usb;
+	bool vht_flag;
 	int err;
 
 	INIT_DELAYED_WORK(&dev->cal_work, mt76x2u_phy_calibrate);
@@ -217,7 +218,15 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 
 	/* check hw sg support in order to enable AMSDU */
 	hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_TX_SG_MAX_SIZE : 1;
-	err = mt76_register_device(&dev->mt76, true, mt76x02_rates,
+	switch(dev->mt76.rev ) {
+		/* these ASIC revisions do not support VHT */
+		case 0x76320044:
+			vht_flag = false;
+			break;
+		default:
+			vht_flag = true;
+	}
+	err = mt76_register_device(&dev->mt76, vht_flag, mt76x02_rates,
 				   ARRAY_SIZE(mt76x02_rates));
 	if (err)
 		goto fail;
Signature · 1 line
2.45.2
maintainer
#2 lore raw

Re: [PATCH 2/2] mt76: mt76x2: Disable VHT on 0x76320044 ASIC

Quoted 4 lines

From: Henk Vergonet <[email protected]>

VHT is not supported on ASIC revision 0x76320044

Quoted 8 lines

This fixes the 5G connectibity issue on LiteOn WN4519R module see https://github.com/openwrt/mt76/issues/971

And may also fix the 5G issues on the XBox One Wireless Adapter see https://github.com/openwrt/mt76/issues/200

---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

I think this patch must be squashed with the previous one. Moreover, can you please run checkpatch.pl? There are some coding style problems here.

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 194

Quoted 10 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +1 -0
index 33a14365ec9b..fbb337ef6b68 100644
@@ -191,6 +191,7 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 {
 	struct ieee80211_hw *hw = mt76_hw(dev);
 	struct mt76_usb *usb = &dev->mt76.usb;
+	bool vht_flag;

maybe something more meaningful, like 'is_vht' or even just 'vht'.

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 221

Quoted 9 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +1 -1
 	int err;
 
 	INIT_DELAYED_WORK(&dev->cal_work, mt76x2u_phy_calibrate);
@@ -217,7 +218,15 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 
 	/* check hw sg support in order to enable AMSDU */
 	hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_TX_SG_MAX_SIZE : 1;
-	err = mt76_register_device(&dev->mt76, true, mt76x02_rates,
+	switch(dev->mt76.rev ) {

remove space before ')'

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 223

Quoted 2 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +2 -0
+		/* these ASIC revisions do not support VHT */
+		case 0x76320044:

are you sure this is true for all '0x76320044' ASICs?

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 227

Quoted 4 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +4 -0
+			vht_flag = false;
+			break;
+		default:
+			vht_flag = true;

missing break

Quoted 8 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +2 -0
+	}
+	err = mt76_register_device(&dev->mt76, vht_flag, mt76x02_rates,
 				   ARRAY_SIZE(mt76x02_rates));
 	if (err)
 		goto fail;
Signature · 1 line
2.45.2
#3 lore raw

Re: [PATCH 2/2] mt76: mt76x2: Disable VHT on 0x76320044 ASIC

Hi Lorenzo,

Thank you for the review.

I will rename 'vht_flag' to 'vht', squash the patch and apply your suggested corrections.

Also I did search of the "ASIC revision: 76320044" and as far as I can tell turned out to be related to the Xbox wireless dongle. It had similar issues as I experienced with the LiteOn module when VHT was enabled. So I think it is fair to assume this will fix more than it breaks.

But I can't be sure of course, I don't work at Mediatek and this information is not publicly available to my knowledge.
The Mediatek girls and guys on this list should be able to step in and provide an overview of the different ASIC revisions and their capabilities probably ;)

Kind regards,
Henk

Quoted 55 lines · Lorenzo Bianconi
Quoted 4 lines

From: Henk Vergonet <[email protected]>

VHT is not supported on ASIC revision 0x76320044

Quoted 8 lines

This fixes the 5G connectibity issue on LiteOn WN4519R module see https://github.com/openwrt/mt76/issues/971

And may also fix the 5G issues on the XBox One Wireless Adapter see https://github.com/openwrt/mt76/issues/200

---
  drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)

I think this patch must be squashed with the previous one. Moreover, can you please run checkpatch.pl? There are some coding style problems here.

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 194

Quoted 9 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +1 -0
index 33a14365ec9b..fbb337ef6b68 100644
@@ -191,6 +191,7 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
  {
  	struct ieee80211_hw *hw = mt76_hw(dev);
  	struct mt76_usb *usb = &dev->mt76.usb;
+	bool vht_flag;

maybe something more meaningful, like 'is_vht' or even just 'vht'.

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 221

Quoted 9 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +1 -1
  	int err;
 
  	INIT_DELAYED_WORK(&dev->cal_work, mt76x2u_phy_calibrate);
@@ -217,7 +218,15 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 
  	/* check hw sg support in order to enable AMSDU */
  	hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_TX_SG_MAX_SIZE : 1;
-	err = mt76_register_device(&dev->mt76, true, mt76x02_rates,
+	switch(dev->mt76.rev ) {

remove space before ')'

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 223

Quoted 2 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +2 -0
+		/* these ASIC revisions do not support VHT */
+		case 0x76320044:

are you sure this is true for all '0x76320044' ASICs?

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 227

Quoted 4 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +4 -0
+			vht_flag = false;
+			break;
+		default:
+			vht_flag = true;

missing break

Quoted 8 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +2 -0
+	}
+	err = mt76_register_device(&dev->mt76, vht_flag, mt76x02_rates,
  				   ARRAY_SIZE(mt76x02_rates));
  	if (err)
  		goto fail;
Signature · 1 line
2.45.2
#4 lore raw

PATCH v2 1/1 wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R

In reply to Lorenzo Bianconi

Ads support for:
- LiteOn WN4516R
- LiteOn WN4519R
Both use:
- A nonstandard USB connector
- Mediatek chipset MT7600U
- ASIC revision: 76320044

Disabled VHT support on ASIC revision 76320044:

This fixes the 5G connectibity issue on LiteOn WN4519R module see https://github.com/openwrt/mt76/issues/971

And may also fix the 5G issues on the XBox One Wireless Adapter see https://github.com/openwrt/mt76/issues/200

I have looked at the FCC info related to the MT7632U chip as mentioned in here:
https://github.com/openwrt/mt76/issues/459
These confirm the chipset does not support 'ac' mode and hence VHT should be turned of.

---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb.c      |  2 ++
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c +2 -0
index 84ef80ab4afb..96cecc576a98 100644
@@ -17,6 +17,8 @@ static const struct usb_device_id mt76x2u_device_table[] = {
 	{ USB_DEVICE(0x057c, 0x8503) },	/* Avm FRITZ!WLAN AC860 */
 	{ USB_DEVICE(0x7392, 0xb711) },	/* Edimax EW 7722 UAC */
 	{ USB_DEVICE(0x0e8d, 0x7632) },	/* HC-M7662BU1 */
+	{ USB_DEVICE(0x0471, 0x2126) }, /* LiteOn WN4516R module, nonstandard USB connector */
+	{ USB_DEVICE(0x0471, 0x7600) }, /* LiteOn WN4519R module, nonstandard USB connector */
 	{ USB_DEVICE(0x2c4e, 0x0103) },	/* Mercury UD13 */
 	{ USB_DEVICE(0x0846, 0x9014) },	/* Netgear WNDA3100v3 */
 	{ USB_DEVICE(0x0846, 0x9053) },	/* Netgear A6210 */
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +11 -1
index 33a14365ec9b..eb5e957f2f1b 100644
@@ -191,6 +191,7 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 {
 	struct ieee80211_hw *hw = mt76_hw(dev);
 	struct mt76_usb *usb = &dev->mt76.usb;
+	bool vht;
 	int err;
 
 	INIT_DELAYED_WORK(&dev->cal_work, mt76x2u_phy_calibrate);
@@ -217,7 +218,16 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 
 	/* check hw sg support in order to enable AMSDU */
 	hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_TX_SG_MAX_SIZE : 1;
-	err = mt76_register_device(&dev->mt76, true, mt76x02_rates,
+	switch (dev->mt76.rev) {
+		/* these ASIC revisions do not support VHT */
+	case 0x76320044:
+		vht = false;
+		break;
+	default:
+		vht = true;
+		break;
+	}
+	err = mt76_register_device(&dev->mt76, vht, mt76x02_rates,
 				   ARRAY_SIZE(mt76x02_rates));
 	if (err)
 		goto fail;
Signature · 1 line
2.45.2
maintainer Acked-by on v2 1/1
#5 lore raw

Re: [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R

Quoted 9 lines

Ads support for:
- LiteOn WN4516R
- LiteOn WN4519R
Both use:
- A nonstandard USB connector
- Mediatek chipset MT7600U
- ASIC revision: 76320044

Disabled VHT support on ASIC revision 76320044:

Just a couple of nits inline. After fixing them please add my Acked-by

Quoted 43 lines

This fixes the 5G connectibity issue on LiteOn WN4519R module see https://github.com/openwrt/mt76/issues/971

And may also fix the 5G issues on the XBox One Wireless Adapter see https://github.com/openwrt/mt76/issues/200

I have looked at the FCC info related to the MT7632U chip as mentioned in here:
https://github.com/openwrt/mt76/issues/459
These confirm the chipset does not support 'ac' mode and hence VHT should be turned of.

---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb.c      |  2 ++
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c +2 -0
index 84ef80ab4afb..96cecc576a98 100644
@@ -17,6 +17,8 @@ static const struct usb_device_id mt76x2u_device_table[] = {
 	{ USB_DEVICE(0x057c, 0x8503) },	/* Avm FRITZ!WLAN AC860 */
 	{ USB_DEVICE(0x7392, 0xb711) },	/* Edimax EW 7722 UAC */
 	{ USB_DEVICE(0x0e8d, 0x7632) },	/* HC-M7662BU1 */
+	{ USB_DEVICE(0x0471, 0x2126) }, /* LiteOn WN4516R module, nonstandard USB connector */
+	{ USB_DEVICE(0x0471, 0x7600) }, /* LiteOn WN4519R module, nonstandard USB connector */
 	{ USB_DEVICE(0x2c4e, 0x0103) },	/* Mercury UD13 */
 	{ USB_DEVICE(0x0846, 0x9014) },	/* Netgear WNDA3100v3 */
 	{ USB_DEVICE(0x0846, 0x9053) },	/* Netgear A6210 */
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +1 -0
index 33a14365ec9b..eb5e957f2f1b 100644
@@ -191,6 +191,7 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 {
 	struct ieee80211_hw *hw = mt76_hw(dev);
 	struct mt76_usb *usb = &dev->mt76.usb;
+	bool vht;
 	int err;
 
 	INIT_DELAYED_WORK(&dev->cal_work, mt76x2u_phy_calibrate);

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 222

Quoted 6 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +2 -1
@@ -217,7 +218,16 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 
 	/* check hw sg support in order to enable AMSDU */
 	hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_TX_SG_MAX_SIZE : 1;
-	err = mt76_register_device(&dev->mt76, true, mt76x02_rates,
+	switch (dev->mt76.rev) {
+		/* these ASIC revisions do not support VHT */

please move this comment in the proper case.

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 229

Quoted 7 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +7 -0
+	case 0x76320044:
+		vht = false;
+		break;
+	default:
+		vht = true;
+		break;
+	}

since you are reposting, can you please add a new-line here?

Quoted 7 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +1 -0
+	err = mt76_register_device(&dev->mt76, vht, mt76x02_rates,
 				   ARRAY_SIZE(mt76x02_rates));
 	if (err)
 		goto fail;
Signature · 1 line
2.45.2
#6 lore raw

PATCH v3 1/1 wifi: mt76x2: Add support for LiteOn WN4516R,WN4519R

Adds support for:
- LiteOn WN4516R
- LiteOn WN4519R
Both use:
- A nonstandard USB connector
- Mediatek chipset MT7600U
- ASIC revision: 76320044

Disabled VHT support on ASIC revision 76320044:

This fixes the 5G connectibity issue on LiteOn WN4519R module see https://github.com/openwrt/mt76/issues/971

And may also fix the 5G issues on the XBox One Wireless Adapter see https://github.com/openwrt/mt76/issues/200

I have looked at the FCC info related to the MT7632U chip as mentioned in here:
https://github.com/openwrt/mt76/issues/459
These confirm the chipset does not support 'ac' mode and hence VHT should be turned of.

---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb.c     |  2 ++
 .../net/wireless/mediatek/mt76/mt76x2/usb_init.c    | 13 ++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c +2 -0
index 84ef80ab4afb..96cecc576a98 100644
@@ -17,6 +17,8 @@ static const struct usb_device_id mt76x2u_device_table[] = {
 	{ USB_DEVICE(0x057c, 0x8503) },	/* Avm FRITZ!WLAN AC860 */
 	{ USB_DEVICE(0x7392, 0xb711) },	/* Edimax EW 7722 UAC */
 	{ USB_DEVICE(0x0e8d, 0x7632) },	/* HC-M7662BU1 */
+	{ USB_DEVICE(0x0471, 0x2126) }, /* LiteOn WN4516R module, nonstandard USB connector */
+	{ USB_DEVICE(0x0471, 0x7600) }, /* LiteOn WN4519R module, nonstandard USB connector */
 	{ USB_DEVICE(0x2c4e, 0x0103) },	/* Mercury UD13 */
 	{ USB_DEVICE(0x0846, 0x9014) },	/* Netgear WNDA3100v3 */
 	{ USB_DEVICE(0x0846, 0x9053) },	/* Netgear A6210 */
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +12 -1
index 33a14365ec9b..3b5562811511 100644
@@ -191,6 +191,7 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 {
 	struct ieee80211_hw *hw = mt76_hw(dev);
 	struct mt76_usb *usb = &dev->mt76.usb;
+	bool vht;
 	int err;
 
 	INIT_DELAYED_WORK(&dev->cal_work, mt76x2u_phy_calibrate);
@@ -217,7 +218,17 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 
 	/* check hw sg support in order to enable AMSDU */
 	hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_TX_SG_MAX_SIZE : 1;
-	err = mt76_register_device(&dev->mt76, true, mt76x02_rates,
+	switch (dev->mt76.rev) {
+	case 0x76320044:
+		/* these ASIC revisions do not support VHT */
+		vht = false;
+		break;
+	default:
+		vht = true;
+		break;
+	}
+
+	err = mt76_register_device(&dev->mt76, vht, mt76x02_rates,
 				   ARRAY_SIZE(mt76x02_rates));
 	if (err)
 		goto fail;
Signature · 1 line
2.45.2
#7 lore raw

Re: [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R

In reply to Lorenzo Bianconi

Hi Lorenzo!

I am getting a little better at this now :)
v3 is on the list.

Thank you for the support!

Quoted 79 lines · Lorenzo Bianconi
Quoted 9 lines

Ads support for:
- LiteOn WN4516R
- LiteOn WN4519R
Both use:
- A nonstandard USB connector
- Mediatek chipset MT7600U
- ASIC revision: 76320044

Disabled VHT support on ASIC revision 76320044:

Just a couple of nits inline. After fixing them please add my Acked-by

Quoted 42 lines

This fixes the 5G connectibity issue on LiteOn WN4519R module see https://github.com/openwrt/mt76/issues/971

And may also fix the 5G issues on the XBox One Wireless Adapter see https://github.com/openwrt/mt76/issues/200

I have looked at the FCC info related to the MT7632U chip as mentioned in here:
https://github.com/openwrt/mt76/issues/459
These confirm the chipset does not support 'ac' mode and hence VHT should be turned of.

---
  drivers/net/wireless/mediatek/mt76/mt76x2/usb.c      |  2 ++
  drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c | 12 +++++++++++-
  2 files changed, 13 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c +2 -0
index 84ef80ab4afb..96cecc576a98 100644
@@ -17,6 +17,8 @@ static const struct usb_device_id mt76x2u_device_table[] = {
  	{ USB_DEVICE(0x057c, 0x8503) },	/* Avm FRITZ!WLAN AC860 */
  	{ USB_DEVICE(0x7392, 0xb711) },	/* Edimax EW 7722 UAC */
  	{ USB_DEVICE(0x0e8d, 0x7632) },	/* HC-M7662BU1 */
+	{ USB_DEVICE(0x0471, 0x2126) }, /* LiteOn WN4516R module, nonstandard USB connector */
+	{ USB_DEVICE(0x0471, 0x7600) }, /* LiteOn WN4519R module, nonstandard USB connector */
  	{ USB_DEVICE(0x2c4e, 0x0103) },	/* Mercury UD13 */
  	{ USB_DEVICE(0x0846, 0x9014) },	/* Netgear WNDA3100v3 */
  	{ USB_DEVICE(0x0846, 0x9053) },	/* Netgear A6210 */
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +1 -0
index 33a14365ec9b..eb5e957f2f1b 100644
@@ -191,6 +191,7 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
  {
  	struct ieee80211_hw *hw = mt76_hw(dev);
  	struct mt76_usb *usb = &dev->mt76.usb;
+	bool vht;
  	int err;
 
  	INIT_DELAYED_WORK(&dev->cal_work, mt76x2u_phy_calibrate);

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 222

Quoted 6 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +2 -1
@@ -217,7 +218,16 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
 
  	/* check hw sg support in order to enable AMSDU */
  	hw->max_tx_fragments = dev->mt76.usb.sg_en ? MT_TX_SG_MAX_SIZE : 1;
-	err = mt76_register_device(&dev->mt76, true, mt76x02_rates,
+	switch (dev->mt76.rev) {
+		/* these ASIC revisions do not support VHT */

please move this comment in the proper case.

drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c int mt76x2u_register_device(struct mt76x02_dev *dev) · line 229

Quoted 7 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +7 -0
+	case 0x76320044:
+		vht = false;
+		break;
+	default:
+		vht = true;
+		break;
+	}

since you are reposting, can you please add a new-line here?

Quoted 7 lines
drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c +1 -0
+	err = mt76_register_device(&dev->mt76, vht, mt76x02_rates,
  				   ARRAY_SIZE(mt76x02_rates));
  	if (err)
  		goto fail;
Signature · 1 line
2.45.2