diff mbox series

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

Message ID 20250418002827.26806-2-henk.vergonet@gmail.com (mailing list archive)
State New
Delegated to: Felix Fietkau
Headers show
Series [1/2] mt76: mt76x2: Add support for LiteOn: WN4516R, WN4519R | expand

Checks

Context Check Description
wifibot/fixes_present success Fixes tag not required for -next series
wifibot/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
wifibot/tree_selection success Guessed tree name to be wireless-next
wifibot/ynl success Generated files up to date; no warnings/errors; no diff in generated;
wifibot/build_32bit success Errors and warnings before: 1 this patch: 1
wifibot/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
wifibot/build_clang success Errors and warnings before: 2 this patch: 2
wifibot/build_clang_rust success No Rust files in patch. Skipping build
wifibot/build_tools success No tools touched, skip
wifibot/check_selftest success No net selftest shell script
wifibot/checkpatch fail ERROR: space prohibited before that close parenthesis ')' ERROR: space required before the open parenthesis '(' ERROR: switch and case should be at the same indent
wifibot/deprecated_api success None detected
wifibot/header_inline success No static functions without inline keyword in header files
wifibot/kdoc success Errors and warnings before: 0 this patch: 0
wifibot/source_inline success Was 0 now: 0
wifibot/verify_fixes success No Fixes tag
wifibot/verify_signedoff fail author Signed-off-by missing

Commit Message

Henk Vergonet April 18, 2025, 12:28 a.m. UTC
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(-)

Comments

Lorenzo Bianconi April 18, 2025, 12:38 p.m. UTC | #1
> 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
>
Henk Vergonet April 18, 2025, 1:36 p.m. UTC | #2
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
>>
diff mbox series

Patch

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;