json_set_namespace wpa_supp prev
json_close_array
json_add_string phy "$phy"
+ json_add_int num_global_macaddr "$num_global_macaddr"
json_add_boolean defer 1
local data="$(json_dump)"
[ -n "$wpa_supp_init" ] || return 0
- ubus_call wpa_supplicant config_set '{ "phy": "'"$phy"'" }' > /dev/null
+ ubus_call wpa_supplicant config_set '{ "phy": "'"$phy"'", "num_global_macaddr": '"$num_global_macaddr"' }' > /dev/null
}
mac80211_setup_supplicant() {
return { config: config };
}
-function set_config(phy_name, config_list)
+function set_config(phy_name, num_global_macaddr, config_list)
{
let phy = wpas.data.config[phy_name];
wpas.data.config[phy_name] = phy;
}
+ phy.num_global_macaddr = num_global_macaddr;
+
let values = [];
for (let config in config_list)
push(values, [ config.iface, prepare_config(config) ]);
}
let macaddr_list = wpas.data.macaddr_list[phy_name];
- phydev.macaddr_init(macaddr_list);
+ phydev.macaddr_init(macaddr_list, { num_global: phy.num_global_macaddr });
for (let ifname in phy.data)
iface_start(phydev, phy.data[ifname]);
config_set: {
args: {
phy: "",
+ num_global_macaddr: 0,
config: [],
defer: true,
},
wpas.printf(`Set new config for phy ${req.args.phy}`);
try {
if (req.args.config)
- set_config(req.args.phy, req.args.config);
+ set_config(req.args.phy, req.args.num_global_macaddr, req.args.config);
if (!req.args.defer)
start_pending(req.args.phy);