aboutsummaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch6
-rw-r--r--package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc2
-rw-r--r--package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc6
-rwxr-xr-xpackage/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh3
-rw-r--r--package/network/services/hostapd/files/hostapd.uc6
-rw-r--r--package/network/services/hostapd/patches/601-ucode_support.patch29
-rw-r--r--package/network/services/hostapd/patches/701-reload_config_inline.patch2
7 files changed, 33 insertions, 21 deletions
diff --git a/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch b/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch
index e51787cbaa..b44a601e9a 100644
--- a/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch
+++ b/package/boot/uboot-mediatek/patches/436-add-glinet-mt6000.patch
@@ -1,6 +1,6 @@
--- /dev/null
+++ b/arch/arm/dts/mt7986a-glinet-gl-mt6000.dts
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/dts-v1/;
@@ -132,10 +132,6 @@
+ non-removable;
+ status = "okay";
+};
-+
-+&wmcpu_emi {
-+ status = "disabled";
-+};
--- /dev/null
+++ b/configs/mt7986a_glinet_gl-mt6000_defconfig
@@ -0,0 +1,104 @@
diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc
index 16a2c67afe..bbd907c234 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc
@@ -508,4 +508,6 @@ export function generate(interface, data, config, vlans, stas, phy_features) {
if (config.default_macaddr)
append_raw('#default_macaddr');
+ else if (config.random_macaddr)
+ append_raw('#random_macaddr');
};
diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
index 4a592bc99f..dd3143f0cd 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc
@@ -223,7 +223,7 @@ export function wpa_key_mgmt(config) {
};
function macaddr_random() {
- let f = open("/dev/urandom", "r");
+ let f = fs.open("/dev/urandom", "r");
let addr = f.read(6);
addr = map(split(addr, ""), (v) => ord(v));
@@ -243,8 +243,10 @@ export function prepare(data, phy, num_global_macaddr, macaddr_base) {
data.default_macaddr = true;
mac_idx++;
- } else if (data.macaddr == 'random')
+ } else if (data.macaddr == 'random') {
data.macaddr = macaddr_random();
+ data.random_macaddr = true;
+ }
log(`Preparing interface: ${data.ifname} with MAC: ${data.macaddr}`);
};
diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh
index 2e939852b6..30d08a3015 100755
--- a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh
+++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh
@@ -563,6 +563,7 @@ mac80211_hostapd_setup_bss() {
$hostapd_cfg
bssid=$macaddr
${default_macaddr:+#default_macaddr}
+${random_macaddr:+#random_macaddr}
${dtim_period:+dtim_period=$dtim_period}
${max_listen_int:+max_listen_interval=$max_listen_int}
EOF
@@ -691,12 +692,14 @@ mac80211_prepare_vif() {
json_add_string _ifname "$ifname"
default_macaddr=
+ random_macaddr=
if [ -z "$macaddr" ]; then
macaddr="$(mac80211_generate_mac $phy)"
macidx="$(($macidx + 1))"
default_macaddr=1
elif [ "$macaddr" = 'random' ]; then
macaddr="$(macaddr_random)"
+ random_macaddr=1
fi
json_add_string _macaddr "$macaddr"
json_add_string _default_macaddr "$default_macaddr"
diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc
index a28c282493..7b3862e0e2 100644
--- a/package/network/services/hostapd/files/hostapd.uc
+++ b/package/network/services/hostapd/files/hostapd.uc
@@ -574,7 +574,9 @@ function iface_reload_config(name, phydev, config, old_config)
// try to preserve MAC address of this BSS by reassigning another
// BSS if necessary
- if (cur_config.default_macaddr &&
+ if ((cur_config.default_macaddr || cur_config.random_macaddr) &&
+ cur_config.random_macaddr == prev_config.random_macaddr &&
+ cur_config.default_macaddr == prev_config.default_macaddr &&
!macaddr_list[prev_config.bssid]) {
macaddr_list[prev_config.bssid] = i;
cur_config.bssid = prev_config.bssid;
@@ -918,6 +920,8 @@ function iface_load_config(phy, radio, filename)
while ((line = rtrim(f.read("line"), "\n")) != null) {
if (line == "#default_macaddr")
bss.default_macaddr = true;
+ if (line == "#random_macaddr")
+ bss.random_macaddr = true;
let val = split(line, "=", 2);
if (!val[0])
diff --git a/package/network/services/hostapd/patches/601-ucode_support.patch b/package/network/services/hostapd/patches/601-ucode_support.patch
index a5aa2e6a79..44705efa37 100644
--- a/package/network/services/hostapd/patches/601-ucode_support.patch
+++ b/package/network/services/hostapd/patches/601-ucode_support.patch
@@ -148,21 +148,26 @@ as adding/removing interfaces.
{
struct hostapd_bss_config *conf = hapd->conf;
u8 ssid[SSID_MAX_LEN + 1];
-@@ -1434,7 +1438,13 @@ static int hostapd_setup_bss(struct host
+@@ -1434,12 +1438,17 @@ static int hostapd_setup_bss(struct host
if (!first || first == -1) {
u8 *addr = hapd->own_addr;
+ bool use_existing = first == -1;
+#ifdef CONFIG_IEEE80211BE
-+ if (hapd->conf->mld_ap) {
++ if (hapd->conf->mld_ap)
+ addr = NULL;
-+ } else
+#endif /* CONFIG_IEEE80211BE */
if (!is_zero_ether_addr(conf->bssid)) {
/* Allocate the configured BSSID. */
os_memcpy(hapd->own_addr, conf->bssid, ETH_ALEN);
-@@ -1469,6 +1479,7 @@ static int hostapd_setup_bss(struct host
+
+- if (hostapd_mac_comp(hapd->own_addr,
++ if (0 && hostapd_mac_comp(hapd->own_addr,
+ hapd->iface->bss[0]->own_addr) ==
+ 0) {
+ wpa_printf(MSG_ERROR, "BSS '%s' may not have "
+@@ -1469,6 +1478,7 @@ static int hostapd_setup_bss(struct host
hapd->mld_link_id, hapd->conf->iface);
goto setup_mld;
}
@@ -170,7 +175,7 @@ as adding/removing interfaces.
}
#endif /* CONFIG_IEEE80211BE */
-@@ -1477,7 +1488,7 @@ static int hostapd_setup_bss(struct host
+@@ -1477,7 +1487,7 @@ static int hostapd_setup_bss(struct host
conf->iface, addr, hapd,
&hapd->drv_priv, force_ifname, if_addr,
conf->bridge[0] ? conf->bridge : NULL,
@@ -179,7 +184,7 @@ as adding/removing interfaces.
wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID="
MACSTR ")", MAC2STR(hapd->own_addr));
hapd->interface_added = 0;
-@@ -1500,7 +1511,7 @@ static int hostapd_setup_bss(struct host
+@@ -1500,7 +1510,7 @@ static int hostapd_setup_bss(struct host
#ifdef CONFIG_IEEE80211BE
setup_mld:
@@ -188,7 +193,7 @@ as adding/removing interfaces.
wpa_printf(MSG_DEBUG,
"MLD: Set link_id=%u, mld_addr=" MACSTR
", own_addr=" MACSTR,
-@@ -1518,6 +1529,8 @@ setup_mld:
+@@ -1518,6 +1528,8 @@ setup_mld:
}
#endif /* CONFIG_IEEE80211BE */
@@ -197,7 +202,7 @@ as adding/removing interfaces.
if (conf->wmm_enabled < 0)
conf->wmm_enabled = hapd->iconf->ieee80211n |
hapd->iconf->ieee80211ax;
-@@ -1843,7 +1856,7 @@ int hostapd_set_acl(struct hostapd_data
+@@ -1843,7 +1855,7 @@ int hostapd_set_acl(struct hostapd_data
}
@@ -206,7 +211,7 @@ as adding/removing interfaces.
{
#ifdef CONFIG_IEEE80211BE
int ret;
-@@ -2516,7 +2529,7 @@ static int hostapd_owe_iface_iter2(struc
+@@ -2516,7 +2528,7 @@ static int hostapd_owe_iface_iter2(struc
#endif /* CONFIG_OWE */
@@ -215,7 +220,7 @@ as adding/removing interfaces.
{
#ifdef CONFIG_OWE
/* Check whether the enabled BSS can complete OWE transition mode
-@@ -2986,7 +2999,7 @@ hostapd_alloc_bss_data(struct hostapd_if
+@@ -2986,7 +2998,7 @@ hostapd_alloc_bss_data(struct hostapd_if
}
@@ -224,7 +229,7 @@ as adding/removing interfaces.
{
if (!hapd)
return;
-@@ -3194,7 +3207,7 @@ fail:
+@@ -3194,7 +3206,7 @@ fail:
}
@@ -233,7 +238,7 @@ as adding/removing interfaces.
{
#ifdef CONFIG_IEEE80211BE
struct hostapd_mld *mld, **all_mld;
-@@ -4074,7 +4087,8 @@ int hostapd_remove_iface(struct hapd_int
+@@ -4074,7 +4086,8 @@ int hostapd_remove_iface(struct hapd_int
hapd_iface = interfaces->iface[i];
if (hapd_iface == NULL)
return -1;
diff --git a/package/network/services/hostapd/patches/701-reload_config_inline.patch b/package/network/services/hostapd/patches/701-reload_config_inline.patch
index b91ff62e05..bb4160edd9 100644
--- a/package/network/services/hostapd/patches/701-reload_config_inline.patch
+++ b/package/network/services/hostapd/patches/701-reload_config_inline.patch
@@ -58,7 +58,7 @@ as adding/removing interfaces.
return NULL;
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
-@@ -3400,8 +3400,13 @@ hostapd_interface_init_bss(struct hapd_i
+@@ -3399,8 +3399,13 @@ hostapd_interface_init_bss(struct hapd_i
}
}