ath79: add support for TP-Link TL-WDR4300 v1 (IL)
[openwrt/openwrt.git] / target / linux / ath79 / base-files / etc / hotplug.d / firmware / 10-ath9k-eeprom
index 8bcdb302725086d52314c88600546460aba0d9a3..8f9c74ce398ded687e632858a55d717ed47de7f5 100644 (file)
@@ -20,7 +20,7 @@ ath9k_eeprom_extract() {
        [ -n "$mtd" ] || \
                ath9k_eeprom_die "no mtd device found for partition $part"
 
-       dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \
+       dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \
                ath9k_eeprom_die "failed to extract from $mtd"
 }
 
@@ -81,7 +81,7 @@ ath9k_patch_fw_mac() {
                        dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$chksum_offset count=2
        }
 
-       macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$mac_offset count=6
+       macaddr_2bin $mac | dd of=/lib/firmware/$FIRMWARE conv=notrunc oflag=seek_bytes bs=6 seek=$mac_offset count=1
 }
 
 ath9k_patch_fw_mac_crc() {
@@ -100,11 +100,33 @@ case "$FIRMWARE" in
        avm,fritz4020)
                ath9k_eeprom_extract_reverse "urlader" 5441 1088
                ;;
+       dlink,dir-825-c1|\
+       dlink,dir-835-a1)
+               ath9k_eeprom_extract "art" 4096 1088
+               ath9k_patch_fw_mac $(mtd_get_mac_text "mac" 4) 2
+               ;;
+       dlink,dir-859-a1|\
+       nec,wg1200cr|\
+       wd,mynet-n750)
+               ath9k_eeprom_extract "art" 4096 1088
+               ath9k_patch_fw_mac $(mtd_get_mac_ascii devdata "wlan24mac") 2
+               ;;
+       engenius,ecb1750)
+               ath9k_eeprom_extract "art" 4096 1088
+               ath9k_patch_fw_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env "athaddr") +1) 2
+               ;;
+       engenius,epg5000|\
        iodata,wn-ac1167dgr|\
-       iodata,wn-ac1600dgr2)
+       iodata,wn-ac1600dgr|\
+       iodata,wn-ac1600dgr2|\
+       iodata,wn-ag300dgr)
                ath9k_eeprom_extract "art" 4096 1088
                ath9k_patch_fw_mac $(mtd_get_mac_ascii u-boot-env ethaddr) 2
                ;;
+       nec,wg800hp)
+               ath9k_eeprom_extract "art" 4096 1088
+               ath9k_patch_fw_mac $(mtd_get_mac_text board_data 1664) 2
+               ;;
        *)
                ath9k_eeprom_die "board $board is not supported yet"
                ;;
@@ -116,17 +138,25 @@ case "$FIRMWARE" in
                ath9k_eeprom_extract_reverse "urloader" 5441 1088
                ;;
        buffalo,whr-g301n|\
+       buffalo,wzr-hp-g302h-a1a0|\
        tplink,tl-wr841-v5|\
        tplink,tl-wr941-v4)
                ath9k_eeprom_extract "art" 4096 3768
                ;;
        buffalo,wzr-hp-g450h)
-               ath9k_eeprom_extract "ART" 4096 1088
+               ath9k_eeprom_extract "art" 4096 1088
+               ;;
+       dlink,dir-825-c1|\
+       dlink,dir-835-a1)
+               ath9k_eeprom_extract "art" 20480 1088
+               ath9k_patch_fw_mac $(macaddr_add $(mtd_get_mac_text "mac" 24) 1) 2
                ;;
        ocedo,raccoon|\
-       tplink,tl-wdr3600|\
-       tplink,tl-wdr4300|\
-       tplink,tl-wdr4900-v2)
+       tplink,tl-wdr3600-v1|\
+       tplink,tl-wdr4300-v1|\
+       tplink,tl-wdr4300-v1-il|\
+       tplink,tl-wdr4900-v2|\
+       winchannel,wb2000)
                ath9k_eeprom_extract "art" 20480 1088
                ;;
        netgear,wnr612-v2|\
@@ -140,17 +170,26 @@ case "$FIRMWARE" in
        tplink,tl-wr741-v1|\
        tplink,tl-wr743nd-v1|\
        tplink,tl-wr841-v7|\
+       tplink,tl-wr842n-v1|\
+       ubnt,airrouter|\
        ubnt,bullet-m|\
-       ubnt,nano-m|\
+       ubnt,nanostation-m|\
        ubnt,rocket-m)
                ath9k_eeprom_extract "art" 4096 4096
                ;;
+       pqi,air-pen)
+               ath9k_eeprom_extract "art" 4096 2002
+               ;;
        ubnt,unifi)
                ath9k_eeprom_extract "art" 4096 2048
                ;;
+       wd,mynet-n750)
+               ath9k_eeprom_extract "art" 20480 1088
+               ath9k_patch_fw_mac $(mtd_get_mac_ascii devdata "wlan5mac") 2
+               ;;
        wd,mynet-wifi-rangeextender)
                ath9k_eeprom_extract "art" 4096 4096
-               ath9k_patch_fw_mac_crc $(nvram get wl0_hwaddr) "$mac" 2
+               ath9k_patch_fw_mac $(nvram get wl0_hwaddr) 2
                ;;
        *)
                ath9k_eeprom_die "board $board is not supported yet"