diff options
author | Steve Hodgson <shodgson@solarflare.com> | 2009-11-28 22:43:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 19:46:28 -0500 |
commit | 78c1f0a06551f6ff61bfd7c1a9302115a8135a62 (patch) | |
tree | b39d17b5635aab76c323d8a8e4a10ff02125f068 /drivers/net/sfc/efx.c | |
parent | d3245b28ef2a45ec4e115062a38100bd06229289 (diff) |
sfc: Generalise link state monitoring
Use the efx_nic_type::monitor operation or event handling as
appropriate.
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.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 4210121eeff9..14ef27fa8416 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -1174,10 +1174,18 @@ static void efx_start_all(struct efx_nic *efx) | |||
1174 | 1174 | ||
1175 | falcon_enable_interrupts(efx); | 1175 | falcon_enable_interrupts(efx); |
1176 | 1176 | ||
1177 | /* Start the hardware monitor (if there is one) if we're in RUNNING */ | 1177 | /* Start the hardware monitor if there is one. Otherwise (we're link |
1178 | if (efx->state == STATE_RUNNING && efx->type->monitor != NULL) | 1178 | * event driven), we have to poll the PHY because after an event queue |
1179 | * flush, we could have a missed a link state change */ | ||
1180 | if (efx->type->monitor != NULL) { | ||
1179 | queue_delayed_work(efx->workqueue, &efx->monitor_work, | 1181 | queue_delayed_work(efx->workqueue, &efx->monitor_work, |
1180 | efx_monitor_interval); | 1182 | efx_monitor_interval); |
1183 | } else { | ||
1184 | mutex_lock(&efx->mac_lock); | ||
1185 | if (efx->phy_op->poll(efx)) | ||
1186 | efx_link_status_changed(efx); | ||
1187 | mutex_unlock(&efx->mac_lock); | ||
1188 | } | ||
1181 | 1189 | ||
1182 | efx->type->start_stats(efx); | 1190 | efx->type->start_stats(efx); |
1183 | } | 1191 | } |
@@ -1421,6 +1429,10 @@ static int efx_net_open(struct net_device *net_dev) | |||
1421 | if (efx->phy_mode & PHY_MODE_SPECIAL) | 1429 | if (efx->phy_mode & PHY_MODE_SPECIAL) |
1422 | return -EBUSY; | 1430 | return -EBUSY; |
1423 | 1431 | ||
1432 | /* Notify the kernel of the link state polled during driver load, | ||
1433 | * before the monitor starts running */ | ||
1434 | efx_link_status_changed(efx); | ||
1435 | |||
1424 | efx_start_all(efx); | 1436 | efx_start_all(efx); |
1425 | return 0; | 1437 | return 0; |
1426 | } | 1438 | } |