aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-11-25 11:11:45 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-26 18:59:40 -0500
commitfe75820b99ff2de713de23252432f0f9d0ca1d35 (patch)
treeca03ef31a0e3a5352628038db11c5c61e9341da1 /drivers/net/sfc
parent55edc6e6ff728681ebc10d418222740705376664 (diff)
sfc: Move Falcon board/PHY/MAC monitoring code to falcon.c
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/efx.c11
-rw-r--r--drivers/net/sfc/falcon.c15
-rw-r--r--drivers/net/sfc/falcon.h1
3 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 41ca5dbb4c44..d17cea9f4e88 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1293,7 +1293,6 @@ static void efx_monitor(struct work_struct *data)
1293{ 1293{
1294 struct efx_nic *efx = container_of(data, struct efx_nic, 1294 struct efx_nic *efx = container_of(data, struct efx_nic,
1295 monitor_work.work); 1295 monitor_work.work);
1296 int rc;
1297 1296
1298 EFX_TRACE(efx, "hardware monitor executing on CPU %d\n", 1297 EFX_TRACE(efx, "hardware monitor executing on CPU %d\n",
1299 raw_smp_processor_id()); 1298 raw_smp_processor_id());
@@ -1305,15 +1304,7 @@ static void efx_monitor(struct work_struct *data)
1305 goto out_requeue; 1304 goto out_requeue;
1306 if (!efx->port_enabled) 1305 if (!efx->port_enabled)
1307 goto out_unlock; 1306 goto out_unlock;
1308 rc = falcon_board(efx)->type->monitor(efx); 1307 falcon_monitor(efx);
1309 if (rc) {
1310 EFX_ERR(efx, "Board sensor %s; shutting down PHY\n",
1311 (rc == -ERANGE) ? "reported fault" : "failed");
1312 efx->phy_mode |= PHY_MODE_LOW_POWER;
1313 falcon_sim_phy_event(efx);
1314 }
1315 efx->phy_op->poll(efx);
1316 efx->mac_op->poll(efx);
1317 1308
1318out_unlock: 1309out_unlock:
1319 mutex_unlock(&efx->mac_lock); 1310 mutex_unlock(&efx->mac_lock);
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 3ab2daff6b48..c43c5e6f077b 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -2612,6 +2612,21 @@ fail5:
2612 return rc; 2612 return rc;
2613} 2613}
2614 2614
2615void falcon_monitor(struct efx_nic *efx)
2616{
2617 int rc;
2618
2619 rc = falcon_board(efx)->type->monitor(efx);
2620 if (rc) {
2621 EFX_ERR(efx, "Board sensor %s; shutting down PHY\n",
2622 (rc == -ERANGE) ? "reported fault" : "failed");
2623 efx->phy_mode |= PHY_MODE_LOW_POWER;
2624 falcon_sim_phy_event(efx);
2625 }
2626 efx->phy_op->poll(efx);
2627 efx->mac_op->poll(efx);
2628}
2629
2615/* Zeroes out the SRAM contents. This routine must be called in 2630/* Zeroes out the SRAM contents. This routine must be called in
2616 * process context and is allowed to sleep. 2631 * process context and is allowed to sleep.
2617 */ 2632 */
diff --git a/drivers/net/sfc/falcon.h b/drivers/net/sfc/falcon.h
index 61fab0a00cc3..05e51c2a6d8a 100644
--- a/drivers/net/sfc/falcon.h
+++ b/drivers/net/sfc/falcon.h
@@ -158,6 +158,7 @@ extern int falcon_probe_nic(struct efx_nic *efx);
158extern int falcon_init_nic(struct efx_nic *efx); 158extern int falcon_init_nic(struct efx_nic *efx);
159extern int falcon_flush_queues(struct efx_nic *efx); 159extern int falcon_flush_queues(struct efx_nic *efx);
160extern int falcon_reset_hw(struct efx_nic *efx, enum reset_type method); 160extern int falcon_reset_hw(struct efx_nic *efx, enum reset_type method);
161extern void falcon_monitor(struct efx_nic *efx);
161extern void falcon_remove_nic(struct efx_nic *efx); 162extern void falcon_remove_nic(struct efx_nic *efx);
162extern void falcon_update_nic_stats(struct efx_nic *efx); 163extern void falcon_update_nic_stats(struct efx_nic *efx);
163extern void falcon_start_nic_stats(struct efx_nic *efx); 164extern void falcon_start_nic_stats(struct efx_nic *efx);