b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -1,6 +1,9 @@
#!/bin/sh
. /lib/netifd/netifd-wireless.sh
. /lib/netifd/hostapd.sh
+# Needed by mtd_get_mac_ascii
+. /lib/functions.sh
+. /lib/functions/system.sh
init_wireless_driver "$@"
@@ -330,9 +333,18 @@ mac80211_generate_mac() {
local phy="$1"
local id="${macidx:-0}"
- local ref="$(cat /sys/class/ieee80211/${phy}/macaddress)"
local mask="$(cat /sys/class/ieee80211/${phy}/address_mask)"
+ local ref
+ case $(cat /tmp/sysinfo/board_name) in
+ hiwifi-hc5661)
+ ref=$(mtd_get_mac_ascii "bdinfo" "Vfac_mac ")
+ ;;
+ *)
+ ref="$(cat /sys/class/ieee80211/${phy}/macaddress)"
+ ;;
+ esac
+
[ "$mask" = "00:00:00:00:00:00" ] && mask="ff:ff:ff:ff:ff:ff";
local oIFS="$IFS"; IFS=":"; set -- $mask; IFS="$oIFS"
_______________________________________________