mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
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:
committed by
Felix Fietkau
parent
231ef27697
commit
8aa24c91b1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user