diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2019-08-09 17:45:12 +0200 |
---|---|---|
committer | Alexander Couzens <lynxis@fe80.eu> | 2019-08-14 12:10:12 +0200 |
commit | 75bfc393ba6cffd783e723d3115c25b70836c116 (patch) | |
tree | c3dc6d8b544ec5b5e4bb4d6c33f323d43cb0e8fc /target/linux/ath79/base-files | |
parent | 07926d7def59e5684b488e9b614342edc19e7eb2 (diff) | |
download | upstream-75bfc393ba6cffd783e723d3115c25b70836c116.tar.gz upstream-75bfc393ba6cffd783e723d3115c25b70836c116.tar.bz2 upstream-75bfc393ba6cffd783e723d3115c25b70836c116.zip |
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 <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ath79/base-files')
4 files changed, 29 insertions, 29 deletions
diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network index 99b9d421f4..c9261f3556 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -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) diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index ec597dd1d4..b4c1e1d26d 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -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" diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index ebf5d6d390..be2b6f1891 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -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 ;; diff --git a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index d9c3fe7440..3e1cfda84d 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -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 ;; *) ;; |