Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3856 - Totolink x5000r - wifi autodetection incompatible with iwinfo/luci #8876

Closed
openwrt-bot opened this issue Jun 6, 2021 · 5 comments
Labels

Comments

@openwrt-bot
Copy link

rgrgrg:

Device: x5000r on OpenWrt 21.02.0-rc1
Device: x5000r on OpenWrt 21.02.0-rc2

Autogenerated wifi configuration results in:

  • inability to set frequency in LUCI

  • channel analysis in LUCI shows only radio0 with incorrect frequency (radio0 is 2.4GHz, channel analysis shows chart for 5GHz)

  • iwinfo returns results only for 'iwinfo radio0 ...', but results are taken from phy1 (which belongs to radio1)

wifi down;rm /etc/config/wireless;wifi config;wifi up;sleep 5;echo radio0;iwinfo radio0 info; echo radio1;iwinfo radio1 info 'radio0' is disabled 'radio1' is disabled 'radio0' is disabled 'radio1' is disabled radio0 radio0 ESSID: unknown Access Point: 00:00:00:00:00:00 Mode: Unknown Channel: unknown (unknown) Center Channel 1: unknown 2: unknown Tx-Power: unknown Link Quality: unknown/70 Signal: unknown Noise: unknown Bit Rate: unknown Encryption: unknown Type: nl80211 HW Mode(s): 802.11nac Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E] TX power offset: none Frequency offset: none Supports VAPs: yes PHY name: phy1 radio1 No such wireless device: radio1 Generated device sections: config wifi-device 'radio0' option type 'mac80211' option channel '11' option hwmode '11g' option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0' option htmode 'HT20' option disabled '1'

config wifi-device 'radio1'
option type 'mac80211'
option channel '36'
option hwmode '11a'
option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0+1'
option htmode 'VHT80'
option disabled '1'

Enabling radios and editing files manually gives working configuration.

** Workaround **
Removing path and forcing correct phys makes luci/iwinfo happy.

Fixed device section:

config wifi-device 'radio0'
option type 'mac80211'
option channel '11'
option hwmode '11g'
option disabled_path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0
option phy 'phy0'
option htmode 'HT20'
option disabled '1'

config wifi-device 'radio1'
option type 'mac80211'
option channel '36'
option hwmode '11a'
option disabled_path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0
option phy 'phy1'
option htmode 'VHT80'
option disabled '1'

Result of iwinfo:

root@ap01:~# echo radio0;iwinfo radio0 info; echo radio1;iwinfo radio1 info
radio0
radio0 ESSID: unknown
Access Point: 00:00:00:00:00:00
Mode: Unknown Channel: unknown (unknown)
Center Channel 1: unknown 2: unknown
Tx-Power: unknown Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11bgn
Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy0
radio1
radio1 ESSID: unknown
Access Point: 00:00:00:00:00:00
Mode: Unknown Channel: unknown (unknown)
Center Channel 1: unknown 2: unknown
Tx-Power: unknown Link Quality: unknown/70
Signal: unknown Noise: unknown
Bit Rate: unknown
Encryption: unknown
Type: nl80211 HW Mode(s): 802.11nac
Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E]
TX power offset: none
Frequency offset: none
Supports VAPs: yes PHY name: phy1

@openwrt-bot
Copy link
Author

rgrgrg:

root@ap01:~# ls -F /sys/devices/platform/1e140000.pcie/pci0000:00/0000:00:01.0/ 0000:02:00.0/ current_link_speed enable modalias reset subsystem@ ari_enabled current_link_width irq msi_bus resource subsystem_device broken_parity_status device local_cpulist of_node@ resource1 subsystem_vendor class devspec local_cpus pci_bus/ revision uevent config dma_mask_bits max_link_speed remove secondary_bus_number vendor consistent_dma_mask_bits driver_override max_link_width rescan subordinate_bus_number root@ap01:~# root@ap01:~# ls -F /sys/devices/platform/1e140000.pcie/pci0000:00/0000:00:01.0/0000\:02\:00.0/ ari_enabled current_link_width enable max_link_width rescan revision broken_parity_status device ieee80211/ modalias reset subsystem@ class devspec irq msi_bus resource subsystem_device config dma_mask_bits local_cpulist net/ resource0 subsystem_vendor consistent_dma_mask_bits driver@ local_cpus of_node@ resource2 uevent current_link_speed driver_override max_link_speed remove resource4 vendor root@ap01:~# root@ap01:~# lspci -v 00:00.0 PCI bridge: Device 0e8d:0801 (rev 01) (prog-if 00 [Normal decode]) Device tree node: /sys/firmware/devicetree/base/pcie@1e140000/pcie@0,0 Flags: bus master, fast devsel, latency 0, IRQ 255 Memory at 60600000 (32-bit, non-prefetchable) [size=64K] Bus: primary=00, secondary=01, subordinate=01, sec-latency=0 I/O behind bridge: 00000000-00000fff [size=4K] Memory behind bridge: 60000000-600fffff [size=1M] Prefetchable memory behind bridge: 60100000-602fffff [size=2M] Capabilities: [40] Power Management version 3 Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+ Capabilities: [70] Express Root Port (Slot-), MSI 00 Capabilities: [100] Advanced Error Reporting Capabilities: [140] Virtual Channel lspci: Unable to load libkmod resources: error -12

00:01.0 PCI bridge: Device 0e8d:0801 (rev 01) (prog-if 00 [Normal decode])
Device tree node: /sys/firmware/devicetree/base/pcie@1e140000/pcie@1,0
Flags: bus master, fast devsel, latency 0, IRQ 255
Memory at 60610000 (32-bit, non-prefetchable) [size=64K]
Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
I/O behind bridge: 00001000-00001fff [size=4K]
Memory behind bridge: 60300000-603fffff [size=1M]
Prefetchable memory behind bridge: 60400000-605fffff [size=2M]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Root Port (Slot-), MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel

01:00.0 Unclassified device [0002]: MEDIATEK Corp. Device 7916 (prog-if 80)
Subsystem: MEDIATEK Corp. Device 7916
Flags: bus master, fast devsel, latency 0, IRQ 23
Memory at 60100000 (64-bit, prefetchable) [size=1M]
Memory at 60200000 (64-bit, prefetchable) [size=16K]
Memory at 60204000 (64-bit, prefetchable) [size=4K]
Capabilities: [80] Express Endpoint, MSI 00
Capabilities: [e0] MSI: Enable- Count=1/32 Maskable+ 64bit+
Capabilities: [f8] Power Management version 3
Capabilities: [100] Vendor Specific Information: ID=1556 Rev=1 Len=008 <?>
Capabilities: [108] Latency Tolerance Reporting
Capabilities: [110] L1 PM Substates
Capabilities: [200] Advanced Error Reporting
Kernel driver in use: mt7915e_hif

02:00.0 Unclassified device [0002]: MEDIATEK Corp. MT7915E 802.11ax PCI Express Wireless Network Adapter (prog-if 80)
Subsystem: MEDIATEK Corp. MT7915E 802.11ax PCI Express Wireless Network Adapter
Device tree node: /sys/firmware/devicetree/base/pcie@1e140000/pcie@1,0/wifi@0,0
Flags: bus master, fast devsel, latency 0, IRQ 24
Memory at 60400000 (64-bit, prefetchable) [size=1M]
Memory at 60500000 (64-bit, prefetchable) [size=16K]
Memory at 60504000 (64-bit, prefetchable) [size=4K]
Capabilities: [80] Express Endpoint, MSI 00
Capabilities: [e0] MSI: Enable- Count=1/32 Maskable+ 64bit+
Capabilities: [f8] Power Management version 3
Capabilities: [100] Vendor Specific Information: ID=1556 Rev=1 Len=008 <?>
Capabilities: [108] Latency Tolerance Reporting
Capabilities: [110] L1 PM Substates
Capabilities: [200] Advanced Error Reporting
Kernel driver in use: mt7915e

@openwrt-bot
Copy link
Author

rmilecki:

Your router has single PCIe device with two PHYs. That's why your devices in the /etc/config/wireless have paths "foo" and "foo+1".

The problem is your iwinfo not understanding that. That has been just fixed with the commit 6e8475b ("iwinfo: update to the latest version").

Related to that is also commit e1d57d4 ("mac80211: rely on iwinfo for phy->path and path->phy lookups").

Once above fix receives some testing we'll probably backport it to the 21.02 release branch too. Meanwhile you could help by testing the latest master branch.

@openwrt-bot
Copy link
Author

rgrgrg:

Snapshot r16925-b721579842 writes correct config:

config wifi-device 'radio0'
option type 'mac80211'
option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0'
option channel '1'
option band '2g'
option htmode 'HE20'
option disabled '1'

config wifi-device 'radio1'
option type 'mac80211'
option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0+1'
option channel '36'
option band '5g'
option htmode 'HE80'
option disabled '1'

iwinfo correctly parses it:

root@OpenWrt:/etc/config# iwinfo radio0 info radio0 ESSID: unknown Access Point: 00:00:00:00:00:00 Mode: Unknown Channel: unknown (unknown) Center Channel 1: unknown 2: unknown Tx-Power: unknown Link Quality: unknown/70 Signal: unknown Noise: unknown Bit Rate: unknown Encryption: unknown Type: nl80211 HW Mode(s): 802.11bgnax Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E] TX power offset: none Frequency offset: none Supports VAPs: yes PHY name: phy0 root@OpenWrt:/etc/config# iwinfo radio1 info radio1 ESSID: unknown Access Point: 00:00:00:00:00:00 Mode: Unknown Channel: unknown (unknown) Center Channel 1: unknown 2: unknown Tx-Power: unknown Link Quality: unknown/70 Signal: unknown Noise: unknown Bit Rate: unknown Encryption: unknown Type: nl80211 HW Mode(s): 802.11nacax Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E] TX power offset: none Frequency offset: none Supports VAPs: yes PHY name: phy1

Luci (git-21.160.71743-e3bf521) correctly sees configured channel but ignores 'option htmode HExx' for both radios (shows 'mode: legacy' for both radios, allows to choose AX and channel width from drop-down list and writes correct values to /etc/config/wireless when applying changes). HT and VHT modes are properly recognized.

Iwinfo returns htmodes which seem ok:

root@OpenWrt:/etc/config# iwinfo radio0 htmode HT20 HT40 HE20 HE40 root@OpenWrt:/etc/config# iwinfo radio1 htmode HT20 HT40 VHT20 VHT40 VHT80 HE20 HE40 HE80 HE80+80 HE160 I have no AX clients so I'm unable to test these modes anyway.

@openwrt-bot
Copy link
Author

jow-:

The incorrect htmode preselection should be addressed by openwrt/luci@4286c84825

@openwrt-bot
Copy link
Author

rgrgrg:

LuCI Master (git-21.163.60157-1bcb125) correctly selects AX menus for HExx htmodes on both radios. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant