mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix MAC address configuration for VNIC
The FDT description is as follows: - phy-handle, reg, qlm-mode, mac-address are under nodes in bgx0/1 node - phy nodes (pointed by phy-handle) are under MDIO even though they may not be connected through to MDIO. In those nodes they do not contain MAC address or etc. This commit changes parsing of the FDT nodes for BGX so that it can obtain correct MAC address for a given PHY. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5781
This commit is contained in:
parent
7c617ace70
commit
316e15b4cc
1 changed files with 11 additions and 11 deletions
|
|
@ -285,18 +285,9 @@ bgx_fdt_init_phy(struct bgx *bgx)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (OF_getencprop(child, "phy-handle", &phy,
|
||||
sizeof(phy)) <= 0) {
|
||||
if (bootverbose) {
|
||||
device_printf(bgx->dev,
|
||||
"No phy-handle in PHY node. Skipping...\n");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Acquire PHY address */
|
||||
phy = OF_node_from_xref(phy);
|
||||
if (OF_getencprop(phy, "reg", &bgx->lmac[lmac].phyaddr,
|
||||
if (OF_getencprop(child, "reg", &bgx->lmac[lmac].phyaddr,
|
||||
sizeof(bgx->lmac[lmac].phyaddr)) <= 0) {
|
||||
if (bootverbose) {
|
||||
device_printf(bgx->dev,
|
||||
|
|
@ -305,6 +296,15 @@ bgx_fdt_init_phy(struct bgx *bgx)
|
|||
bgx->lmac[lmac].phyaddr = MII_PHY_ANY;
|
||||
}
|
||||
|
||||
if (OF_getencprop(child, "phy-handle", &phy,
|
||||
sizeof(phy)) <= 0) {
|
||||
if (bootverbose) {
|
||||
device_printf(bgx->dev,
|
||||
"No phy-handle in PHY node. Skipping...\n");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
phy = OF_instance_to_package(phy);
|
||||
/*
|
||||
* Get PHY interface (MDIO bus) device.
|
||||
* Driver must be already attached.
|
||||
|
|
@ -321,7 +321,7 @@ bgx_fdt_init_phy(struct bgx *bgx)
|
|||
}
|
||||
|
||||
/* Get mac address from FDT */
|
||||
bgx_fdt_get_macaddr(phy, bgx->lmac[lmac].mac);
|
||||
bgx_fdt_get_macaddr(child, bgx->lmac[lmac].mac);
|
||||
|
||||
bgx->lmac[lmac].lmacid = lmac;
|
||||
lmac++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue