2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 12:14:01 +08:00

pasemi_mac: Print warning when not attaching to a PHY

pasemi_mac: Print warning when not attaching to a PHY

Print a warning on the console when not connecting to a phy for an interface.
It turns out to be a pretty common problem when someone gets the MDIO info
wrong in their device tree, resulting in the macs running at a fixed 1Gbit FD.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Olof Johansson 2007-11-28 20:58:06 -06:00 committed by David S. Miller
parent 5d8949448b
commit 8304b633c5

View File

@ -1064,11 +1064,12 @@ static int pasemi_mac_open(struct net_device *dev)
write_mac_reg(mac, PAS_MAC_CFG_PCFG, flags);
ret = pasemi_mac_phy_init(dev);
/* Some configs don't have PHYs (XAUI etc), so don't complain about
* failed init due to -ENODEV.
/* Warn for missing PHY on SGMII (1Gig) ports.
*/
if (ret && ret != -ENODEV)
dev_warn(&mac->pdev->dev, "phy init failed: %d\n", ret);
if (ret && mac->type == MAC_TYPE_GMAC) {
dev_warn(&mac->pdev->dev, "PHY init failed: %d.\n", ret);
dev_warn(&mac->pdev->dev, "Defaulting to 1Gbit full duplex\n");
}
netif_start_queue(dev);
napi_enable(&mac->napi);