qualcommax: ipq807x: use ath11k_patch_mac and ath11k_remove_regdomain for MX4200
authorPaweł Owoc <frut3k7@gmail.com>
Mon, 29 Jan 2024 23:39:55 +0000 (00:39 +0100)
committerRobert Marko <robimarko@gmail.com>
Tue, 23 Apr 2024 20:35:57 +0000 (22:35 +0200)
Use ath11k_patch_mac, ath11k_remove_regdomain and ath11k_set_macflag functions for MX4200
(only v2 variant requires MAC patching)

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network
target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac

index a6ec834785a1bbd11c4b4e4fda1aa2f683d66c02..d87e4246e1a36ed999a78f9ab33df8e2c5740391 100644 (file)
@@ -69,7 +69,6 @@ ipq807x_setup_macs()
        local label_mac=""
 
        case "$board" in
-               linksys,mx4200v1|\
                linksys,mx4200v2)
                        label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
                        for i in $(seq 3 5); do
index d0689d0db6bd0e5e94623de6af0db7e156b31986..b373e8471d5e2943da926e4e7e793891f08c7a9c 100644 (file)
@@ -16,8 +16,6 @@ case "$FIRMWARE" in
        dynalink,dl-wrx36|\
        edgecore,eap102|\
        edimax,cax1800|\
-       linksys,mx4200v1|\
-       linksys,mx4200v2|\
        linksys,mx5300|\
        netgear,rax120v2|\
        netgear,wax218|\
@@ -33,6 +31,19 @@ case "$FIRMWARE" in
        zyxel,nbg7815)
                caldata_extract "0:art" 0x1000 0x20000
                ;;
+       linksys,mx4200v1)
+               caldata_extract "0:art" 0x1000 0x20000
+               ath11k_remove_regdomain
+               ;;
+       linksys,mx4200v2)
+               caldata_extract "0:art" 0x1000 0x20000
+               label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+               ath11k_patch_mac $(macaddr_add $label_mac 2) 0
+               ath11k_patch_mac $(macaddr_add $label_mac 1) 1
+               ath11k_patch_mac $(macaddr_add $label_mac 3) 2
+               ath11k_remove_regdomain
+               ath11k_set_macflag
+               ;;
        prpl,haze|\
        spectrum,sax1v1k)
                caldata_extract_mmc "0:ART" 0x1000 0x20000
index dd85dcfe98c921e1725cafc4122f5dfd2c21c6b0..17284a0d9ea82ba9108ef30f8f741cc0bb2b23a1 100644 (file)
@@ -23,13 +23,6 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress
                ;;
-       linksys,mx4200v1|\
-       linksys,mx4200v2)
-               label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
-               [ "$PHYNBR" = "0" ] && macaddr_add $label_mac 2 > /sys${DEVPATH}/macaddress
-               [ "$PHYNBR" = "1" ] && macaddr_add $label_mac 1 > /sys${DEVPATH}/macaddress
-               [ "$PHYNBR" = "2" ] && macaddr_add $label_mac 3 > /sys${DEVPATH}/macaddress
-               ;;
        zbtlink,zbt-z800ax)
                [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) -1 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) -2 > /sys${DEVPATH}/macaddress