[Xiaomi Redmi Note 4 [Snapdragon] ROMs, Kernels, Re] crok.bic:
The issue I'm talking about is described in #826, I don't have that bin (and never did!) and as mentioned it is working with other kernels, I mean with the same /system, same /vendor (so using the same ROM) with different kernel it works as it should. Tried different ROMs and kernels combined and the common point is always the kernel, so if I flash this kernel (or any kernel that has this problem) on any randomly chosen ROM the MAC won't be the one coming from the chip but something like 00:0a:f5:XX:YY:ZZ and this is NOT the address of the hardware nor the address in the WCNSS cfg files..

No need to check any logs, way easier to just go to settings -> about phone -> scroll down to WIFI MAC -> if it starts with 00:0a:f5 you are affected. You can go to a terminal, too, and issue ifconfig wlan0 to check the hardware address (MAC).

This is not really the ROM's issue (this is not caused by the MAC randomization feature),

but with the same phone this is not happening on stock MIUI, works correctly on LOS 16 stock kernel, PureCAFx / old Ethereal / old Franco kernels.. thus I know that my EFS data is intact. I'm on AOSiP Derpfest Pie at the moment with PureCAFx and WLAN MAC is the hardware address. Something in some kernels are messing with Prima and I don't know where it goes wrong - and lots of custom kernels are affected.

We are using fixed, MAC based DHCP binding at my workplace - thus I had no WLAN connection because the MAC is different from the official / original one. This is how I realised that there's an issue.. MAC (by it's nature) should be unique and should be the one readable from the hardware chip.

The MAC the phone uses while running this kernel is not the one defined in WCNSS config:

/vendor/firmware/wlan/prima/WCNSS_qcom_cfg.ini

The MAC in the config is:

Intf0MacAddress=000AF58989FF

..but the phone is NOT using this one or any similar,

so it's not a "substituted MAC" used because NV is unreadable or something.

The first 3 bytes are always 00:0a:f5 for us,

the last 3 bytes are random for everyone.

My phone has a MAC starting with c4:0b:cb and it is a Xioami owned range and it's the one that is readable from the hardware chip.

If it cannot access the NV data then it starts to use the MAC in defined in /vendor/firmware/wlan/prima/WCNSS_qcom_cfg.ini defined by the variable Intf0MacAddress=000AF58989FF but this is not the case since the first 3 bytes are OK, the last 3 bytes are random..

This is not an issue of the ROM I'm using. Tested.

I changed the ROM also, used Derpfest Pie, LOS 16, LOS 16 by LilBlinx, MDroid, AICP Pie and AOSiP Pie + Q official and tried them with their own stock kernel, PureCAFx, Ethereal, Clarity, Franco and Englezos kernels (tried all, literally) and all test showed the exact same result: the kernel is the thing, all ROMs behave the same way with the same kernels.

Anyway, this is what I see in the log using Ethereal:

05-30 00:44:12.470 627 627 E wcnss_qmi: wcnss_qmi_get_wlan_address: Mac Address_valid: 1 Mac Address Len: 6
[B]05-30 00:44:12.470 627 627 E wcnss_qmi: wcnss_qmi_get_wlan_address: Succesfully Read WLAN MAC Address
05-30 00:44:12.470 627 627 E wcnss_service: WLAN MAC Addr:c4:0b:cb:XX:XX:XX[/B]
05-30 00:44:12.470 627 627 E wcnss_qmi: wcnss_qmi_deinit: Deinitialize wcnss QMI Interface
[B]05-30 00:44:12.471 627 627 I wcnss_service: data_nvfile_path /data/misc/wifi/nvbin/msm8953_293_0x00_0x01_0x00_nv.bin
05-30 00:44:12.471 627 627 E wcnss_service: source file do not exist /data/misc/wifi/nvbin/msm8953_293_0x00_0x01_0x00_nv.bin
05-30 00:44:12.471 627 627 E wcnss_service: Get source file path fail ![/B]
05-30 00:44:12.472 627 627 E wcnss_service: Serial Number is XXXX0903
[B]05-30 00:44:12.472 627 627 E wcnss_service: Failed to write to /dev/wcnss_ctrl : Invalid argument
[/B]05-30 00:44:13.094 627 627 I wcnss_service: wcnss_read_and_store_cal_data trying to read cal

It is referring to /vendor/etc/wifi/WCNSS_qcom_cfg.ini but this file is located in /vendor/firmare/wlan/prima/WCNSS_qcom_cfg.ini and I don't even have /data/misc/wifi/nvbin/ dir.. (Wrote XX instead of the real values..)