mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-14 00:40:12 +00:00
2c60de0e3f
This unifies MAC address patch functions and moves them to a common script. While those were implemented differently for different targets, they all seem to do the same. The number of different variants is significantly reduced by this patch. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
82 lines
2.2 KiB
Bash
82 lines
2.2 KiB
Bash
#!/bin/sh
|
|
|
|
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
|
|
|
. /lib/functions/caldata.sh
|
|
|
|
board=$(board_name)
|
|
|
|
case "$FIRMWARE" in
|
|
"ath10k/pre-cal-pci-0000:01:00.0.bin")
|
|
case $board in
|
|
buffalo,wxr-2533dhp)
|
|
caldata_extract "ART" 0x1000 0x2f20
|
|
ath10kcal_patch_mac_crc $(mtd_get_mac_binary ART 0x1e)
|
|
;;
|
|
linksys,ea8500)
|
|
caldata_extract "art" 0x1000 0x2f20
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +1)
|
|
;;
|
|
nec,wg2600hp)
|
|
caldata_extract "ART" 0x1000 0x2f20
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary PRODUCTDATA 0xc) +1)
|
|
;;
|
|
netgear,d7800 |\
|
|
netgear,r7500v2 |\
|
|
netgear,r7800)
|
|
caldata_extract "art" 0x1000 0x2f20
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x6) +1)
|
|
;;
|
|
tplink,c2600)
|
|
caldata_extract "radio" 0x1000 0x2f20
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary default-mac 0x8) -1)
|
|
;;
|
|
tplink,vr2600v)
|
|
caldata_extract "ART" 0x1000 0x2f20
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary default-mac 0x0) -1)
|
|
;;
|
|
zyxel,nbg6817)
|
|
caldata_extract "0:ART" 0x1000 0x2f20
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1)
|
|
;;
|
|
esac
|
|
;;
|
|
"ath10k/pre-cal-pci-0001:01:00.0.bin")
|
|
case $board in
|
|
buffalo,wxr-2533dhp)
|
|
caldata_extract "ART" 0x5000 0x2f20
|
|
ath10kcal_patch_mac_crc $(mtd_get_mac_binary ART 0x18)
|
|
;;
|
|
linksys,ea8500)
|
|
caldata_extract "art" 0x5000 0x2f20
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +2)
|
|
;;
|
|
nec,wg2600hp)
|
|
caldata_extract "ART" 0x5000 0x2f20
|
|
ath10kcal_patch_mac_crc $(mtd_get_mac_binary PRODUCTDATA 0xc)
|
|
;;
|
|
netgear,d7800 |\
|
|
netgear,r7500v2 |\
|
|
netgear,r7800)
|
|
caldata_extract "art" 0x5000 0x2f20
|
|
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x6) +2)
|
|
;;
|
|
tplink,c2600)
|
|
caldata_extract "radio" 0x5000 0x2f20
|
|
ath10kcal_patch_mac_crc $(mtd_get_mac_binary default-mac 0x8)
|
|
;;
|
|
tplink,vr2600v)
|
|
caldata_extract "ART" 0x5000 0x2f20
|
|
ath10kcal_patch_mac_crc $(mtd_get_mac_binary default-mac 0x0)
|
|
;;
|
|
zyxel,nbg6817)
|
|
caldata_extract "0:ART" 0x5000 0x2f20
|
|
ath10kcal_patch_mac_crc $(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
|
|
;;
|
|
esac
|
|
;;
|
|
*)
|
|
exit 1
|
|
;;
|
|
esac
|