Skip to content

Commit

Permalink
net: phy: Add detection of 1000BaseX link mode support
Browse files Browse the repository at this point in the history
Add 1000BaseX to the link modes which are detected based on the
MII_ESTATUS register as per 802.3 Clause 22. This allows PHYs which
support 1000BaseX to work properly with drivers using phylink.

Previously 1000BaseX support was not detected, and if that was the only
mode the PHY indicated support for, phylink would refuse to attach it
due to the list of supported modes being empty.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Robert Hancock authored and David S. Miller committed Jun 6, 2019
1 parent 39f8235 commit ca72efb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,9 @@ int genphy_config_init(struct phy_device *phydev)
if (val & ESTATUS_1000_THALF)
linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
features);
if (val & ESTATUS_1000_XFULL)
linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
features);
}

linkmode_and(phydev->supported, phydev->supported, features);
Expand Down
2 changes: 2 additions & 0 deletions include/uapi/linux/mii.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
#define EXPANSION_RESV 0xffe0 /* Unused... */

#define ESTATUS_1000_XFULL 0x8000 /* Can do 1000BaseX Full */
#define ESTATUS_1000_XHALF 0x4000 /* Can do 1000BaseX Half */
#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */

Expand Down

0 comments on commit ca72efb

Please sign in to comment.