Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 1/2] mt76: mt76x2: Add support for LiteOn: WN4516R, WN4519R
@ 2025-04-18  0:28 Henk Vergonet
  2025-04-18  0:28 ` [PATCH 2/2] mt76: mt76x2: Disable VHT on 0x76320044 ASIC Henk Vergonet
  0 siblings, 1 reply; 8+ messages in thread
From: Henk Vergonet @ 2025-04-18  0:28 UTC (permalink / raw)
  To: linux-wireless; +Cc: Felix Fietkau, Lorenzo Bianconi, Henk Vergonet

From: Henk Vergonet <Henk.Vergonet@gmail.com>

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(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
index 84ef80ab4afb..96cecc576a98 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
@@ -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 */
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] mt76: mt76x2: Disable VHT on 0x76320044 ASIC
  2025-04-18  0:28 [PATCH 1/2] mt76: mt76x2: Add support for LiteOn: WN4516R, WN4519R Henk Vergonet
@ 2025-04-18  0:28 ` Henk Vergonet
  2025-04-18 12:38   ` Lorenzo Bianconi
  0 siblings, 1 reply; 8+ messages in thread
From: Henk Vergonet @ 2025-04-18  0:28 UTC (permalink / raw)
  To: linux-wireless; +Cc: Felix Fietkau, Lorenzo Bianconi, Henk Vergonet

From: Henk Vergonet <Henk.Vergonet@gmail.com>

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(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
index 33a14365ec9b..fbb337ef6b68 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
@@ -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;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] mt76: mt76x2: Disable VHT on 0x76320044 ASIC
  2025-04-18  0:28 ` [PATCH 2/2] mt76: mt76x2: Disable VHT on 0x76320044 ASIC Henk Vergonet
@ 2025-04-18 12:38   ` Lorenzo Bianconi
  2025-04-18 13:36     ` Henk Vergonet
  2025-04-18 14:06     ` [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R Henk Vergonet
  0 siblings, 2 replies; 8+ messages in thread
From: Lorenzo Bianconi @ 2025-04-18 12:38 UTC (permalink / raw)
  To: Henk Vergonet; +Cc: linux-wireless, Felix Fietkau

[-- Attachment #1: Type: text/plain, Size: 2003 bytes --]

> From: Henk Vergonet <Henk.Vergonet@gmail.com>
> 
> 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(-)

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.

> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
> index 33a14365ec9b..fbb337ef6b68 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
> @@ -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'.

>  	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 ')'

> +		/* these ASIC revisions do not support VHT */
> +		case 0x76320044:

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

> +			vht_flag = false;
> +			break;
> +		default:
> +			vht_flag = true;

missing break

> +	}
> +	err = mt76_register_device(&dev->mt76, vht_flag, mt76x02_rates,
>  				   ARRAY_SIZE(mt76x02_rates));
>  	if (err)
>  		goto fail;
> -- 
> 2.45.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] mt76: mt76x2: Disable VHT on 0x76320044 ASIC
  2025-04-18 12:38   ` Lorenzo Bianconi
@ 2025-04-18 13:36     ` Henk Vergonet
  2025-04-18 14:06     ` [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R Henk Vergonet
  1 sibling, 0 replies; 8+ messages in thread
From: Henk Vergonet @ 2025-04-18 13:36 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-wireless, Felix Fietkau

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

On 4/18/25 14:38, Lorenzo Bianconi wrote:
>> From: Henk Vergonet <Henk.Vergonet@gmail.com>
>>
>> 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(-)
> 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.
>
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
>> index 33a14365ec9b..fbb337ef6b68 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
>> @@ -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'.
>
>>   	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 ')'
>
>> +		/* these ASIC revisions do not support VHT */
>> +		case 0x76320044:
> are you sure this is true for all '0x76320044' ASICs?
>
>> +			vht_flag = false;
>> +			break;
>> +		default:
>> +			vht_flag = true;
> missing break
>
>> +	}
>> +	err = mt76_register_device(&dev->mt76, vht_flag, mt76x02_rates,
>>   				   ARRAY_SIZE(mt76x02_rates));
>>   	if (err)
>>   		goto fail;
>> -- 
>> 2.45.2
>>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R
  2025-04-18 12:38   ` Lorenzo Bianconi
  2025-04-18 13:36     ` Henk Vergonet
@ 2025-04-18 14:06     ` Henk Vergonet
  2025-04-18 14:18       ` Lorenzo Bianconi
  1 sibling, 1 reply; 8+ messages in thread
From: Henk Vergonet @ 2025-04-18 14:06 UTC (permalink / raw)
  To: linux-wireless; +Cc: Felix Fietkau, Lorenzo Bianconi, Henk Vergonet

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.

Signed-off-by: Henk Vergonet <henk.vergonet@gmail.com>
---
 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(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
index 84ef80ab4afb..96cecc576a98 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
@@ -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 */
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
index 33a14365ec9b..eb5e957f2f1b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
@@ -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;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R
  2025-04-18 14:06     ` [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R Henk Vergonet
@ 2025-04-18 14:18       ` Lorenzo Bianconi
  2025-04-18 14:39         ` [PATCH v3] wifi: mt76x2: Add support for LiteOn WN4516R,WN4519R Henk Vergonet
  2025-04-18 14:46         ` [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R Henk Vergonet
  0 siblings, 2 replies; 8+ messages in thread
From: Lorenzo Bianconi @ 2025-04-18 14:18 UTC (permalink / raw)
  To: Henk Vergonet; +Cc: linux-wireless, Felix Fietkau

[-- Attachment #1: Type: text/plain, Size: 3277 bytes --]

> 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

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> 
>  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.
> 
> Signed-off-by: Henk Vergonet <henk.vergonet@gmail.com>
> ---
>  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(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
> index 84ef80ab4afb..96cecc576a98 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
> @@ -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 */
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
> index 33a14365ec9b..eb5e957f2f1b 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
> @@ -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 */

please move this comment in the proper case.

> +	case 0x76320044:
> +		vht = false;
> +		break;
> +	default:
> +		vht = true;
> +		break;
> +	}

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

> +	err = mt76_register_device(&dev->mt76, vht, mt76x02_rates,
>  				   ARRAY_SIZE(mt76x02_rates));
>  	if (err)
>  		goto fail;
> -- 
> 2.45.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3] wifi: mt76x2: Add support for LiteOn WN4516R,WN4519R
  2025-04-18 14:18       ` Lorenzo Bianconi
@ 2025-04-18 14:39         ` Henk Vergonet
  2025-04-18 14:46         ` [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R Henk Vergonet
  1 sibling, 0 replies; 8+ messages in thread
From: Henk Vergonet @ 2025-04-18 14:39 UTC (permalink / raw)
  To: linux-wireless; +Cc: Felix Fietkau, Lorenzo Bianconi, Henk Vergonet

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.

Signed-off-by: Henk Vergonet <henk.vergonet@gmail.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 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(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
index 84ef80ab4afb..96cecc576a98 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
@@ -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 */
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
index 33a14365ec9b..3b5562811511 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
@@ -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;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R
  2025-04-18 14:18       ` Lorenzo Bianconi
  2025-04-18 14:39         ` [PATCH v3] wifi: mt76x2: Add support for LiteOn WN4516R,WN4519R Henk Vergonet
@ 2025-04-18 14:46         ` Henk Vergonet
  1 sibling, 0 replies; 8+ messages in thread
From: Henk Vergonet @ 2025-04-18 14:46 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-wireless, Felix Fietkau

Hi Lorenzo!

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

Thank you for the support!

On 4/18/25 16:18, Lorenzo Bianconi wrote:
>> 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
>
> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
>
>>   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.
>>
>> Signed-off-by: Henk Vergonet <henk.vergonet@gmail.com>
>> ---
>>   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(-)
>>
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
>> index 84ef80ab4afb..96cecc576a98 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c
>> @@ -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 */
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
>> index 33a14365ec9b..eb5e957f2f1b 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c
>> @@ -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 */
> please move this comment in the proper case.
>
>> +	case 0x76320044:
>> +		vht = false;
>> +		break;
>> +	default:
>> +		vht = true;
>> +		break;
>> +	}
> since you are reposting, can you please add a new-line here?
>
>> +	err = mt76_register_device(&dev->mt76, vht, mt76x02_rates,
>>   				   ARRAY_SIZE(mt76x02_rates));
>>   	if (err)
>>   		goto fail;
>> -- 
>> 2.45.2
>>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-04-18 14:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-18  0:28 [PATCH 1/2] mt76: mt76x2: Add support for LiteOn: WN4516R, WN4519R Henk Vergonet
2025-04-18  0:28 ` [PATCH 2/2] mt76: mt76x2: Disable VHT on 0x76320044 ASIC Henk Vergonet
2025-04-18 12:38   ` Lorenzo Bianconi
2025-04-18 13:36     ` Henk Vergonet
2025-04-18 14:06     ` [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R Henk Vergonet
2025-04-18 14:18       ` Lorenzo Bianconi
2025-04-18 14:39         ` [PATCH v3] wifi: mt76x2: Add support for LiteOn WN4516R,WN4519R Henk Vergonet
2025-04-18 14:46         ` [PATCH] [PATCH v2] wifi: mt76x2: Add support for LiteOn WN4516R and WN4519R Henk Vergonet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox