-
Notifications
You must be signed in to change notification settings - Fork 327
gluon-core: fixes wifi on mediatek-mt7622 through a fallback of renamed wireless phys #3430
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
Conversation
eb6bb9d to
be8278f
Compare
|
@neocturne could you take a look at this, please? |
|
@maurerle: Thanks for the PR. Wifi setttings are now available in config mode and Wifi also works in normal mode on my R32 |
| return iwinfo.nl80211.phyname(config['.name']) | ||
| local phyname = iwinfo.nl80211.phyname(config['.name']) | ||
| if not phyname then | ||
| phyname = iwinfo.nl80211.phyname(config['.name']:gsub("radio", "phy")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as:
phyname = config['.name']:gsub("radio", "phy")
Though such a fallback was not necessary on openwrt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHY and radio numbering should be considered unrelated, there is no guarantee that PHY numbers don't change (on upgrades or possibly reboots).
I believe that this must be fixed in iwinfo itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, that something goes wrong here:
https://github.com/openwrt/openwrt/blob/1e9966a63ae430a5c48039fd9752bf1c465325f3/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh#L619
As I think I saw the Could not find PHY for device .. message in logread or something similar, which is issued by find_phy
Though this fix is something to get things going, which might help in finding a proper fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is this is the logread at boot:
Thu Jan 23 04:39:30 2025 daemon.notice netifd: radio1 (2778): Command failed: Not found
Thu Jan 23 04:39:30 2025 daemon.notice hostapd: Set new config for phy wl0:
Thu Jan 23 04:39:30 2025 daemon.notice netifd: radio0 (2774): Command failed: Not found
Thu Jan 23 04:39:31 2025 daemon.notice hostapd: Set new config for phy wl0: /var/run/hostapd-wl0.conf
Thu Jan 23 04:39:31 2025 daemon.notice hostapd: Restart interface for phy wl0
Thu Jan 23 04:39:31 2025 daemon.notice hostapd: Configuration file: data: driver=nl80211 logger_syslog=127 logger_syslog_level=2 logger_stdout=127 logger_stdout_level=2 country_code=DE ieee80211d=1 hw_mode=g supported_rates=60 90 120 180 240 360 480 540 basic_rates=60 120 240 beacon_int=100 stationary_ap=1 chanlist=11 noscan=1 #num_global_macaddr=1 #macaddr_base= ieee80211n=1 ht_coex=0 ht_capab=[LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1] channel=11 interface=client0 bssid=72:90:4e:18:f7:30 ctrl_interface=/var/run/hostapd ap_isolate=1 bss_load_update_period=60 chan_util_avg_period=600 disassoc_low_ack=1 skip_inactivity_poll=0 preamble=1 wmm_enabled=1 ignore_broadcast_ssid=0 uapsd_advertisement_enabled=1 utf8_ssid=1 multi_ap=0 auth_algs=1 wpa=0 ssid=Freifunk bridge=br-client wds_bridge= snoop_iface=br-client qos_map_set=0,0,2,16,1,1,255,255,18,22,24,38,40,40,44,46,48,56 nas_identifier=72904e18f730 (phy wl0) --> new PHY
Thu Jan 23 04:39:31 2025 daemon.notice hostapd: Set new config for phy wl1: /var/run/hostapd-wl1.conf
Thu Jan 23 04:39:31 2025 daemon.notice hostapd: Restart interface for phy wl1
Does this help somehow @neocturne ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The iface_update_supplicant_macaddr call on reload was added in
openwrt/openwrt@20c667c
I think that this is what causes the "Not found" error and probably is the root cause of this issue, why reloading fails.
Eventually this is a different error, as I do not really see, how this impacts that the renaming fails
|
Alternatively to this PR, one can run: in config-mode. I don't know why this is skipped in gluon, while it runs in openwrt. EDIT: I did run |
Interesting. We'll have to check if it makes sense to duplicate more code from the shell script in Gluon, or what a good place to run the shell script is. |
|
Normally, the |
|
The board.json of the Netgear WAX 206 is given here: {
"model": {
"id": "netgear,wax206",
"name": "Netgear WAX206"
},
"led": {
"wan": {
"name": "WAN",
"sysfs": "inet:blue",
"type": "netdev",
"device": "wan",
"mode": "link tx rx"
}
},
"network": {
"lan": {
"ports": [
"lan1",
"lan2",
"lan3",
"lan4"
],
"protocol": "static"
},
"wan": {
"device": "wan",
"protocol": "dhcp"
}
},
"wlan": {
"wl0": {
"path": "platform/18000000.wmac",
"info": {
"antenna_rx": 15,
"antenna_tx": 15,
"bands": {
"2G": {
"ht": true,
"max_width": 40,
"modes": [
"NOHT",
"HT20",
"HT40"
],
"default_channel": 1
}
},
"radios": [
]
}
},
"wl1": {
"path": "1a143000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0",
"info": {
"antenna_rx": 15,
"antenna_tx": 15,
"bands": {
"5G": {
"ht": true,
"vht": true,
"he": true,
"max_width": 160,
"modes": [
"NOHT",
"HT20",
"VHT20",
"HE20",
"HT40",
"VHT40",
"HE40",
"VHT80",
"HE80",
"HE160"
],
"default_channel": 36
}
},
"radios": [
]
}
},
"wl2": {
"path": "1a145000.pcie/pci0001:00/0001:00:01.0/0001:01:00.0"
}
}
} |
|
will be fixed with openwrt/openwrt#17821 probably |
|
This PR does not try to solve the root problem but fixes the issue, that the phy is not renamed during config mode for mt7622. The upstream fix for this problem in openwrt openwrt/openwrt#17821 seems to take a little more time. The other attempts (#3408, and #3438) are more complex, so I would go for the easiest successful workaround until an upstream fix is available..? |
b484531 to
9cf9d3f
Compare
|
As the upstream PR seems not be needed anymore in OpenWrt, as the issue seems to be resolved: I took a further look into the remaining issue in gluon. @neocturne had concerns, that radioX should not depend on phyX/wlX. This is fine. This is done about 4 times in openWrt iwinfo ucode as well: So I actually think that this is the right fix for the mt7622 issue in gluon..? Until someone else tells me differently. Tested with latest main on a unifi 6-lr v3 |
…ss phys A similar fix to rename wlX to phyX is used in openwrt upstream Signed-off-by: Florian Maurer <[email protected]>
9cf9d3f to
23b1fe9
Compare
|
small remark: the commit message and the comment in the code need some polish |
|
superseded by #3598 |
tested on a Netgear WAX206
though I think that backporting the commit which fixes renaming of phy devices might fix this as well:
openwrt/openwrt@ed34e33
(No, the files do not exist on openwrt-24.10)
@RolandoMagico can you test my PR on your device as well?
Maybe there is a better way to do this, but this is just a quick fix to get things working again.
iwinfo.nl80211.phyname(config['.name']:gsub("radio", "phy"))returns phy0 again.On my device
iwinfo phy0 htmodelistshows correct values, while