developer | 9d19d0b | 2023-12-26 11:14:24 +0800 | [diff] [blame^] | 1 | From ae11f63f8bdea17c9814386b39d64c9236e37c1a Mon Sep 17 00:00:00 2001 |
| 2 | From: Michael-CY Lee <michael-cy.lee@mediatek.com> |
| 3 | Date: Tue, 26 Dec 2023 10:56:17 +0800 |
| 4 | Subject: [PATCH] hostapd: ucode: not to remove/create iw interface in MLD |
| 5 | |
| 6 | --- |
| 7 | .../network/services/hostapd/files/hostapd.uc | 18 ++++++++++++++---- |
| 8 | 1 file changed, 14 insertions(+), 4 deletions(-) |
| 9 | |
| 10 | diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc |
| 11 | index 163d619..3782cad 100644 |
| 12 | --- a/package/network/services/hostapd/files/hostapd.uc |
| 13 | +++ b/package/network/services/hostapd/files/hostapd.uc |
| 14 | @@ -27,7 +27,8 @@ function iface_remove(cfg) |
| 15 | return; |
| 16 | |
| 17 | for (let bss in cfg.bss) |
| 18 | - wdev_remove(bss.ifname); |
| 19 | + if (!bss.mld_ap || bss.mld_primary == 1) |
| 20 | + wdev_remove(bss.ifname); |
| 21 | } |
| 22 | |
| 23 | function iface_gen_config(phy, config, start_disabled) |
| 24 | @@ -158,9 +159,12 @@ function iface_restart(phydev, config, old_config) |
| 25 | iface_update_supplicant_macaddr(phy, config); |
| 26 | |
| 27 | let bss = config.bss[0]; |
| 28 | - let err = wdev_create(phy, bss.ifname, { mode: "ap" }); |
| 29 | - if (err) |
| 30 | - hostapd.printf(`Failed to create ${bss.ifname} on phy ${phy}: ${err}`); |
| 31 | + |
| 32 | + if (!bss.mld_ap || bss.mld_primary == 1) { |
| 33 | + let err = wdev_create(phy, bss.ifname, { mode: "ap" }); |
| 34 | + if (err) |
| 35 | + hostapd.printf(`Failed to create ${bss.ifname} on phy ${phy}: ${err}`); |
| 36 | + } |
| 37 | |
| 38 | let ubus = hostapd.data.ubus; |
| 39 | let phy_status = ubus.call("wpa_supplicant", "phy_status", { phy: phy }); |
| 40 | @@ -611,6 +615,12 @@ function iface_load_config(filename) |
| 41 | continue; |
| 42 | } |
| 43 | |
| 44 | + if (val[0] == "mld_ap" && int(val[1]) == 1) |
| 45 | + bss.mld_ap = 1; |
| 46 | + |
| 47 | + if (val[0] == "mld_primary" && int(val[1]) == 1) |
| 48 | + bss.mld_primary = 1; |
| 49 | + |
| 50 | if (val[0] == "nas_identifier") |
| 51 | bss.nasid = val[1]; |
| 52 | |
| 53 | -- |
| 54 | 2.25.1 |
| 55 | |