diff options
author | Michael Walle <michael@walle.cc> | 2021-02-09 17:38:52 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-02-11 22:09:58 +0100 |
commit | 4217a64e18a1647a0dbc68cb3169a5a06f054ec8 (patch) | |
tree | ca5c972ab857bcdbe19a07380657d6ccc4c2c504 /drivers/net/phy/phy.c | |
parent | devlink: Fix dmac_filter trap name, align to its documentation (diff) | |
download | linux-4217a64e18a1647a0dbc68cb3169a5a06f054ec8.tar.xz linux-4217a64e18a1647a0dbc68cb3169a5a06f054ec8.zip |
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>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 9cb7e4dbf8f4..fdb914b5b857 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -308,7 +308,7 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev, if (phydev->interface == PHY_INTERFACE_MODE_MOCA) cmd->base.port = PORT_BNC; else - cmd->base.port = PORT_MII; + cmd->base.port = phydev->port; cmd->base.transceiver = phy_is_internal(phydev) ? XCVR_INTERNAL : XCVR_EXTERNAL; cmd->base.phy_address = phydev->mdio.addr; |