Commit 1eb4e9f6 authored by Wright Feng's avatar Wright Feng Committed by Kalle Valo
Browse files

brcmfmac: fix invalid permanent MAC address in wiphy



When host driver retrieves mac addresses from dongle, driver copies memory
from drvr->mac to perm_addr. But at the moment, drvr->mac is all zero
array which causes permanent MAC address in wiphy is all zero as well.
To fix this, we set drvr->mac before setting perm_addr.

Signed-off-by: default avatarWright Feng <wright.feng@cypress.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200604071835.3842-3-wright.feng@cypress.com
parent 698bae2e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -209,8 +209,8 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
		bphy_err(drvr, "Retrieving cur_etheraddr failed, %d\n", err);
		goto done;
	}
	memcpy(ifp->drvr->wiphy->perm_addr, ifp->drvr->mac, ETH_ALEN);
	memcpy(ifp->drvr->mac, ifp->mac_addr, sizeof(ifp->drvr->mac));
	memcpy(ifp->drvr->wiphy->perm_addr, ifp->drvr->mac, ETH_ALEN);

	bus = ifp->drvr->bus_if;
	ri = &ifp->drvr->revinfo;