Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83cddb16 authored by Alexei Avshalom Lazar's avatar Alexei Avshalom Lazar
Browse files

wil6210: allow flashless boot when OTP is empty



Use random MAC address for non wmi_only firmware.

Change-Id: Iab8f0aa494528d12051f103a94c6049187e79505
Signed-off-by: default avatarAlexei Avshalom Lazar <ailizaro@codeaurora.org>
parent be6243a4
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1047,8 +1047,14 @@ static int wil_get_otp_info(struct wil6210_priv *wil)
	wil_memcpy_fromio_32(mac, wil->csr + HOSTADDR(RGF_OTP_MAC),
			     sizeof(mac));
	if (!is_valid_ether_addr(mac)) {
		wil_err(wil, "Invalid MAC %pM\n", mac);
		return -EINVAL;
		u8 dummy_mac[ETH_ALEN] = {
			0x00, 0xde, 0xad, 0x12, 0x34, 0x56,
		};
		if (!test_bit(WMI_FW_CAPABILITY_WMI_ONLY, wil->fw_capabilities))
			get_random_bytes(dummy_mac + 3, 3);
		wil_err(wil, "Invalid MAC %pM, using random %pM\n", mac,
			dummy_mac);
		ether_addr_copy(mac, dummy_mac);
	}

	ether_addr_copy(ndev->perm_addr, mac);