diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-23 16:06:30 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-24 10:58:53 -0800 |
commit | eb50c0d67fe3c5513c717c2dee6d9771c51be703 (patch) | |
tree | 449f56f6c8fac242be9ac57663ad98128524b404 /drivers/net/sfc/tenxpress.c | |
parent | e775fb93a880d218ce0b3fd405278dd78f86c405 (diff) |
sfc: Gather link state fields in struct efx_nic into new struct efx_link_state
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/tenxpress.c')
-rw-r--r-- | drivers/net/sfc/tenxpress.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c index cb5e0573c7f3..b001f38524f7 100644 --- a/drivers/net/sfc/tenxpress.c +++ b/drivers/net/sfc/tenxpress.c @@ -503,6 +503,7 @@ static void tenxpress_low_power(struct efx_nic *efx) static void tenxpress_phy_reconfigure(struct efx_nic *efx) { struct tenxpress_phy_data *phy_data = efx->phy_data; + struct efx_link_state *link_state = &efx->link_state; struct ethtool_cmd ecmd; bool phy_mode_change, loop_reset; @@ -545,37 +546,38 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx) phy_data->phy_mode = efx->phy_mode; if (efx->phy_type == PHY_TYPE_SFX7101) { - efx->link_speed = 10000; - efx->link_fd = true; - efx->link_up = sfx7101_link_ok(efx); + link_state->speed = 10000; + link_state->fd = true; + link_state->up = sfx7101_link_ok(efx); } else { efx->phy_op->get_settings(efx, &ecmd); - efx->link_speed = ecmd.speed; - efx->link_fd = ecmd.duplex == DUPLEX_FULL; - efx->link_up = sft9001_link_ok(efx, &ecmd); + link_state->speed = ecmd.speed; + link_state->fd = ecmd.duplex == DUPLEX_FULL; + link_state->up = sft9001_link_ok(efx, &ecmd); } - efx->link_fc = efx_mdio_get_pause(efx); + link_state->fc = efx_mdio_get_pause(efx); } /* Poll PHY for interrupt */ static void tenxpress_phy_poll(struct efx_nic *efx) { struct tenxpress_phy_data *phy_data = efx->phy_data; + struct efx_link_state *link_state = &efx->link_state; bool change = false; if (efx->phy_type == PHY_TYPE_SFX7101) { bool link_ok = sfx7101_link_ok(efx); - if (link_ok != efx->link_up) { + if (link_ok != link_state->up) { change = true; } else { unsigned int link_fc = efx_mdio_get_pause(efx); - if (link_fc != efx->link_fc) + if (link_fc != link_state->fc) change = true; } sfx7101_check_bad_lp(efx, link_ok); } else if (efx->loopback_mode) { bool link_ok = sft9001_link_ok(efx, NULL); - if (link_ok != efx->link_up) + if (link_ok != link_state->up) change = true; } else { int status = efx_mdio_read(efx, MDIO_MMD_PMAPMD, |