diff --git a/feeds/wifi-ax/hostapd/files/common.uc b/feeds/wifi-ax/hostapd/files/common.uc index 2002572cf..9ece3b1af 100644 --- a/feeds/wifi-ax/hostapd/files/common.uc +++ b/feeds/wifi-ax/hostapd/files/common.uc @@ -34,7 +34,7 @@ function find_reusable_wdev(phyidx) if (!__phy_is_fullmac(phyidx)) return null; - data = nl80211.request( + let data = nl80211.request( nl80211.const.NL80211_CMD_GET_INTERFACE, nl80211.const.NLM_F_DUMP, { wiphy: phyidx }); diff --git a/feeds/wifi-ax/hostapd/files/wdev.uc b/feeds/wifi-ax/hostapd/files/wdev.uc index 9701af125..896f5261f 100644 --- a/feeds/wifi-ax/hostapd/files/wdev.uc +++ b/feeds/wifi-ax/hostapd/files/wdev.uc @@ -1,7 +1,7 @@ #!/usr/bin/env ucode 'use strict'; import { vlist_new, is_equal, wdev_create, wdev_remove } from "/usr/share/hostap/common.uc"; -import { readfile, writefile, basename, glob } from "fs"; +import { readfile, writefile, basename, readlink, glob } from "fs"; let keep_devices = {}; let phy = shift(ARGV); @@ -106,6 +106,9 @@ function add_existing(phy, config) if (config[wdev]) continue; + if (basename(readlink(`/sys/class/net/${wdev}/phy80211`)) != phy) + continue; + if (trim(readfile(`/sys/class/net/${wdev}/operstate`)) == "down") config[wdev] = {}; } diff --git a/patches/wifi/0025-backport-hostapd-ucode-wifi-reload-support.patch b/patches/wifi/0025-backport-hostapd-ucode-wifi-reload-support.patch index 3b1db9f04..f59f31b41 100644 --- a/patches/wifi/0025-backport-hostapd-ucode-wifi-reload-support.patch +++ b/patches/wifi/0025-backport-hostapd-ucode-wifi-reload-support.patch @@ -1,4 +1,4 @@ -From 4f17c6e2ca90130f86783e87927019525af719ba Mon Sep 17 00:00:00 2001 +From 87450a717bf0e9e82566c89debb60e6ba7d4fe4a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 6 Jul 2023 08:33:25 +0000 Subject: [PATCH] backport hostapd ucode / wifi reload support @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau .../services/hostapd/files/radius.config | 9 + .../services/hostapd/files/radius.init | 42 + .../services/hostapd/files/radius.users | 14 + - .../network/services/hostapd/files/wdev.uc | 153 + + .../network/services/hostapd/files/wdev.uc | 156 + .../hostapd/files/wpa_supplicant-basic.config | 4 +- .../hostapd/files/wpa_supplicant-full.config | 4 +- .../hostapd/files/wpa_supplicant-mini.config | 2 +- @@ -103,7 +103,7 @@ Signed-off-by: Felix Fietkau .../hostapd/src/wpa_supplicant/ubus.h | 11 - .../hostapd/src/wpa_supplicant/ucode.c | 177 + .../hostapd/src/wpa_supplicant/ucode.h | 38 + - 98 files changed, 15512 insertions(+), 2535 deletions(-) + 98 files changed, 15515 insertions(+), 2535 deletions(-) create mode 100644 package/network/services/hostapd/README.md create mode 100644 package/network/services/hostapd/files/common.uc create mode 100644 package/network/services/hostapd/files/hostapd.uc @@ -2208,7 +2208,7 @@ index 0000000000..2150863306 +`ubus call hostapd.wl5-fb wps_start` diff --git a/package/network/services/hostapd/files/common.uc b/package/network/services/hostapd/files/common.uc new file mode 100644 -index 0000000000..2002572cf1 +index 0000000000..9ece3b1af2 --- /dev/null +++ b/package/network/services/hostapd/files/common.uc @@ -0,0 +1,168 @@ @@ -2248,7 +2248,7 @@ index 0000000000..2002572cf1 + if (!__phy_is_fullmac(phyidx)) + return null; + -+ data = nl80211.request( ++ let data = nl80211.request( + nl80211.const.NL80211_CMD_GET_INTERFACE, + nl80211.const.NLM_F_DUMP, + { wiphy: phyidx }); @@ -2964,14 +2964,14 @@ index 0000000000..03e2fc8fae +} diff --git a/package/network/services/hostapd/files/wdev.uc b/package/network/services/hostapd/files/wdev.uc new file mode 100644 -index 0000000000..9701af125a +index 0000000000..896f5261fb --- /dev/null +++ b/package/network/services/hostapd/files/wdev.uc -@@ -0,0 +1,153 @@ +@@ -0,0 +1,156 @@ +#!/usr/bin/env ucode +'use strict'; +import { vlist_new, is_equal, wdev_create, wdev_remove } from "/usr/share/hostap/common.uc"; -+import { readfile, writefile, basename, glob } from "fs"; ++import { readfile, writefile, basename, readlink, glob } from "fs"; + +let keep_devices = {}; +let phy = shift(ARGV); @@ -3076,6 +3076,9 @@ index 0000000000..9701af125a + if (config[wdev]) + continue; + ++ if (basename(readlink(`/sys/class/net/${wdev}/phy80211`)) != phy) ++ continue; ++ + if (trim(readfile(`/sys/class/net/${wdev}/operstate`)) == "down") + config[wdev] = {}; + }