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

Commit 9d580466 authored by Brian Norris's avatar Brian Norris Committed by Kalle Valo
Browse files

ath10k: retrieve MAC address from system firmware if provided



Devices may provide their own MAC address via system firmware (e.g.,
device tree), especially in the case where the device doesn't have a
useful EEPROM on which to store its MAC address (e.g., for integrated
Wifi).

Use the generic device helper to retrieve the MAC address, and (if
present) honor it above the MAC address advertised by the card.

Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 9cac6a9b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/module.h>
#include <linux/firmware.h>
#include <linux/of.h>
#include <linux/property.h>
#include <linux/dmi.h>
#include <linux/ctype.h>
#include <asm/byteorder.h>
@@ -2617,6 +2618,8 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
		ath10k_debug_print_board_info(ar);
	}

	device_get_mac_address(ar->dev, ar->mac_addr, sizeof(ar->mac_addr));

	ret = ath10k_core_init_firmware_features(ar);
	if (ret) {
		ath10k_err(ar, "fatal problem with firmware features: %d\n",
+2 −1
Original line number Diff line number Diff line
@@ -5455,6 +5455,7 @@ int ath10k_wmi_event_ready(struct ath10k *ar, struct sk_buff *skb)
		   arg.mac_addr,
		   __le32_to_cpu(arg.status));

	if (is_zero_ether_addr(ar->mac_addr))
		ether_addr_copy(ar->mac_addr, arg.mac_addr);
	complete(&ar->wmi.unified_ready);
	return 0;