openwrt/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
Adrian Schmutzler 2c60de0e3f treewide: move MAC address patch functions to common library
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>
2019-10-14 12:36:02 +02:00

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