lantiq: complete AVM FRITZ!Box 3370 support
[openwrt/openwrt.git] / target / linux / lantiq / base-files / etc / hotplug.d / firmware / 12-ath9k-eeprom
index 498a509..75b7630 100644 (file)
@@ -47,6 +47,24 @@ ath9k_eeprom_extract_raw() {
                        ath9k_eeprom_die "failed to extract from $mtd"
 }
 
+ath9k_eeprom_extract_reverse() {
+       local part=$1
+       local offset=$2
+       local count=$3
+       local mtd
+       local reversed
+       local caldata
+
+       mtd=$(find_mtd_chardev "$part")
+       reversed=$(hexdump -v -s $offset -n $count -e '/1 "%02x "' $mtd)
+
+       for byte in $reversed; do
+               caldata="\x${byte}${caldata}"
+       done
+
+       printf "%b" "$caldata" > /lib/firmware/$FIRMWARE
+}
+
 ath9k_eeprom_extract() {
        local part=$1
        local offset=$2
@@ -138,7 +156,11 @@ case "$FIRMWARE" in
                                ath9k_eeprom_extract "calibration" 61440 0
                                ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot-env ethaddr) +2) 524
                                ;;
-                       avm,fritz3370|avm,fritz7320|avm,fritz7360sl)
+                       avm,fritz3370-rev2-hynix|\
+                       avm,fritz3370-rev2-micron)
+                               ath9k_eeprom_extract_reverse "urlader" 5441 1088
+                               ;;
+                       avm,fritz7320|avm,fritz7360sl)
                                ath9k_eeprom_extract "urlader" 2437 0
                                ;;
                        tplink,tdw8970|tplink,tdw8980)