Y, that is what my PR is about. But the more elegant way is to use the driver and the DTS file instead of a userland script. Which has to be triggered every time I change sth. in wifi settings.
EDIT:
The hack for MX4200 and RAX120v2 will elminate the 11_fix_wifi_mac script for this devices and will use the 11-ath11k-caldata script instead. Which would run once only.
We could also try to push ours into this script too.
But I don't know which is the correct way to do it. Because they made this fix script for a reason I think.
I would need input from others here what to do ...
EDIT2:
I've looked into this PR from testuser7 and tried to mimick it on my running system and I failed. ;D
If I understand it correct. They basically patch the board.bin with the MAC's. Therefor you need the offset were the MAC's are within the extracted board.bin and generate a new valid csum for the file to then (re-)load it via driver.
They operate with what is within extracted board.bin. We have here:
1st three octets are 00:03:7F (typical Atheros MAC). The following octets are 12 34 56-5B.
I don't know if the offset where the MAC's are is individual for each board.bin. Maybe I will do a build with this patch and find out.
@KONG
While I think this would be the best path forward how would a valid entry look like (given the few lines within the driver would be sufficient)? I've tried this approach in the past and failed because I didn't know that the driver was lacking support for it.
For this device we have:
partition@600000 {
compatible = "u-boot,env";
label = "0:appsblenv";
reg = <0x600000 0x10000>;
macaddr_lan: ethaddr {
#nvmem-cell-cells = <1>;
};
};
If I look for other devices (IPQ806x) I would come up with sth. like this:
&wifi0 {
status = "okay";
nvmem-cells = <&macaddr_lan 2>;
nvmem-cell-names = "mac-address";
qcom,ath11k-calibration-variant = "Zyxel-NBG7815";
};
&wifi1 {
status = "okay";
nvmem-cells = <&macaddr_lan 3>;
nvmem-cell-names = "mac-address";
qcom,ath11k-calibration-variant = "Zyxel-NBG7815";
};
&wifi2 {
status = "okay";
nvmem-cells = <&macaddr_lan 4>;
nvmem-cell-names = "mac-address";
qcom,ath11k-calibration-variant = "Zyxel-NBG7815";
};
But we do not have three wifi device paths. There is only one. I would guess that this is not working this way. Because the driver is not supporting it for whatever reason. I would guess it's the the implementation of the hardware.
I would also argue that noone would push patching the board.bin if it would be an easy task with DTS.