mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 15:32:33 +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>
34 lines
605 B
Bash
34 lines
605 B
Bash
#!/bin/sh
|
|
|
|
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
|
|
|
. /lib/functions/caldata.sh
|
|
|
|
board=$(board_name)
|
|
|
|
case "$FIRMWARE" in
|
|
"pci_wmac0.eeprom")
|
|
case $board in
|
|
tplink,tl-wdr4900-v1)
|
|
caldata_extract "caldata" 0x1000 0x800
|
|
ath9k_patch_mac $(mtd_get_mac_binary u-boot 0x4fc00)
|
|
;;
|
|
*)
|
|
caldata_die "board $board is not supported yet"
|
|
;;
|
|
esac
|
|
;;
|
|
|
|
"pci_wmac1.eeprom")
|
|
case $board in
|
|
tplink,tl-wdr4900-v1)
|
|
caldata_extract "caldata" 0x5000 0x800
|
|
ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) -1)
|
|
;;
|
|
*)
|
|
caldata_die "board $board is not supported yet"
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|