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

Commit fd2537c1 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: use OEM MAC address from OTP"

parents 0925535f 5ee321a5
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -1399,6 +1399,13 @@ static int wil_get_otp_info(struct wil6210_priv *wil)
	u8 mac[8];
	int mac_addr;

	/* OEM MAC has precedence */
	mac_addr = RGF_OTP_OEM_MAC;
	wil_memcpy_fromio_32(mac, wil->csr + HOSTADDR(mac_addr), sizeof(mac));

	if (is_valid_ether_addr(mac)) {
		wil_info(wil, "using OEM MAC %pM\n", mac);
	} else {
		if (wil->hw_version >= HW_VER_TALYN_MB)
			mac_addr = RGF_OTP_MAC_TALYN_MB;
		else
@@ -1406,6 +1413,8 @@ static int wil_get_otp_info(struct wil6210_priv *wil)

		wil_memcpy_fromio_32(mac, wil->csr + HOSTADDR(mac_addr),
				     sizeof(mac));
	}

	if (!is_valid_ether_addr(mac)) {
		u8 dummy_mac[ETH_ALEN] = {
			0x00, 0xde, 0xad, 0x12, 0x34, 0x56,
+1 −0
Original line number Diff line number Diff line
@@ -357,6 +357,7 @@ struct RGF_ICR {
	#define REVISION_ID_SPARROW_D0	(0x3)

#define RGF_OTP_MAC_TALYN_MB		(0x8a0304)
#define RGF_OTP_OEM_MAC			(0x8a0334)
#define RGF_OTP_MAC			(0x8a0620)

/* Talyn-MB */
+3 −0
Original line number Diff line number Diff line
@@ -562,11 +562,13 @@ static int msm_11ad_suspend_power_off(void *handle)

	pcidev = ctx->pcidev;

	/* free the old saved state and save the latest state */
	rc = pci_save_state(pcidev);
	if (rc) {
		dev_err(ctx->dev, "pci_save_state failed :%d\n", rc);
		goto out;
	}
	kfree(ctx->pristine_state);
	ctx->pristine_state = pci_store_saved_state(pcidev);

	rc = msm_pcie_pm_control(MSM_PCIE_SUSPEND, pcidev->bus->number,
@@ -603,6 +605,7 @@ static int ops_suspend(void *handle, bool keep_device_power)
	dev_dbg(ctx->dev, "disable device and save config\n");
	pci_disable_device(pcidev);
	pci_save_state(pcidev);
	kfree(ctx->pristine_state);
	ctx->pristine_state = pci_store_saved_state(pcidev);
	dev_dbg(ctx->dev, "moving to D3\n");
	pci_set_power_state(pcidev, PCI_D3hot);