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

Commit 0ad5ea5d authored by Peng Li's avatar Peng Li Committed by David S. Miller
Browse files

net: hns3: synchronize speed and duplex from phy when phy link up



Driver calls phy_connect_direct and registers hclge_mac_adjust_link
to synchronize mac speed and duplex from phy. It is better to
synchronize mac speed and duplex from phy when phy link up.

Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8362089d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -179,6 +179,10 @@ static void hclge_mac_adjust_link(struct net_device *netdev)
	int duplex, speed;
	int ret;

	/* When phy link down, do nothing */
	if (netdev->phydev->link == 0)
		return;

	speed = netdev->phydev->speed;
	duplex = netdev->phydev->duplex;