2013-02-21 19:20:34 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-09-22 09:57:13 +00:00
|
|
|
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
2013-02-21 19:20:34 +00:00
|
|
|
|
2019-09-22 09:57:13 +00:00
|
|
|
. /lib/functions/caldata.sh
|
2013-02-21 19:20:34 +00:00
|
|
|
|
|
|
|
tpl_set_wireless_mac()
|
|
|
|
{
|
|
|
|
local offset=$1
|
|
|
|
local mac
|
|
|
|
|
2019-08-09 15:45:12 +00:00
|
|
|
mac=$(mtd_get_mac_binary u-boot 0x4fc00)
|
2013-02-21 19:20:34 +00:00
|
|
|
mac=$(macaddr_add $mac $offset)
|
|
|
|
|
2019-09-22 09:57:13 +00:00
|
|
|
macaddr_2bin $mac | dd bs=1 count=6 seek=2 conv=notrunc of=/lib/firmware/$FIRMWARE 2>/dev/null
|
2013-02-21 19:20:34 +00:00
|
|
|
}
|
|
|
|
|
2017-05-12 20:36:07 +00:00
|
|
|
board=$(board_name)
|
2013-02-21 19:20:34 +00:00
|
|
|
|
|
|
|
case "$FIRMWARE" in
|
|
|
|
"pci_wmac0.eeprom")
|
|
|
|
case $board in
|
2017-05-15 21:59:25 +00:00
|
|
|
tplink,tl-wdr4900-v1)
|
2019-09-22 09:57:13 +00:00
|
|
|
caldata_extract "caldata" 0x1000 0x800
|
2013-02-21 19:20:34 +00:00
|
|
|
tpl_set_wireless_mac 0
|
|
|
|
;;
|
|
|
|
*)
|
2019-09-22 09:57:13 +00:00
|
|
|
caldata_die "board $board is not supported yet"
|
2013-02-21 19:20:34 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
|
|
|
"pci_wmac1.eeprom")
|
|
|
|
case $board in
|
2017-05-15 21:59:25 +00:00
|
|
|
tplink,tl-wdr4900-v1)
|
2019-09-22 09:57:13 +00:00
|
|
|
caldata_extract "caldata" 0x5000 0x800
|
2013-02-21 19:20:34 +00:00
|
|
|
tpl_set_wireless_mac -1
|
|
|
|
;;
|
|
|
|
*)
|
2019-09-22 09:57:13 +00:00
|
|
|
caldata_die "board $board is not supported yet"
|
2013-02-21 19:20:34 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|