Commit 59ec693a authored by David S. Miller's avatar David S. Miller

Merge branch 'phylib-xcvr-type'

Florian Fainelli says:

====================
net: Bring back transceiver type for PHYLIB

With the introduction of the xLINKSETTINGS ethtool APIs, the transceiver type
was deprecated, but in that process we lost some useful information that PHYLIB
was consistently reporting about internal vs. external PHYs.

This brings back transceiver as a read-only field that is only consumed in the
legacy path where ETHTOOL_GET is called but the underlying drivers implement the
new style klink_settings API.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4a7a3860 ceb62813
...@@ -373,7 +373,8 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev, ...@@ -373,7 +373,8 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev,
cmd->base.port = PORT_BNC; cmd->base.port = PORT_BNC;
else else
cmd->base.port = PORT_MII; cmd->base.port = PORT_MII;
cmd->base.transceiver = phy_is_internal(phydev) ?
XCVR_INTERNAL : XCVR_EXTERNAL;
cmd->base.phy_address = phydev->mdio.addr; cmd->base.phy_address = phydev->mdio.addr;
cmd->base.autoneg = phydev->autoneg; cmd->base.autoneg = phydev->autoneg;
cmd->base.eth_tp_mdix_ctrl = phydev->mdix_ctrl; cmd->base.eth_tp_mdix_ctrl = phydev->mdix_ctrl;
......
...@@ -1753,6 +1753,8 @@ enum ethtool_reset_flags { ...@@ -1753,6 +1753,8 @@ enum ethtool_reset_flags {
* %ethtool_link_mode_bit_indices for the link modes, and other * %ethtool_link_mode_bit_indices for the link modes, and other
* link features that the link partner advertised through * link features that the link partner advertised through
* autonegotiation; 0 if unknown or not applicable. Read-only. * autonegotiation; 0 if unknown or not applicable. Read-only.
* @transceiver: Used to distinguish different possible PHY types,
* reported consistently by PHYLIB. Read-only.
* *
* If autonegotiation is disabled, the speed and @duplex represent the * If autonegotiation is disabled, the speed and @duplex represent the
* fixed link mode and are writable if the driver supports multiple * fixed link mode and are writable if the driver supports multiple
...@@ -1804,7 +1806,9 @@ struct ethtool_link_settings { ...@@ -1804,7 +1806,9 @@ struct ethtool_link_settings {
__u8 eth_tp_mdix; __u8 eth_tp_mdix;
__u8 eth_tp_mdix_ctrl; __u8 eth_tp_mdix_ctrl;
__s8 link_mode_masks_nwords; __s8 link_mode_masks_nwords;
__u32 reserved[8]; __u8 transceiver;
__u8 reserved1[3];
__u32 reserved[7];
__u32 link_mode_masks[0]; __u32 link_mode_masks[0];
/* layout of link_mode_masks fields: /* layout of link_mode_masks fields:
* __u32 map_supported[link_mode_masks_nwords]; * __u32 map_supported[link_mode_masks_nwords];
......
...@@ -525,6 +525,8 @@ convert_link_ksettings_to_legacy_settings( ...@@ -525,6 +525,8 @@ convert_link_ksettings_to_legacy_settings(
= link_ksettings->base.eth_tp_mdix; = link_ksettings->base.eth_tp_mdix;
legacy_settings->eth_tp_mdix_ctrl legacy_settings->eth_tp_mdix_ctrl
= link_ksettings->base.eth_tp_mdix_ctrl; = link_ksettings->base.eth_tp_mdix_ctrl;
legacy_settings->transceiver
= link_ksettings->base.transceiver;
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment