mt76: move hw mac_addr in mt76_phy

This is a preliminary patch to properly support mt7915 dbdc

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2020-11-13 11:19:13 +01:00
committed by Felix Fietkau
parent 231ef27697
commit 8aa24c91b1
13 changed files with 55 additions and 47 deletions
+7 -5
View File
@@ -88,8 +88,10 @@ out_put_node:
}
void
mt76_eeprom_override(struct mt76_dev *dev)
mt76_eeprom_override(struct mt76_phy *phy)
{
struct mt76_dev *dev = phy->dev;
#ifdef CONFIG_OF
struct device_node *np = dev->dev->of_node;
const u8 *mac = NULL;
@@ -97,14 +99,14 @@ mt76_eeprom_override(struct mt76_dev *dev)
if (np)
mac = of_get_mac_address(np);
if (!IS_ERR_OR_NULL(mac))
ether_addr_copy(dev->macaddr, mac);
ether_addr_copy(phy->macaddr, mac);
#endif
if (!is_valid_ether_addr(dev->macaddr)) {
eth_random_addr(dev->macaddr);
if (!is_valid_ether_addr(phy->macaddr)) {
eth_random_addr(phy->macaddr);
dev_info(dev->dev,
"Invalid MAC address, using random address %pM\n",
dev->macaddr);
phy->macaddr);
}
}
EXPORT_SYMBOL_GPL(mt76_eeprom_override);