Bug 217312 - mt76x0u reporting wrong MAX_TX_POWER
Summary: mt76x0u reporting wrong MAX_TX_POWER
Status: RESOLVED OBSOLETE
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-09 07:13 UTC by Michael
Modified: 2024-08-03 17:07 UTC (History)
0 users

See Also:
Kernel Version: 6.2.10
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Michael 2023-04-09 07:13:22 UTC
mt76x0u reporting wrong MAX_TX_POWER on all frequencies:

Test device: ALFA AWUS036ACHM
$ lsusb
Bus 002 Device 003: ID 0e8d:7610 MediaTek Inc. WiFi

Wireless Regulatory Domain settings:
$ iw reg get
global
country US: DFS-FCC
	(902 - 904 @ 2), (N/A, 30), (N/A)
	(904 - 920 @ 16), (N/A, 30), (N/A)
	(920 - 928 @ 8), (N/A, 30), (N/A)
	(2400 - 2472 @ 40), (N/A, 30), (N/A)
	(5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
	(5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
	(5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
	(5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
	(5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
	(5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
	(57240 - 71000 @ 2160), (N/A, 40), (N/A)

TX power e.g. on 2.4GHZ expected 30 dBm:
	(2400 - 2472 @ 40), (N/A, 30), (N/A)

TX power shown by iw
$iw dev
phy#1
	Interface wlp5s0f4u2
		ifindex 4
		wdev 0x100000001
		addr fe:6c:e7:0e:99:37
		type managed
		txpower 3.00 dBm
		multicast TXQ:
			qsz-byt	qsz-pkt	flows	drops	marks	overlmt	hashcol	tx-bytes	tx-packets
			0	0	0	0	0	0	0	00

in detail:
$ iw list
$ iw list
Wiphy phy1
...
	Band 1:
...
		Frequencies:
			* 2412 MHz [1] (3.0 dBm)
			* 2417 MHz [2] (3.0 dBm)
			* 2422 MHz [3] (3.0 dBm)
			* 2427 MHz [4] (3.0 dBm)
			* 2432 MHz [5] (3.0 dBm)
			* 2437 MHz [6] (3.0 dBm)
			* 2442 MHz [7] (3.0 dBm)
			* 2447 MHz [8] (3.0 dBm)
			* 2452 MHz [9] (3.0 dBm)
			* 2457 MHz [10] (3.0 dBm)
			* 2462 MHz [11] (3.0 dBm)
			* 2467 MHz [12] (disabled)
			* 2472 MHz [13] (disabled)
			* 2484 MHz [14] (disabled)
...
	Band 2:
		Frequencies:
			* 5180 MHz [36] (16.0 dBm)
			* 5200 MHz [40] (16.0 dBm)
			* 5220 MHz [44] (16.0 dBm)
			* 5240 MHz [48] (16.0 dBm)
			* 5260 MHz [52] (16.0 dBm) (radar detection)
			* 5280 MHz [56] (15.0 dBm) (radar detection)
			* 5300 MHz [60] (15.0 dBm) (radar detection)
			* 5320 MHz [64] (15.0 dBm) (radar detection)
			* 5500 MHz [100] (13.0 dBm) (radar detection)
			* 5520 MHz [104] (12.0 dBm) (radar detection)
			* 5540 MHz [108] (12.0 dBm) (radar detection)
			* 5560 MHz [112] (12.0 dBm) (radar detection)
			* 5580 MHz [116] (12.0 dBm) (radar detection)
			* 5600 MHz [120] (12.0 dBm) (radar detection)
			* 5620 MHz [124] (12.0 dBm) (radar detection)
			* 5640 MHz [128] (12.0 dBm) (radar detection)
			* 5660 MHz [132] (12.0 dBm) (radar detection)
			* 5680 MHz [136] (12.0 dBm) (radar detection)
			* 5700 MHz [140] (13.0 dBm) (radar detection)
			* 5720 MHz [144] (13.0 dBm) (radar detection)
			* 5745 MHz [149] (13.0 dBm)
			* 5765 MHz [153] (13.0 dBm)
			* 5785 MHz [157] (13.0 dBm)
			* 5805 MHz [161] (13.0 dBm)
			* 5825 MHz [165] (14.0 dBm)
			* 5845 MHz [169] (6.0 dBm) (no IR)
			* 5865 MHz [173] (6.0 dBm) (no IR)
...


confirmed by hcxdumptool:
$ hcxdumptool -I wlp5s0f4u2
Requesting interface capabilities. This may take some time.
Please be patient...
interface information:
phy idx hw-mac       virtual-mac  m ifname           driver (protocol)
---------------------------------------------------------------------------------------------
  1   4 00c0cab10a87 fe6ce70e9937 * wlp5s0f4u2       mt76x0u (NETLINK & WIRELESS EXTENSIONS)

available frequencies: frequency [channel] tx-power
  2412 [  1] 3.0 dBm	  2417 [  2] 3.0 dBm	  2422 [  3] 3.0 dBm	  2427 [  4] 3.0 dBm
  2432 [  5] 3.0 dBm	  2437 [  6] 3.0 dBm	  2442 [  7] 3.0 dBm	  2447 [  8] 3.0 dBm
  2452 [  9] 3.0 dBm	  2457 [ 10] 3.0 dBm	  2462 [ 11] 3.0 dBm	  2467 [ 12] disabled
  2472 [ 13] disabled	  2484 [ 14] disabled	  5180 [ 36] 16.0 dBm	  5200 [ 40] 16.0 dBm
  5220 [ 44] 16.0 dBm	  5240 [ 48] 16.0 dBm	  5260 [ 52] 16.0 dBm	  5280 [ 56] 15.0 dBm
  5300 [ 60] 15.0 dBm	  5320 [ 64] 15.0 dBm	  5500 [100] 13.0 dBm	  5520 [104] 12.0 dBm
  5540 [108] 12.0 dBm	  5560 [112] 12.0 dBm	  5580 [116] 12.0 dBm	  5600 [120] 12.0 dBm
  5620 [124] 12.0 dBm	  5640 [128] 12.0 dBm	  5660 [132] 12.0 dBm	  5680 [136] 12.0 dBm
  5700 [140] 13.0 dBm	  5720 [144] 13.0 dBm	  5745 [149] 13.0 dBm	  5765 [153] 13.0 dBm
  5785 [157] 13.0 dBm	  5805 [161] 13.0 dBm	  5825 [165] 14.0 dBm	  5845 [169] 6.0 dBm
  5865 [173] 6.0 dBm

bye-bye


iw and hcxdumptool get TX power values from NL80211.
It is worth it to take a look at the reported values by NETLINK via Wireshark.
Wireshark nlmon Generic Netlink Protocol, e.g. of 2.4 GHz frequency 2422MHz:
expected: NL80211_FREQUENCY_ATTR_MAX_TX_POWER: (3000)== 30.0 dBm 
but Attribute Value: 0x0000012c (300)


in detail:
Attribute: NL80211_FREQUENCY_ATTR_FREQ
    Len: 8
    Type: 0x0001, NL80211_FREQUENCY_ATTR_FREQ (1)
        0... .... .... .... = Nested: False
        .0.. .... .... .... = Network byte order: False
        Attribute Type: NL80211_FREQUENCY_ATTR_FREQ (1)
    Attribute Value: 0x00000976 (2422)
...
Type: 0x0006, NL80211_FREQUENCY_ATTR_MAX_TX_POWER (6)
    0... .... .... .... = Nested: False
    .0.. .... .... .... = Network byte order: False
    Attribute Type: NL80211_FREQUENCY_ATTR_MAX_TX_POWER (6)

Attribute: NL80211_FREQUENCY_ATTR_MAX_TX_POWER
    Len: 8
    Type: 0x0006, NL80211_FREQUENCY_ATTR_MAX_TX_POWER (6)
        0... .... .... .... = Nested: False
        .0.. .... .... .... = Network byte order: False
        Attribute Type: NL80211_FREQUENCY_ATTR_MAX_TX_POWER (6)
    Attribute Value: 0x0000012c (300)
Comment 1 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-04-12 11:44:30 UTC
did this work correctly on earlier kernel versions? which ones?
Comment 2 Michael 2023-04-12 12:45:03 UTC
I guess it is not a regression.
Going back to kernel 5.15.32 showing the same results.
I suspect it has never worked.
Comment 3 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-04-12 12:50:52 UTC
k, thx for checking and letting me know, than it's nothing for my todo list
Comment 4 Michael 2023-04-12 12:59:06 UTC
I fully agree.

I guess the driver doesn't read the correct information from the device.

Here is another one: ASUS AC51
ID 0b05:17d1 ASUSTek Computer, Inc. AC51 802.11a/b/g/n/ac Wireless Adapter [Mediatek MT7610U]

same regulatory domain:
$ iw list
		Frequencies:
			* 2412 MHz [1] (16.0 dBm)
			* 2417 MHz [2] (16.0 dBm)
			* 2422 MHz [3] (16.0 dBm)
			* 2427 MHz [4] (16.0 dBm)
			* 2432 MHz [5] (16.0 dBm)
			* 2437 MHz [6] (16.0 dBm)
			* 2442 MHz [7] (16.0 dBm)
			* 2447 MHz [8] (16.0 dBm)
			* 2452 MHz [9] (16.0 dBm)
			* 2457 MHz [10] (16.0 dBm)
			* 2462 MHz [11] (16.0 dBm)
			* 2467 MHz [12] (disabled)
			* 2472 MHz [13] (disabled)
			* 2484 MHz [14] (disabled)

...
			* 5180 MHz [36] (20.0 dBm)
			* 5200 MHz [40] (20.0 dBm)
			* 5220 MHz [44] (20.0 dBm)
			* 5240 MHz [48] (20.0 dBm)
			* 5260 MHz [52] (20.0 dBm) (radar detection)
			* 5280 MHz [56] (20.0 dBm) (radar detection)
			* 5300 MHz [60] (20.0 dBm) (radar detection)
			* 5320 MHz [64] (20.0 dBm) (radar detection)
			* 5500 MHz [100] (20.0 dBm) (radar detection)
			* 5520 MHz [104] (20.0 dBm) (radar detection)
			* 5540 MHz [108] (20.0 dBm) (radar detection)
			* 5560 MHz [112] (20.0 dBm) (radar detection)
			* 5580 MHz [116] (20.0 dBm) (radar detection)
			* 5600 MHz [120] (20.0 dBm) (radar detection)
			* 5620 MHz [124] (20.0 dBm) (radar detection)
			* 5640 MHz [128] (20.0 dBm) (radar detection)
			* 5660 MHz [132] (20.0 dBm) (radar detection)
			* 5680 MHz [136] (20.0 dBm) (radar detection)
			* 5700 MHz [140] (20.0 dBm) (radar detection)
			* 5720 MHz [144] (20.0 dBm) (radar detection)
			* 5745 MHz [149] (20.0 dBm)
			* 5765 MHz [153] (20.0 dBm)
			* 5785 MHz [157] (20.0 dBm)
			* 5805 MHz [161] (20.0 dBm)
			* 5825 MHz [165] (20.0 dBm)
			* 5845 MHz [169] (20.0 dBm) (no IR)
			* 5865 MHz [173] (20.0 dBm) (no IR)


$ hcxdumptool -I wlp39s0f3u1u1u1

Requesting interface capabilities. This may take some time.
Please be patient...


interface information:

phy idx hw-mac       virtual-mac  m ifname           driver (protocol)
---------------------------------------------------------------------------------------------
  1   4 0c9d92b486ca 0c9d92b486ca * wlp39s0f3u1u1u1  mt76x0u (NETLINK & WIRELESS EXTENSIONS)


available frequencies: frequency [channel] tx-power of Regulatory Domain: US

  2412 [  1] 16.0 dBm	  2417 [  2] 16.0 dBm	  2422 [  3] 16.0 dBm	  2427 [  4] 16.0 dBm
  2432 [  5] 16.0 dBm	  2437 [  6] 16.0 dBm	  2442 [  7] 16.0 dBm	  2447 [  8] 16.0 dBm
  2452 [  9] 16.0 dBm	  2457 [ 10] 16.0 dBm	  2462 [ 11] 16.0 dBm	  2467 [ 12] disabled
  2472 [ 13] disabled	  2484 [ 14] disabled	  5180 [ 36] 20.0 dBm	  5200 [ 40] 20.0 dBm
  5220 [ 44] 20.0 dBm	  5240 [ 48] 20.0 dBm	  5260 [ 52] 20.0 dBm	  5280 [ 56] 20.0 dBm
  5300 [ 60] 20.0 dBm	  5320 [ 64] 20.0 dBm	  5500 [100] 20.0 dBm	  5520 [104] 20.0 dBm
  5540 [108] 20.0 dBm	  5560 [112] 20.0 dBm	  5580 [116] 20.0 dBm	  5600 [120] 20.0 dBm
  5620 [124] 20.0 dBm	  5640 [128] 20.0 dBm	  5660 [132] 20.0 dBm	  5680 [136] 20.0 dBm
  5700 [140] 20.0 dBm	  5720 [144] 20.0 dBm	  5745 [149] 20.0 dBm	  5765 [153] 20.0 dBm
  5785 [157] 20.0 dBm	  5805 [161] 20.0 dBm	  5825 [165] 20.0 dBm	  5845 [169] 20.0 dBm
  5865 [173] 20.0 dBm

bye-bye

Note You need to log in before you can comment on or make changes to this bug.