]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: introduce phydev->port
authorMichael Walle <michael@walle.cc>
Tue, 9 Feb 2021 16:38:52 +0000 (17:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Feb 2021 21:09:58 +0000 (13:09 -0800)
commitc230e78d6dda295da7c25309c3ef7e7068a6ba43
treeca5c972ab857bcdbe19a07380657d6ccc4c2c504
parentf2488fde98f22373eef993f0b9bbf51817b4c318
net: phy: introduce phydev->port

At the moment, PORT_MII is reported in the ethtool ops. This is odd
because it is an interface between the MAC and the PHY and no external
port. Some network card drivers will overwrite the port to twisted pair
or fiber, though. Even worse, the MDI/MDIX setting is only used by
ethtool if the port is twisted pair.

Set the port to PORT_TP by default because most PHY drivers are copper
ones. If there is fibre support and it is enabled, the PHY driver will
set it to PORT_FIBRE.

This will change reporting PORT_MII to either PORT_TP or PORT_FIBRE;
except for the genphy fallback driver.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/broadcom.c
drivers/net/phy/dp83822.c
drivers/net/phy/dp83869.c
drivers/net/phy/lxt.c
drivers/net/phy/marvell.c
drivers/net/phy/marvell10g.c
drivers/net/phy/micrel.c
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c
include/linux/phy.h