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

gluon-core: fixes wifi on mediatek-mt7622 through a fallback of renamed wireless phys #3430

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion package/gluon-core/luasrc/usr/lib/lua/gluon/wireless.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ local iwinfo = require 'iwinfo'
local M = {}

function M.find_phy(config)
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"))
Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

@maurerle maurerle Jan 25, 2025

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

Copy link
Member Author

@maurerle maurerle Jan 26, 2025

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 ?

Copy link
Member Author

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

end
return phyname
end

local function get_addresses(radio)
Expand Down