diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-29 03:42:41 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 16:46:28 -0800 |
commit | d3245b28ef2a45ec4e115062a38100bd06229289 (patch) | |
tree | 036133fdf01a20f36086d5eb8606728859c056de /drivers/net/sfc/net_driver.h | |
parent | ef2b90ee4dba7a3d9001f1f0003b860b39a4aaae (diff) |
sfc: Refactor link configuration
Refactor PHY, MAC and NIC configuration operations so that the
existing link configuration can be re-pushed with:
efx->phy_op->reconfigure(efx);
efx->mac_op->reconfigure(efx);
and a new configuration with:
efx->nic_op->reconfigure_port(efx);
(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: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/net_driver.h')
-rw-r--r-- | drivers/net/sfc/net_driver.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 32806f9a7e49..f63a05c4e38b 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h @@ -517,7 +517,7 @@ static inline bool efx_link_state_equal(const struct efx_link_state *left, * @check_fault: Check fault state. True if fault present. */ struct efx_mac_operations { - void (*reconfigure) (struct efx_nic *efx); + int (*reconfigure) (struct efx_nic *efx); void (*update_stats) (struct efx_nic *efx); bool (*check_fault)(struct efx_nic *efx); }; @@ -544,7 +544,7 @@ struct efx_phy_operations { enum efx_mac_type macs; int (*init) (struct efx_nic *efx); void (*fini) (struct efx_nic *efx); - void (*reconfigure) (struct efx_nic *efx); + int (*reconfigure) (struct efx_nic *efx); bool (*poll) (struct efx_nic *efx); void (*get_settings) (struct efx_nic *efx, struct ethtool_cmd *ecmd); @@ -730,6 +730,7 @@ union efx_multicast_hash { * @mdio: PHY MDIO interface * @phy_mode: PHY operating mode. Serialised by @mac_lock. * @xmac_poll_required: XMAC link state needs polling + * @link_advertising: Autonegotiation advertising flags * @link_state: Current state of the link * @n_link_state_changes: Number of times the link has changed state * @promiscuous: Promiscuous flag. Protected by netif_tx_lock. @@ -813,6 +814,7 @@ struct efx_nic { enum efx_phy_mode phy_mode; bool xmac_poll_required; + u32 link_advertising; struct efx_link_state link_state; unsigned int n_link_state_changes; @@ -858,6 +860,7 @@ static inline const char *efx_dev_name(struct efx_nic *efx) * @stop_stats: Stop the regular fetching of statistics * @push_irq_moderation: Apply interrupt moderation value * @push_multicast_hash: Apply multicast hash table + * @reconfigure_port: Push loopback/power/txdis changes to the MAC and PHY * @default_mac_ops: efx_mac_operations to set at startup * @revision: Hardware architecture revision * @mem_map_size: Memory BAR mapped size @@ -890,6 +893,7 @@ struct efx_nic_type { void (*stop_stats)(struct efx_nic *efx); void (*push_irq_moderation)(struct efx_channel *channel); void (*push_multicast_hash)(struct efx_nic *efx); + int (*reconfigure_port)(struct efx_nic *efx); struct efx_mac_operations *default_mac_ops; int revision; |