diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-23 11:06:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-24 13:58:53 -0500 |
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) | |||
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, |