• S
    net: phylink: Add helpers for c22 registers without MDIO · 291dcae3
    Sean Anderson 提交于
    Some devices expose memory-mapped c22-compliant PHYs. Because these
    devices do not have an MDIO bus, we cannot use the existing helpers.
    Refactor the existing helpers to allow supplying the values for c22
    registers directly, instead of using MDIO to access them. Only get_state
    and set_advertisement are converted, since they contain the most complex
    logic. Because set_advertisement is never actually used outside
    phylink_mii_c22_pcs_config, move the MDIO-writing part into that
    function. Because some modes do not need the advertisement register set
    at all, we use -EINVAL for this purpose.
    
    Additionally, a new function phylink_pcs_enable_an is provided to
    determine whether to enable autonegotiation.
    Signed-off-by: NSean Anderson <sean.anderson@seco.com>
    Reviewed-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    291dcae3
phylink.h 20.9 KB