OSDN Git Service

mii: Add helpers for parsing SGMII auto-negotiation
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 6 Jan 2020 01:34:09 +0000 (03:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jan 2020 07:22:32 +0000 (23:22 -0800)
commit6c930994503d9b5bd34b1329427dd7d3d6d37cd4
tree311917c46b06177377af958eb96afc2fe3fe6707
parentde1b23b9b4c1504f124ebbf079131b1713756199
mii: Add helpers for parsing SGMII auto-negotiation

Typically a MAC PCS auto-configures itself after it receives the
negotiated copper-side link settings from the PHY, but some MAC devices
are more special and need manual interpretation of the SGMII AN result.

In other cases, the PCS exposes the entire tx_config_reg base page as it
is transmitted on the wire during auto-negotiation, so it makes sense to
be able to decode the equivalent lp_advertised bit mask from the raw u16
(of course, "lp" considering the PCS to be the local PHY).

Therefore, add the bit definitions for the SGMII registers 4 and 5
(local device ability, link partner ability), as well as a link_mode
conversion helper that can be used to feed the AN results into
phy_resolve_aneg_linkmode.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/mii.h
include/uapi/linux/mii.h