From 75bfc393ba6cffd783e723d3115c25b70836c116 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Fri, 9 Aug 2019 17:45:12 +0200 Subject: treewide: convert MAC address location offsets to hexadecimal 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 Signed-off-by: Adrian Schmutzler --- target/linux/ar71xx/base-files/etc/board.d/02_network | 10 +++++----- .../base-files/etc/hotplug.d/firmware/10-ath9k-eeprom | 18 +++++++++--------- .../etc/hotplug.d/firmware/11-ath10k-caldata | 4 ++-- .../base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 2 +- .../base-files/lib/preinit/05_set_iface_mac_ar71xx | 12 ++++++------ 5 files changed, 23 insertions(+), 23 deletions(-) (limited to 'target/linux/ar71xx') diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 1fcfa43c4b..78825af597 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -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) 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 208d5f6bff..3924202d8e 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 @@ -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" diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 2ded261c88..a3d4770b32 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -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 diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index b58cf9b591..f93a9f745b 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -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 ;; *) ;; diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx index 7d3e82813d..b0aa150817 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx @@ -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) -- cgit v1.2.3