From efe92c7fc395794cbfc12d195dddb660be5e4f2c Mon Sep 17 00:00:00 2001 From: Arthur Su Date: Mon, 19 Jul 2021 08:45:27 +0000 Subject: [PATCH] ipq807x: add ath11k_generate_macs method for EX227 and EX447 The ex227 and ex447 have 17 MACs,the base mac is reserved for WAN, and other 16 MACs are reserved for WLAN0/WALN1. Signed-off-by: Arthur Su --- .../etc/hotplug.d/firmware/10-ath11k-caldata | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata index 25b22887fe..e6eb7e2dfd 100755 --- a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata +++ b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/10-ath11k-caldata @@ -24,6 +24,20 @@ ath11k_generate_macs() { done } +# The tplink device has 17 MAC addresses. The base MAC address is reserved for eth0(WAN), +# 8 MACs are reserved for 5G wireless(WLAN0), and the other 8 MACs are reserved for 2.4G wireless(WLAN1). +# eth0: base_mac +# wlan0: base_mac+1 ~ base_mac+8 +# wlan1: base_mac+9 ~ base_mac+16 +ath11k_generate_macs_for_tplink() { + touch /lib/firmware/ath11k-macs + eth=$(cat /sys/class/net/eth0/address) + wlan0=$(macaddr_add ${eth} 1) # 5G, wlan0 + echo -ne \\x${wlan0//:/\\x} >> /lib/firmware/ath11k-macs + wlan1=$(macaddr_add ${eth} 9) # 2.4G, wlan1 + echo -ne \\x${wlan1//:/\\x} >> /lib/firmware/ath11k-macs +} + caldata_die() { echo "caldata: " "$*" exit 1 @@ -88,6 +102,10 @@ ath11k-macs) cig,wf188n) ath11k_generate_macs ;; + tplink,ex227|\ + tplink,ex447) + ath11k_generate_macs_for_tplink + ;; esac ;; *) -- 2.20.1