• Ben Hutchings's avatar
    sfc: Refactor link configuration · d3245b28
    Ben Hutchings authored
    Refactor PHY, MAC and NIC configuration operations so that the
    existing link configuration can be re-pushed with:
    and a new configuration with:
    (plus locking and error-checking).
    We have not held the link settings in software (aside from flow
    control), and have relied on asking the hardware what they are.  This
    is a problem because in some cases the hardware may no longer be in a
    state to tell us.  In particular, if an entire multi-port board is
    reset through one port, the driver bindings to other ports have no
    chance to save settings before recovering.
    We only actually need to keep track of the autonegotiation settings,
    so add an ethtool advertising mask to struct efx_nic, initialise it
    in PHY init and update it as necessary.
    Remove now-unneeded uses of efx_phy_op::{get,set}_settings() and
    struct ethtool_cmd.
    Much of this was done by Steve Hodgson <shodgson@solarflare.com>.
    Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>