aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-11-23 11:06:30 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-24 13:58:53 -0500
commiteb50c0d67fe3c5513c717c2dee6d9771c51be703 (patch)
tree449f56f6c8fac242be9ac57663ad98128524b404 /drivers/net/sfc/efx.c
parente775fb93a880d218ce0b3fd405278dd78f86c405 (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/efx.c')
-rw-r--r--drivers/net/sfc/efx.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index b91321126fe1..ea31141b1737 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -543,6 +543,8 @@ void efx_schedule_slow_fill(struct efx_rx_queue *rx_queue, int delay)
543 */ 543 */
544static void efx_link_status_changed(struct efx_nic *efx) 544static void efx_link_status_changed(struct efx_nic *efx)
545{ 545{
546 struct efx_link_state *link_state = &efx->link_state;
547
546 /* SFC Bug 5356: A net_dev notifier is registered, so we must ensure 548 /* SFC Bug 5356: A net_dev notifier is registered, so we must ensure
547 * that no events are triggered between unregister_netdev() and the 549 * that no events are triggered between unregister_netdev() and the
548 * driver unloading. A more general condition is that NETDEV_CHANGE 550 * driver unloading. A more general condition is that NETDEV_CHANGE
@@ -555,19 +557,19 @@ static void efx_link_status_changed(struct efx_nic *efx)
555 return; 557 return;
556 } 558 }
557 559
558 if (efx->link_up != netif_carrier_ok(efx->net_dev)) { 560 if (link_state->up != netif_carrier_ok(efx->net_dev)) {
559 efx->n_link_state_changes++; 561 efx->n_link_state_changes++;
560 562
561 if (efx->link_up) 563 if (link_state->up)
562 netif_carrier_on(efx->net_dev); 564 netif_carrier_on(efx->net_dev);
563 else 565 else
564 netif_carrier_off(efx->net_dev); 566 netif_carrier_off(efx->net_dev);
565 } 567 }
566 568
567 /* Status message for kernel log */ 569 /* Status message for kernel log */
568 if (efx->link_up) { 570 if (link_state->up) {
569 EFX_INFO(efx, "link up at %uMbps %s-duplex (MTU %d)%s\n", 571 EFX_INFO(efx, "link up at %uMbps %s-duplex (MTU %d)%s\n",
570 efx->link_speed, efx->link_fd ? "full" : "half", 572 link_state->speed, link_state->fd ? "full" : "half",
571 efx->net_dev->mtu, 573 efx->net_dev->mtu,
572 (efx->promiscuous ? " [PROMISC]" : "")); 574 (efx->promiscuous ? " [PROMISC]" : ""));
573 } else { 575 } else {
@@ -758,7 +760,7 @@ static void efx_fini_port(struct efx_nic *efx)
758 efx->phy_op->fini(efx); 760 efx->phy_op->fini(efx);
759 efx->port_initialized = false; 761 efx->port_initialized = false;
760 762
761 efx->link_up = false; 763 efx->link_state.up = false;
762 efx_link_status_changed(efx); 764 efx_link_status_changed(efx);
763} 765}
764 766