diff options
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) | |||
| 503 | static void tenxpress_phy_reconfigure(struct efx_nic *efx) | 503 | static void tenxpress_phy_reconfigure(struct efx_nic *efx) |
| 504 | { | 504 | { |
| 505 | struct tenxpress_phy_data *phy_data = efx->phy_data; | 505 | struct tenxpress_phy_data *phy_data = efx->phy_data; |
| 506 | struct efx_link_state *link_state = &efx->link_state; | ||
| 506 | struct ethtool_cmd ecmd; | 507 | struct ethtool_cmd ecmd; |
| 507 | bool phy_mode_change, loop_reset; | 508 | bool phy_mode_change, loop_reset; |
| 508 | 509 | ||
| @@ -545,37 +546,38 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx) | |||
| 545 | phy_data->phy_mode = efx->phy_mode; | 546 | phy_data->phy_mode = efx->phy_mode; |
| 546 | 547 | ||
| 547 | if (efx->phy_type == PHY_TYPE_SFX7101) { | 548 | if (efx->phy_type == PHY_TYPE_SFX7101) { |
| 548 | efx->link_speed = 10000; | 549 | link_state->speed = 10000; |
| 549 | efx->link_fd = true; | 550 | link_state->fd = true; |
| 550 | efx->link_up = sfx7101_link_ok(efx); | 551 | link_state->up = sfx7101_link_ok(efx); |
| 551 | } else { | 552 | } else { |
| 552 | efx->phy_op->get_settings(efx, &ecmd); | 553 | efx->phy_op->get_settings(efx, &ecmd); |
| 553 | efx->link_speed = ecmd.speed; | 554 | link_state->speed = ecmd.speed; |
| 554 | efx->link_fd = ecmd.duplex == DUPLEX_FULL; | 555 | link_state->fd = ecmd.duplex == DUPLEX_FULL; |
| 555 | efx->link_up = sft9001_link_ok(efx, &ecmd); | 556 | link_state->up = sft9001_link_ok(efx, &ecmd); |
| 556 | } | 557 | } |
| 557 | efx->link_fc = efx_mdio_get_pause(efx); | 558 | link_state->fc = efx_mdio_get_pause(efx); |
| 558 | } | 559 | } |
| 559 | 560 | ||
| 560 | /* Poll PHY for interrupt */ | 561 | /* Poll PHY for interrupt */ |
| 561 | static void tenxpress_phy_poll(struct efx_nic *efx) | 562 | static void tenxpress_phy_poll(struct efx_nic *efx) |
| 562 | { | 563 | { |
| 563 | struct tenxpress_phy_data *phy_data = efx->phy_data; | 564 | struct tenxpress_phy_data *phy_data = efx->phy_data; |
| 565 | struct efx_link_state *link_state = &efx->link_state; | ||
| 564 | bool change = false; | 566 | bool change = false; |
| 565 | 567 | ||
| 566 | if (efx->phy_type == PHY_TYPE_SFX7101) { | 568 | if (efx->phy_type == PHY_TYPE_SFX7101) { |
| 567 | bool link_ok = sfx7101_link_ok(efx); | 569 | bool link_ok = sfx7101_link_ok(efx); |
| 568 | if (link_ok != efx->link_up) { | 570 | if (link_ok != link_state->up) { |
| 569 | change = true; | 571 | change = true; |
| 570 | } else { | 572 | } else { |
| 571 | unsigned int link_fc = efx_mdio_get_pause(efx); | 573 | unsigned int link_fc = efx_mdio_get_pause(efx); |
| 572 | if (link_fc != efx->link_fc) | 574 | if (link_fc != link_state->fc) |
| 573 | change = true; | 575 | change = true; |
| 574 | } | 576 | } |
| 575 | sfx7101_check_bad_lp(efx, link_ok); | 577 | sfx7101_check_bad_lp(efx, link_ok); |
| 576 | } else if (efx->loopback_mode) { | 578 | } else if (efx->loopback_mode) { |
| 577 | bool link_ok = sft9001_link_ok(efx, NULL); | 579 | bool link_ok = sft9001_link_ok(efx, NULL); |
| 578 | if (link_ok != efx->link_up) | 580 | if (link_ok != link_state->up) |
| 579 | change = true; | 581 | change = true; |
| 580 | } else { | 582 | } else { |
| 581 | int status = efx_mdio_read(efx, MDIO_MMD_PMAPMD, | 583 | int status = efx_mdio_read(efx, MDIO_MMD_PMAPMD, |
