treewide: convert MAC address location offsets to hexadecimal
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Fri, 9 Aug 2019 15:45:12 +0000 (17:45 +0200)
committerAlexander Couzens <lynxis@fe80.eu>
Wed, 14 Aug 2019 10:10:12 +0000 (12:10 +0200)
This changes the offsets for the MAC address location in
mtd_get_mac_binary* and mtd_get_mac_text to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-mac-address in DTS files.

(e.g. 0x1006 and 0x5006 are much more useful than 4102 and 20486)

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
22 files changed:
target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx
target/linux/ar71xx/base-files/etc/board.d/02_network
target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx
target/linux/ath79/base-files/etc/board.d/02_network
target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini
target/linux/ipq40xx/base-files/etc/board.d/02_network
target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/lantiq/base-files/etc/board.d/02_network
target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
target/linux/mpc85xx/base-files/etc/board.d/02_network
target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/ramips/base-files/etc/board.d/02_network

index 6d2d18658dae46926a1ef816b1625565656ed4a7..b3b888672014e41ae0f3078ea399d4e249de1f01 100644 (file)
@@ -59,7 +59,7 @@ case "$FIRMWARE" in
                        ath9k_ubi_eeprom_extract "caldata" 20480 4096
                else
                        ath9k_eeprom_extract "wifi_data" 20480 4096
-                       ath9k_patch_firmware_mac $(mtd_get_mac_binary wifi_data 12)
+                       ath9k_patch_firmware_mac $(mtd_get_mac_binary wifi_data 0xc)
                fi
                ;;
        *)
@@ -77,7 +77,7 @@ case "$FIRMWARE" in
                        ath9k_ubi_eeprom_extract "caldata" 4096 4096
                else
                        ath9k_eeprom_extract "wifi_data" 4096 4096
-                       ath9k_patch_firmware_mac $(mtd_get_mac_binary wifi_data 0)
+                       ath9k_patch_firmware_mac $(mtd_get_mac_binary wifi_data 0x0)
                fi
                ;;
        *)
index 1a27930d24fef97a2ebd22b1c4afae98a10fd1b7..11955dd5a2660016b9ca17a92fa1573cbc8210d6 100644 (file)
@@ -6,7 +6,7 @@ preinit_set_mac_address() {
        case $(board_name) in
                meraki,mr24|\
                meraki,mx60)
-                       mac_lan=$(mtd_get_mac_binary_ubi board-config 102)
+                       mac_lan=$(mtd_get_mac_binary_ubi board-config 0x66)
                        [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan"
                        ;;
        esac
index 1fcfa43c4b5aaba2cc5c41652797f711c45b5248..78825af59781d9c0274cddff8a7657bd79dfae06 100755 (executable)
@@ -604,11 +604,11 @@ ar71xx_setup_macs()
 
        case $board in
        archer-c7-v4)
-               base_mac=$(mtd_get_mac_binary config 8)
+               base_mac=$(mtd_get_mac_binary config 0x8)
                wan_mac=$(macaddr_add "$base_mac" 1)
                ;;
        archer-c7-v5)
-               base_mac=$(mtd_get_mac_binary info 8)
+               base_mac=$(mtd_get_mac_binary info 0x8)
                wan_mac=$(macaddr_add "$base_mac" 1)
                ;;
        dgl-5500-a1|\
@@ -619,8 +619,8 @@ ar71xx_setup_macs()
        dir-835-a1|\
        wndr3700v4|\
        wndr4300)
-               lan_mac=$(mtd_get_mac_binary caldata 0)
-               wan_mac=$(mtd_get_mac_binary caldata 6)
+               lan_mac=$(mtd_get_mac_binary caldata 0x0)
+               wan_mac=$(mtd_get_mac_binary caldata 0x6)
                ;;
        dir-869-a1|\
        mynet-n750)
@@ -634,7 +634,7 @@ ar71xx_setup_macs()
                ;;
        tl-wr1043n-v5|\
        tl-wr1043nd-v4)
-               lan_mac=$(mtd_get_mac_binary product-info 8)
+               lan_mac=$(mtd_get_mac_binary product-info 0x8)
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
        wlr8100)
index 208d5f6bff41405a1efb22deb94174ed87f91bdd..3924202d8e7c6860fcab18915bab7d121944ac94 100644 (file)
@@ -73,7 +73,7 @@ case "$FIRMWARE" in
        c-55|\
        c-60)
                ath9k_eeprom_extract "art" 4096 2048
-               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 0) +1)
+               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
                ;;
        fritz4020|\
        fritz450e)
@@ -87,13 +87,13 @@ case "$FIRMWARE" in
                else
                        ath9k_eeprom_extract "odm-caldata" 4096 2048
                fi
-               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +1)
+               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 0x66) +1)
                ;;
        r6100 | \
        wndr3700v4 | \
        wndr4300)
                ath9k_eeprom_extract "caldata" 4096 2048
-               ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 0)
+               ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 0x0)
                ;;
        rambutan)
                ath9k_eeprom_extract "art" 4096 2048
@@ -110,7 +110,7 @@ case "$FIRMWARE" in
                else
                        ath9k_eeprom_extract "origcaldata" 4096 2048
                fi
-               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +2)
+               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 0x66) +2)
                ;;
        *)
                ath9k_eeprom_die "board $board is not supported yet"
@@ -122,7 +122,7 @@ case "$FIRMWARE" in
        case $board in
        c-55)
                ath9k_eeprom_extract "art" 20480 2048
-               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 0) +2)
+               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
                ;;
        fritz300e)
                ath9k_eeprom_extract_reverse "urloader" 5441 1088
@@ -135,12 +135,12 @@ case "$FIRMWARE" in
                else
                        ath9k_eeprom_extract "odm-caldata" 20480 2048
                fi
-               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +2)
+               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 0x66) +2)
                ;;
        wndr3700v4 | \
        wndr4300)
                ath9k_eeprom_extract "caldata" 20480 2048
-               ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 12)
+               ath9k_patch_firmware_mac $(mtd_get_mac_binary caldata 0xc)
                ;;
        z1)
                . /lib/upgrade/nand.sh
@@ -150,7 +150,7 @@ case "$FIRMWARE" in
                else
                        ath9k_eeprom_extract "origcaldata" 86016 4096
                fi
-               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +3)
+               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 0x66) +3)
                ;;
        *)
                ath9k_eeprom_die "board $board is not supported yet"
@@ -168,7 +168,7 @@ case "$FIRMWARE" in
                else
                        ath9k_eeprom_extract "odm-caldata" 36864 2048
                fi
-               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 102) +3)
+               ath9k_patch_firmware_mac $(macaddr_add $(mtd_get_mac_binary_ubi board-config 0x66) +3)
                ;;
        *)
                ath9k_eeprom_die "board $board is not supported yet"
index 2ded261c889149232dfca67620c6d2c1039dac8b..a3d4770b32bf737f49f8948a1f2a0c7f42125312 100644 (file)
@@ -94,7 +94,7 @@ case "$FIRMWARE" in
                ;;
        dw33d)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(mtd_get_mac_binary art 18)
+               ath10kcal_patch_mac $(mtd_get_mac_binary art 0x12)
                ;;
        epg5000|\
        esr1750)
@@ -109,7 +109,7 @@ case "$FIRMWARE" in
                ;;
        koala)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 12) +0)
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0xc) +0)
                ;;
        mc-mac1200r)
                ath10kcal_extract "art" 20480 2116
index b58cf9b591f47c394c4c4b4a21e114e16af2da21..f93a9f745bb58bc45b2c0a7f096344750b845ee9 100644 (file)
@@ -17,7 +17,7 @@ case "$board" in
        archer-c59-v2|\
        archer-c60-v1|\
        archer-c60-v2)
-               echo $(macaddr_add $(mtd_get_mac_binary mac 8)  $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
+               echo $(macaddr_add $(mtd_get_mac_binary mac 0x8)  $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
                ;;
        *)
                ;;
index 7d3e82813d9848a0700c492384edb5d5957e23f7..b0aa150817982958bc8c002aeaaaf281196585bd 100644 (file)
@@ -24,7 +24,7 @@ preinit_set_mac_address() {
        case $(board_name) in
        c-55|\
        c-60)
-               mac_lan=$(mtd_get_mac_binary art 0)
+               mac_lan=$(mtd_get_mac_binary art 0x0)
                [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan"
                ;;
        dir-615-c1|\
@@ -36,19 +36,19 @@ preinit_set_mac_address() {
                ;;
        mr18|\
        z1)
-               mac_lan=$(mtd_get_mac_binary_ubi board-config 102)
+               mac_lan=$(mtd_get_mac_binary_ubi board-config 0x66)
                [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan"
                ;;
        r6100)
-               mac_lan=$(mtd_get_mac_binary caldata 0)
+               mac_lan=$(mtd_get_mac_binary caldata 0x0)
                [ -n "$mac_lan" ] && ifconfig eth1 hw ether "$mac_lan"
-               mac_wan=$(mtd_get_mac_binary caldata 6)
+               mac_wan=$(mtd_get_mac_binary caldata 0x6)
                [ -n "$mac_wan" ] && ifconfig eth0 hw ether "$mac_wan"
                ;;
        rambutan)
-               mac_lan=$(mtd_get_mac_binary art 0)
+               mac_lan=$(mtd_get_mac_binary art 0x0)
                [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan"
-               mac_wan=$(mtd_get_mac_binary art 6)
+               mac_wan=$(mtd_get_mac_binary art 0x6)
                [ -n "$mac_wan" ] && ifconfig eth1 hw ether "$mac_wan"
                ;;
        wrt160nl)
index 99b9d421f4f0a04a429e6bc8c7c017bb104f7033..c9261f355670a259d0953776036bc694fa2efef7 100755 (executable)
@@ -315,13 +315,13 @@ ath79_setup_macs()
                wan_mac=$(fritz_tffs -n macb -i $(find_mtd_part "tffs (1)"))
                ;;
        dlink,dir-825-b1)
-               lan_mac=$(mtd_get_mac_text "caldata" 65440)
-               wan_mac=$(mtd_get_mac_text "caldata" 65460)
+               lan_mac=$(mtd_get_mac_text "caldata" 0xffa0)
+               wan_mac=$(mtd_get_mac_text "caldata" 0xffb4)
                ;;
        dlink,dir-825-c1|\
        dlink,dir-835-a1)
-               lan_mac=$(mtd_get_mac_text "mac" 4)
-               wan_mac=$(mtd_get_mac_text "mac" 24)
+               lan_mac=$(mtd_get_mac_text "mac" 0x4)
+               wan_mac=$(mtd_get_mac_text "mac" 0x18)
                ;;
        dlink,dir-842-c1|\
        dlink,dir-842-c2|\
@@ -334,7 +334,7 @@ ath79_setup_macs()
                ;;
        elecom,wrc-1750ghbk2-i|\
        elecom,wrc-300ghbk2-i)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary art 4098)" -2)
+               wan_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" -2)
                ;;
        engenius,ecb1750)
                lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
@@ -348,7 +348,7 @@ ath79_setup_macs()
                wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
                ;;
        engenius,ews511ap)
-               lan_mac=$(mtd_get_mac_text "u-boot-env" 233)
+               lan_mac=$(mtd_get_mac_text "u-boot-env" 0xe9)
                eth1_mac=$(macaddr_add "$lan_mac" 1)
                ucidef_set_interface "eth0" ifname "eth0" protocol "none" macaddr "$lan_mac"
                ucidef_set_interface "eth1" ifname "eth1" protocol "none" macaddr "$eth1_mac"
@@ -362,13 +362,13 @@ ath79_setup_macs()
                lan_mac=$(macaddr_add "$wan_mac" 1)
                ;;
        nec,wg800hp)
-               lan_mac=$(mtd_get_mac_text board_data 640)
-               wan_mac=$(mtd_get_mac_text board_data 1152)
+               lan_mac=$(mtd_get_mac_text board_data 0x280)
+               wan_mac=$(mtd_get_mac_text board_data 0x480)
                ;;
        netgear,wndr3700|\
        netgear,wndr3700v2|\
        netgear,wndr3800)
-               lan_mac=$(macaddr_setbit_la "$(mtd_get_mac_binary art 0)")
+               lan_mac=$(macaddr_setbit_la "$(mtd_get_mac_binary art 0x0)")
                ;;
        phicomm,k2t)
                lan_mac=$(k2t_get_mac "lan_mac")
@@ -379,7 +379,7 @@ ath79_setup_macs()
                wan_mac=$(mtd_get_mac_ascii devdata wanmac)
                ;;
        rosinson,wr818)
-               wan_mac=$(mtd_get_mac_binary factory 0)
+               wan_mac=$(mtd_get_mac_binary factory 0x0)
                lan_mac=$(macaddr_setbit_la "$wan_mac")
                ;;
        tplink,archer-a7-v5|\
@@ -387,17 +387,17 @@ ath79_setup_macs()
        tplink,archer-c7-v5|\
        tplink,tl-wr1043nd-v4|\
        tplink,tl-wr1043n-v5)
-               base_mac=$(mtd_get_mac_binary info 8)
+               base_mac=$(mtd_get_mac_binary info 0x8)
                wan_mac=$(macaddr_add "$base_mac" 1)
                ;;
        tplink,tl-wr941-v2|\
        tplink,tl-wr941n-v7-cn)
-               base_mac=$(mtd_get_mac_binary u-boot 130048)
+               base_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
                wan_mac=$(macaddr_add "$base_mac" 1)
                ;;
        trendnet,tew-823dru)
-               lan_mac=$(mtd_get_mac_text mac 4)
-               wan_mac=$(mtd_get_mac_text mac 24)
+               lan_mac=$(mtd_get_mac_text mac 0x4)
+               wan_mac=$(mtd_get_mac_text mac 0x18)
                ;;
        ubnt,routerstation|\
        ubnt,routerstation-pro)
index ec597dd1d4322d8dc8bc88b08bab08103ab746f3..b4c1e1d26dd39be0f0f926c101763a9fc6dabf94 100644 (file)
@@ -103,7 +103,7 @@ case "$FIRMWARE" in
        dlink,dir-825-c1|\
        dlink,dir-835-a1)
                ath9k_eeprom_extract "art" 4096 1088
-               ath9k_patch_fw_mac_crc $(mtd_get_mac_text "mac" 4) 2
+               ath9k_patch_fw_mac_crc $(mtd_get_mac_text "mac" 0x4) 2
                ;;
        dlink,dir-842-c1|\
        dlink,dir-842-c2|\
@@ -128,7 +128,7 @@ case "$FIRMWARE" in
                ;;
        nec,wg800hp)
                ath9k_eeprom_extract "art" 4096 1088
-               ath9k_patch_fw_mac $(mtd_get_mac_text board_data 1664) 2
+               ath9k_patch_fw_mac $(mtd_get_mac_text board_data 0x680) 2
                ;;
        qihoo,c301)
                ath9k_eeprom_extract "radiocfg" 4096 1088
@@ -156,7 +156,7 @@ case "$FIRMWARE" in
        dlink,dir-825-c1|\
        dlink,dir-835-a1)
                ath9k_eeprom_extract "art" 20480 1088
-               ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "mac" 24) 1) 2
+               ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "mac" 0x18) 1) 2
                ;;
        ocedo,raccoon|\
        tplink,tl-wdr3600-v1|\
@@ -212,7 +212,7 @@ case "$FIRMWARE" in
                ;;
        dlink,dir-825-b1)
                ath9k_eeprom_extract "caldata" 4096 3768
-               ath9k_patch_fw_mac_crc $(mtd_get_mac_text "caldata" 65440) 524
+               ath9k_patch_fw_mac_crc $(mtd_get_mac_text "caldata" 0xffa0) 524
                ;;
        *)
                ath9k_eeprom_die "board $board is not supported yet"
@@ -229,7 +229,7 @@ case "$FIRMWARE" in
                ;;
        dlink,dir-825-b1)
                ath9k_eeprom_extract "caldata" 20480 3768
-               ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 65460) 1) 524
+               ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_text "caldata" 0xffb4) 1) 524
                ;;
        *)
                ath9k_eeprom_die "board $board is not supported yet"
index ebf5d6d390aee0e6c2877837e5200a824a8908b9..be2b6f1891bb58b8fc04c551d80b0103297ad111 100644 (file)
@@ -99,7 +99,7 @@ case "$FIRMWARE" in
        devolo,dvl1750i|\
        devolo,dvl1750x)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0) -1)
+               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
                ;;
        dlink,dir-859-a1)
                ath10kcal_extract "art" 20480 2116
@@ -124,20 +124,20 @@ case "$FIRMWARE" in
                ;;
        glinet,gl-ar750s)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) +1)
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
                ;;
        glinet,gl-x750)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0) +2)
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
                ;;
        nec,wg800hp)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac_crc $(mtd_get_mac_text board_data 2176)
+               ath10kcal_patch_mac_crc $(mtd_get_mac_text board_data 0x880)
                ;;
        ocedo,koala|\
        ocedo,ursus)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(mtd_get_mac_binary art 12)
+               ath10kcal_patch_mac $(mtd_get_mac_binary art 0xc)
                ;;
        openmesh,om5p-ac-v2)
                ath10kcal_extract "art" 20480 2116
@@ -153,7 +153,7 @@ case "$FIRMWARE" in
        tplink,archer-c7-v5|\
        tplink,archer-c25-v1)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 8) -1)
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) -1)
                ;;
        tplink,archer-c5-v1|\
        tplink,archer-c7-v2)
@@ -175,7 +175,7 @@ case "$FIRMWARE" in
                ;;
        tplink,re450-v2)
                ath10kcal_extract "art" 20480 2116
-               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 8) +1)
+               ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
                ;;
        ubnt,unifiac-lite|\
        ubnt,unifiac-mesh|\
@@ -203,7 +203,7 @@ case "$FIRMWARE" in
        netgear,ex6400|\
        netgear,ex7300)
                ath10kcal_extract "caldata" 20480 12064
-               ath10kcal_patch_mac $(mtd_get_mac_binary caldata 12)
+               ath10kcal_patch_mac $(mtd_get_mac_binary caldata 0xc)
                ;;
        phicomm,k2t)
                ath10kcal_extract "art" 20480 12064
@@ -217,7 +217,7 @@ case "$FIRMWARE" in
        tplink,archer-c60-v2|\
        tplink,archer-c6-v2)
                ath10kcal_extract "art" 20480 12064
-               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary mac 8) -1)
+               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary mac 0x8) -1)
                ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
                        /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
                ;;
index d9c3fe7440a0902d0a613cf46e54591c1e4ea487..3e1cfda84db4b10dd4e299a6ab84719f6ce9a33d 100644 (file)
@@ -40,7 +40,7 @@ case "$board" in
                        mtd_get_mac_text mac 4 > /sys${DEVPATH}/macaddress
                # set the 5G interface mac address to WAN MAC + 1
                [ "$PHYNBR" -eq 0 ] && \
-                       macaddr_add "$(mtd_get_mac_text mac 24)" 1 > /sys${DEVPATH}/macaddress
+                       macaddr_add "$(mtd_get_mac_text mac 0x18)" 1 > /sys${DEVPATH}/macaddress
                 ;;
        *)
                ;;
index e387b3c72e4f72481c21c12b43f95c098d2791f8..3712975fa8be0a12e9f5917690a84f5005188d10 100644 (file)
@@ -17,7 +17,7 @@ set_ether_mac() {
                if [ -n "$part" ]; then
                        DEVID="$(dd if=$part bs=1 skip=119508 count=7 2>/dev/null)"
                        if [ "$DEVID" = "dns-313" ]; then
-                               MAC1="$(mtd_get_mac_binary RedBoot 119540)"
+                               MAC1="$(mtd_get_mac_binary RedBoot 0x1d2f4)"
                                ip link set eth0 address "$MAC1" 2>/dev/null
                                return 0
                        fi
@@ -30,8 +30,8 @@ set_ether_mac() {
                if [ -n "$part" ] ; then
                        DEVID="$(dd if=$part bs=1 skip=81516 count=7 2>/dev/null)"
                        if [ "$DEVID" = "ILI9322" ] ; then
-                               MAC1=$(mtd_get_mac_binary RedBoot 95040)
-                               MAC2=$(mtd_get_mac_binary RedBoot 95046)
+                               MAC1=$(mtd_get_mac_binary RedBoot 0x17340)
+                               MAC2=$(mtd_get_mac_binary RedBoot 0x17346)
                                ip link set eth0 address "$MAC1" 2>/dev/null
                                ip link set eth1 address "$MAC2" 2>/dev/null
                                return 0
index 6a7b09cc603a245e98c37305c1f25c2cc11694ae..e5ba7260f3bcd4168def852d77646d2afc5ac947 100755 (executable)
@@ -74,8 +74,8 @@ ipq40xx_setup_macs()
        case "$board" in
        asus,rt-ac58u)
                CI_UBIPART=UBI_DEV
-               wan_mac=$(mtd_get_mac_binary_ubi Factory 20486)
-               lan_mac=$(mtd_get_mac_binary_ubi Factory 4102)
+               wan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
+               lan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
                ;;
        engenius,ens620ext)
                wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
index 1e64b93a46cb1fc82052d964b78a9d0d894881b5..a09678ca9580db4cf321aaafb4be0216040bb3a7 100644 (file)
@@ -99,7 +99,7 @@ case "$FIRMWARE" in
        meraki,mr33)
                ath10kcal_ubi_extract "ART" 36864 2116
                ath10kcal_is_caldata_valid "4408" || ath10kcal_extract "ART" 36864 2116
-               ath10kcal_patch_mac_crc $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 102) +1)
+               ath10kcal_patch_mac_crc $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +1)
                ;;
        esac
        ;;
@@ -167,12 +167,12 @@ case "$FIRMWARE" in
        meraki,mr33)
                ath10kcal_ubi_extract "ART" 4096 12064
                ath10kcal_is_caldata_valid "202f" || ath10kcal_extract "ART" 4096 12064
-               ath10kcal_patch_mac_crc $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 102) +2)
+               ath10kcal_patch_mac_crc $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +2)
                ;;
        netgear,ex6100v2 |\
        netgear,ex6150v2)
                ath10kcal_extract "ART" 4096 12064
-               ath10kcal_patch_mac_crc $(mtd_get_mac_binary dnidata 0)
+               ath10kcal_patch_mac_crc $(mtd_get_mac_binary dnidata 0x0)
                ;;
        zyxel,nbg6617 |\
        zyxel,wre6606)
@@ -224,12 +224,12 @@ case "$FIRMWARE" in
        meraki,mr33)
                ath10kcal_ubi_extract "ART" 20480 12064
                ath10kcal_is_caldata_valid "202f" || ath10kcal_extract "ART" 20480 12064
-               ath10kcal_patch_mac_crc $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 102) +3)
+               ath10kcal_patch_mac_crc $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +3)
                ;;
        netgear,ex6100v2 |\
        netgear,ex6150v2)
                ath10kcal_extract "ART" 20480 12064
-               ath10kcal_patch_mac_crc $(mtd_get_mac_binary dnidata 12)
+               ath10kcal_patch_mac_crc $(mtd_get_mac_binary dnidata 0xc)
                ;;
        zyxel,nbg6617 |\
        zyxel,wre6606)
index fc64441e1ac20b13baf720f8fa79c8fd53046e7a..192488f3778fe97d2e6c48fc3738e6f7aa6def22 100644 (file)
@@ -5,7 +5,7 @@
 preinit_set_mac_address() {
        case $(board_name) in
        asus,map-ac2200)
-               base_mac=$(mtd_get_mac_binary_ubi Factory 4102)
+               base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
                ip link set dev eth0 address $(macaddr_add "$base_mac" +1)
                ip link set dev eth1 address $(macaddr_add "$base_mac" +3)
                ;;
@@ -15,7 +15,7 @@ preinit_set_mac_address() {
                ip link set dev eth1 address $(macaddr_add "${base_mac}" 1)
                ;;
        meraki,mr33)
-               mac_lan=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 102)
+               mac_lan=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66)
                [ -n "$mac_lan" ] && ip link set dev eth0 address "$mac_lan"
                ;;
        zyxel,nbg6617)
index e05f2b2c7b402bbe8bb4e676688f5433eb966dd4..4f21d4a4efc9e62d129569f051c30f486f79ea10 100644 (file)
@@ -81,7 +81,7 @@ case "$FIRMWARE" in
        case $board in
        buffalo,wxr-2533dhp)
                ath10kcal_extract "ART" 4096 12064
-               ath10kcal_patch_mac_crc $(mtd_get_mac_binary ART 30)
+               ath10kcal_patch_mac_crc $(mtd_get_mac_binary ART 0x1e)
                ;;
        linksys,ea8500)
                ath10kcal_extract "art" 4096 12064
@@ -89,21 +89,21 @@ case "$FIRMWARE" in
                ;;
        nec,wg2600hp)
                ath10kcal_extract "ART" 4096 12064
-               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary PRODUCTDATA 12) +1)
+               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary PRODUCTDATA 0xc) +1)
                ;;
        netgear,d7800 |\
        netgear,r7500v2 |\
        netgear,r7800)
                ath10kcal_extract "art" 4096 12064
-               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 6) +1)
+               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x6) +1)
                ;;
        tplink,c2600)
                ath10kcal_extract "radio" 4096 12064
-               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary default-mac 8) -1)
+               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary default-mac 0x8) -1)
                ;;
        tplink,vr2600v)
                ath10kcal_extract "ART" 4096 12064
-               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary default-mac 0) -1)
+               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary default-mac 0x0) -1)
                ;;
        zyxel,nbg6817)
                ath10kcal_extract "0:ART" 4096 12064
@@ -115,7 +115,7 @@ case "$FIRMWARE" in
        case $board in
        buffalo,wxr-2533dhp)
                ath10kcal_extract "ART" 20480 12064
-               ath10kcal_patch_mac_crc $(mtd_get_mac_binary ART 24)
+               ath10kcal_patch_mac_crc $(mtd_get_mac_binary ART 0x18)
                ;;
        linksys,ea8500)
                ath10kcal_extract "art" 20480 12064
@@ -123,21 +123,21 @@ case "$FIRMWARE" in
                ;;
        nec,wg2600hp)
                ath10kcal_extract "ART" 20480 12064
-               ath10kcal_patch_mac_crc $(mtd_get_mac_binary PRODUCTDATA 12)
+               ath10kcal_patch_mac_crc $(mtd_get_mac_binary PRODUCTDATA 0xc)
                ;;
        netgear,d7800 |\
        netgear,r7500v2 |\
        netgear,r7800)
                ath10kcal_extract "art" 20480 12064
-               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 6) +2)
+               ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x6) +2)
                ;;
        tplink,c2600)
                ath10kcal_extract "radio" 20480 12064
-               ath10kcal_patch_mac_crc $(mtd_get_mac_binary default-mac 8)
+               ath10kcal_patch_mac_crc $(mtd_get_mac_binary default-mac 0x8)
                ;;
        tplink,vr2600v)
                ath10kcal_extract "ART" 20480 12064
-               ath10kcal_patch_mac_crc $(mtd_get_mac_binary default-mac 0)
+               ath10kcal_patch_mac_crc $(mtd_get_mac_binary default-mac 0x0)
                ;;
        zyxel,nbg6817)
                ath10kcal_extract "0:ART" 20480 12064
index a6a9e4d29d60091318669991ab7b2284731c2d1b..d79a30d22de043380206fdadb4aca9ca6a04cce1 100755 (executable)
@@ -60,19 +60,19 @@ arcadyan,arv4525pw|arcadyan,arv452cqw|arcadyan,arv7525pw|arcadyan,arv752dpw)
 
 arcadyan,arv7506pw11)
        annex="b"
-       wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 2)
+       wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 0x16)" 2)
        ucidef_add_switch "switch0" \
                "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0"
        ;;
 
 arcadyan,arv7519pw)
-       wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 1)
+       wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 0x16)" 1)
        ucidef_add_switch "switch0" \
                "0:lan" "1:lan" "2:lan" "3:lan" "4t@eth0"
        ;;
 
 arcadyan,arv7519rw22)
-       wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 22)" 1)
+       wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 0x16)" 1)
        ucidef_add_switch "switch0" \
                "0:lan:5" "2:lan:3" "3:lan:4" "4:lan:1" "5:lan:2" "6t@eth0"
        ;;
@@ -104,7 +104,7 @@ bt,homehub-v3a)
        ;;
 
 bt,homehub-v5a)
-       lan_mac=$(mtd_get_mac_binary_ubi caldata 4364)
+       lan_mac=$(mtd_get_mac_binary_ubi caldata 0x110c)
        wan_mac=$(macaddr_add "$lan_mac" 1)
        ucidef_add_switch "switch0" \
                "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0"
@@ -123,7 +123,7 @@ netgear,dgn3500|netgear,dgn3500b)
        ;;
 
 netgear,dm200)
-       lan_mac=$(mtd_get_mac_binary ART 0)
+       lan_mac=$(mtd_get_mac_binary ART 0x0)
        wan_mac=$(macaddr_add "$lan_mac" 1)
        ucidef_set_interface_lan 'eth0'
        ;;
@@ -147,13 +147,13 @@ avm,fritz3370-rev2-micron)
 avm,fritz7312|\
 avm,fritz7320)
        annex="b"
-       wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1)
+       wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 0xa91)" 1)
        ucidef_set_interface_lan 'eth0'
        ;;
 
 avm,fritz7360sl)
        annex="b"
-       wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1)
+       wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 0xa91)" 1)
        ucidef_add_switch "switch0" \
                "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t@eth0"
        ;;
@@ -199,7 +199,7 @@ zyxel,p-2812hnu-f1|zyxel,p-2812hnu-f3)
        ;;
 
 tplink,tdw8970|tplink,tdw8980)
-       wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 61696)" 1)
+       wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 0xf100)" 1)
        ucidef_add_switch "switch0" \
                "0:lan:2" "2:lan:3" "4:lan:4" "5:lan:1" "6t@eth0"
        ;;
@@ -212,20 +212,20 @@ arcadyan,vg3503j)
        ;;
 
 tplink,vr200|tplink,vr200v)
-       wan_mac=$(macaddr_add "$(mtd_get_mac_binary romfile 61696)" 1)
+       wan_mac=$(macaddr_add "$(mtd_get_mac_binary romfile 0xf100)" 1)
        ucidef_add_switch "switch0" \
                "0:lan" "2:lan" "4:lan" "5:lan" "6t@eth0"
        ;;
 
 arcadyan,vgv7510kw22-nor|arcadyan,vgv7510kw22-brn)
        annex="b"
-       wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 2)
+       wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 0x16)" 2)
        ucidef_add_switch "switch0" \
                "2:lan:2" "3:lan:1" "4:lan:4" "5:lan:3" "0:wan:5" "6t@eth0"
        ;;
 
 arcadyan,vgv7519-nor|arcadyan,vgv7519-brn)
-       wan_mac=$(mtd_get_mac_binary board_config 22)
+       wan_mac=$(mtd_get_mac_binary board_config 0x16)
        ucidef_add_switch "switch0" \
                "0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0"
        ;;
index 6b4d09dd333ba5a8fe585a13149875c837054c17..6d7682a7f30247167ef79f4bd07dcb97ee2bec19 100644 (file)
@@ -40,7 +40,7 @@ case "$FIRMWARE" in
        case $board in
                bt,homehub-v5a)
                        ath10k_caldata_extract_ubi "caldata" 20480 2116
-                       ath10k_caldata_set_macaddr $(macaddr_add $(mtd_get_mac_binary_ubi caldata 4364) +3)
+                       ath10k_caldata_set_macaddr $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) +3)
                        ;;
                *)
                        ath10k_caldata_die "board $board is not supported yet"
index 6ae5e3cfe961f4d0a4c7d5c11942d9d9e5c1c269..aec963a72116240c6a223e74829d065aab821cf9 100644 (file)
@@ -150,7 +150,7 @@ case "$FIRMWARE" in
                                ;;
                        bt,homehub-v5a)
                                ath9k_ubi_eeprom_extract "caldata" 4096 0
-                               ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 4364) +2) 268
+                               ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) +2) 268
                                ;;
                        netgear,dgn3500|netgear,dgn3500b)
                                ath9k_eeprom_extract "calibration" 61440 0
index d6b4eebf14826dcadc72c033c66712a18373a0ce..f907fd2edbed753b44f53a5ae07d3843d46c4222 100755 (executable)
@@ -21,7 +21,7 @@ ocedo,panda)
 tplink,tl-wdr4900-v1)
        ucidef_add_switch "switch0" \
                "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
-       ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary config 332)"
+       ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary config 0x14c)"
        ;;
 *)
        ucidef_set_interfaces_lan_wan "eth0" "eth1"
index 3e6488b4c7635b929c349f8177635832592aafa5..b02c891cbf0e30fec942a71bbd467c8ca754eefe 100644 (file)
@@ -26,7 +26,7 @@ tpl_set_wireless_mac()
        local offset=$1
        local mac
 
-       mac=$(mtd_get_mac_binary u-boot 326656)
+       mac=$(mtd_get_mac_binary u-boot 0x4fc00)
        mac=$(macaddr_add $mac $offset)
 
        macaddr_2bin $mac | dd bs=1 count=6 seek=2 conv=notrunc of=$FW_FILE 2>/dev/null
index ca111c9d4cd71dbef61a0a21e701515b0c644007..b413b434eb5556471d29f7aeb9cc0a176415358a 100755 (executable)
@@ -507,7 +507,7 @@ ramips_setup_macs()
        arcwireless,freestation5|\
        cudy,wr1000|\
        netgear,wnce2001)
-               wan_mac=$(mtd_get_mac_binary factory 46)
+               wan_mac=$(mtd_get_mac_binary factory 0x2e)
                ;;
        arcwireless,freestation5|\
        dlink,dir-300-b7|\
@@ -530,12 +530,12 @@ ramips_setup_macs()
        asus,rt-ac57u|\
        phicomm,k2p|\
        planex,vr500)
-               lan_mac=$(mtd_get_mac_binary factory 57344)
-               wan_mac=$(mtd_get_mac_binary factory 57350)
+               lan_mac=$(mtd_get_mac_binary factory 0xe000)
+               wan_mac=$(mtd_get_mac_binary factory 0xe006)
                ;;
        asus,rt-n56u)
                lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
-               wan_mac=$(mtd_get_mac_binary factory 32772)
+               wan_mac=$(mtd_get_mac_binary factory 0x8004)
                ;;
        belkin,f9k1109v1)
                wan_mac=$(mtd_get_mac_ascii uboot-env HW_WAN_MAC)
@@ -551,12 +551,12 @@ ramips_setup_macs()
        buffalo,whr-300hp2|\
        buffalo,whr-600d|\
        buffalo,wsr-600dhp)
-               wan_mac=$(mtd_get_mac_binary factory 4)
+               wan_mac=$(mtd_get_mac_binary factory 0x4)
                lan_mac=$wan_mac
                ;;
        buffalo,whr-g300n|\
        glinet,gl-mt300n-v2)
-               wan_mac=$(mtd_get_mac_binary factory 4)
+               wan_mac=$(mtd_get_mac_binary factory 0x4)
                ;;
        dlink,dch-m225|\
        samsung,cy-swr1100)
@@ -585,7 +585,7 @@ ramips_setup_macs()
                wan_mac=$(mtd_get_mac_ascii u-boot-env WAN_MAC_ADDR)
                ;;
        edimax,br-6475nd)
-               wan_mac=$(mtd_get_mac_binary devdata 7)
+               wan_mac=$(mtd_get_mac_binary devdata 0x7)
                ;;
        edimax,br-6478ac-v2)
                wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 2)
@@ -594,7 +594,7 @@ ramips_setup_macs()
        elecom,wrc-1900gst|\
        elecom,wrc-2533gst|\
        samknows,whitebox-v8)
-               wan_mac=$(mtd_get_mac_binary factory 57350)
+               wan_mac=$(mtd_get_mac_binary factory 0xe006)
                ;;
        hiwifi,hc5661|\
        hiwifi,hc5661a|\
@@ -609,12 +609,12 @@ ramips_setup_macs()
                ;;
        iodata,wn-ac1167gr|\
        iodata,wn-ac733gr3)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" -1)
+               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" -1)
                ;;
        iodata,wn-ax1167gr|\
        iodata,wn-gx300gr|\
        trendnet,tew-692gr)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 1)
+               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1)
                ;;
        lenovo,newifi-d1)
                lan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 2)
@@ -625,24 +625,24 @@ ramips_setup_macs()
        mediatek,linkit-smart-7688|\
        onion,omega2|\
        onion,omega2p)
-               wan_mac=$(mtd_get_mac_binary factory 4)
-               lan_mac=$(mtd_get_mac_binary factory 46)
+               wan_mac=$(mtd_get_mac_binary factory 0x4)
+               lan_mac=$(mtd_get_mac_binary factory 0x2e)
                ;;
        mercury,mac1200r-v2)
-               lan_mac=$(mtd_get_mac_binary factory_info 13)
+               lan_mac=$(mtd_get_mac_binary factory_info 0xd)
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
        netgear,r6220|\
        netgear,r6350|\
        netgear,wndr3700-v5)
-               wan_mac=$(mtd_get_mac_binary factory 4)
+               wan_mac=$(mtd_get_mac_binary factory 0x4)
                lan_mac=$(macaddr_add "$wan_mac" 1)
                ;;
        ohyeah,oy-0001|\
        phicomm,k2g|\
        skylab,skw92a)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               wan_mac=$(mtd_get_mac_binary factory 46)
+               lan_mac=$(mtd_get_mac_binary factory 0x28)
+               wan_mac=$(mtd_get_mac_binary factory 0x2e)
                ;;
        poray,m3|\
        poray,m4-4m|\
@@ -652,24 +652,24 @@ ramips_setup_macs()
                lan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" -2)
                ;;
        sitecom,wlr-6000)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2)
+               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x8004)" 2)
                ;;
        sparklan,wcr-150gn|\
        zyxel,keenetic-omni|\
        zyxel,keenetic-omni-ii|\
        zyxel,keenetic-start|\
        zyxel,keenetic-viva)
-               wan_mac=$(mtd_get_mac_binary factory 40)
+               wan_mac=$(mtd_get_mac_binary factory 0x28)
                ;;
        tenda,w306r-v2)
                wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 5)
                ;;
        trendnet,tew-691gr)
-               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 3)
+               wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 3)
                ;;
        wiznet,wizfi630a)
-               lan_mac=$(mtd_get_mac_binary factory 4)
-               wan_mac=$(mtd_get_mac_binary factory 40)
+               lan_mac=$(mtd_get_mac_binary factory 0x4)
+               wan_mac=$(mtd_get_mac_binary factory 0x28)
                ;;
        xiaomi,mir3g|\
        xiaomi,mir3p)