#!/bin/sh [ -e /lib/firmware/$FIRMWARE ] && exit 0 . /lib/functions/caldata.sh board=$(board_name) case "$FIRMWARE" in "ath11k/IPQ5018/hw1.0/cal-ahb-c000000.wifi.bin") case "$board" in elecom,wrc-x3000gs2|\ iodata,wn-dax3000gr) caldata_extract "0:art" 0x1000 0x20000 wlan_mac=$(mtd_get_mac_ascii 0:appsblenv wifi0) ath11k_patch_mac $wlan_mac 0 ath11k_set_macflag ;; glinet,gl-b3000) caldata_extract "0:art" 0x1000 0x20000 ath11k_patch_mac $(macaddr_add $(get_mac_label_dt) 3) 0 ath11k_set_macflag ;; linksys,mr5500|\ linksys,mx2000|\ linksys,mx5500|\ linksys,spnmx56) caldata_extract "0:ART" 0x1000 0x20000 label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) ath11k_patch_mac $(macaddr_add $label_mac 1) 0 ath11k_remove_regdomain ath11k_set_macflag ;; xiaomi,ax6000) caldata_extract "0:art" 0x1000 0x20000 ;; yuncore,ax830) caldata_extract "0:ART" 0x1000 0x20000 label_mac=$(mtd_get_mac_binary 0:ART 0) ath11k_patch_mac $(macaddr_add $label_mac 2) 0 ath11k_remove_regdomain ath11k_set_macflag ;; esac ;; "ath11k/QCN6122/hw1.0/cal-ahb-b00a040.wifi1.bin") case "$board" in elecom,wrc-x3000gs2|\ iodata,wn-dax3000gr) caldata_extract "0:art" 0x26800 0x20000 wlan_mac=$(mtd_get_mac_ascii 0:appsblenv wifi1) ath11k_patch_mac $wlan_mac 0 ath11k_set_macflag ;; glinet,gl-b3000) caldata_extract "0:art" 0x26800 0x20000 ath11k_patch_mac $(macaddr_add $(get_mac_label_dt) 4) 0 ath11k_set_macflag ;; linksys,mx2000) caldata_extract "0:ART" 0x26800 0x20000 label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) ath11k_patch_mac $(macaddr_add $label_mac 2) 0 ath11k_remove_regdomain ath11k_set_macflag ;; yuncore,ax830) caldata_extract "0:ART" 0x4c000 0x20000 label_mac=$(mtd_get_mac_binary 0:ART 0) ath11k_patch_mac $(macaddr_add $label_mac 3) 0 ath11k_remove_regdomain ath11k_set_macflag ;; esac ;; "ath11k/QCN9074/hw1.0/cal-pci-0000:01:00.0.bin") case "$board" in linksys,mr5500|\ linksys,mx5500|\ linksys,spnmx56) caldata_extract "0:ART" 0x26800 0x20000 label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) ath11k_patch_mac $(macaddr_add $label_mac 2) 0 ath11k_remove_regdomain ath11k_set_macflag ;; xiaomi,ax6000) caldata_extract "0:art" 0x26800 0x20000 ;; esac ;; *) exit 1 ;; esac