summaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-11-15 08:21:59 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-11-15 08:21:59 +0000
commit67eded254aa30dd8067d8ac0301c165ed9d722f3 (patch)
tree6239cef7bd90df9efe9106d970d19526d6f608d3 /target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
parentf58bfd1df4e4a9b84a0e94691986c38bab6d8730 (diff)
downloadmaster-31e0f0ae-67eded254aa30dd8067d8ac0301c165ed9d722f3.tar.gz
master-31e0f0ae-67eded254aa30dd8067d8ac0301c165ed9d722f3.tar.bz2
master-31e0f0ae-67eded254aa30dd8067d8ac0301c165ed9d722f3.zip
ar71xx: wndr4300: set official mac addresses
Get the factory assigned mac addresses stored in the caldata partition and asign them to lan and wan interfaces. Also put the correct mac addresses into the WiFi eeprom files to ensure that the ath9k driver will use the correct ones. Signed-off-by: Stefan Agner <stefan@agner.ch> Patchwork: http://patchwork.openwrt.org/patch/4350/ [juhosg: - move WiFi MAC address setup to the firmware hotplug file, - use the official MAC address for the 2.4GHz as well, - remove uci-defaults.sh modifications, - update commit message] Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38812
Diffstat (limited to 'target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom')
-rw-r--r--target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom13
1 files changed, 11 insertions, 2 deletions
diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 0fd6813832..fa4b98c1c1 100644
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -11,8 +11,6 @@ ath9k_eeprom_extract() {
local count=$3
local mtd
- . /lib/functions.sh
-
mtd=$(find_mtd_chardev $part)
[ -n "$mtd" ] || \
ath9k_eeprom_die "no mtd device found for partition $part"
@@ -21,9 +19,18 @@ ath9k_eeprom_extract() {
ath9k_eeprom_die "failed to extract from $mtd"
}
+ath9k_patch_firmware_mac() {
+ local mac=$1
+
+ [ -z "$mac" ] && return
+
+ macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=2 count=6
+}
+
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/ar71xx.sh
+. /lib/functions.sh
board=$(ar71xx_board_name)
@@ -32,6 +39,7 @@ case "$FIRMWARE" in
case $board in
wndr4300)
ath9k_eeprom_extract "caldata" 4096 2048
+ ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 0)
;;
*)
ath9k_eeprom_die "board $board is not supported yet"
@@ -43,6 +51,7 @@ case "$FIRMWARE" in
case $board in
wndr4300)
ath9k_eeprom_extract "caldata" 20480 2048
+ ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 12)
;;
*)
ath9k_eeprom_die "board $board is not supported yet"