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

Commit 84133b23 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: allow flashless boot when OTP is empty"

parents 0f43200c 83cddb16
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);