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>
This commit is contained in:
parent
55edc6e6ff
commit
fe75820b99
3 changed files with 17 additions and 10 deletions
|
@ -1293,7 +1293,6 @@ static void efx_monitor(struct work_struct *data)
|
||||||
{
|
{
|
||||||
struct efx_nic *efx = container_of(data, struct efx_nic,
|
struct efx_nic *efx = container_of(data, struct efx_nic,
|
||||||
monitor_work.work);
|
monitor_work.work);
|
||||||
int rc;
|
|
||||||
|
|
||||||
EFX_TRACE(efx, "hardware monitor executing on CPU %d\n",
|
EFX_TRACE(efx, "hardware monitor executing on CPU %d\n",
|
||||||
raw_smp_processor_id());
|
raw_smp_processor_id());
|
||||||
|
@ -1305,15 +1304,7 @@ static void efx_monitor(struct work_struct *data)
|
||||||
goto out_requeue;
|
goto out_requeue;
|
||||||
if (!efx->port_enabled)
|
if (!efx->port_enabled)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
rc = falcon_board(efx)->type->monitor(efx);
|
falcon_monitor(efx);
|
||||||
if (rc) {
|
|
||||||
EFX_ERR(efx, "Board sensor %s; shutting down PHY\n",
|
|
||||||
(rc == -ERANGE) ? "reported fault" : "failed");
|
|
||||||
efx->phy_mode |= PHY_MODE_LOW_POWER;
|
|
||||||
falcon_sim_phy_event(efx);
|
|
||||||
}
|
|
||||||
efx->phy_op->poll(efx);
|
|
||||||
efx->mac_op->poll(efx);
|
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
mutex_unlock(&efx->mac_lock);
|
mutex_unlock(&efx->mac_lock);
|
||||||
|
|
|
@ -2612,6 +2612,21 @@ fail5:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void falcon_monitor(struct efx_nic *efx)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = falcon_board(efx)->type->monitor(efx);
|
||||||
|
if (rc) {
|
||||||
|
EFX_ERR(efx, "Board sensor %s; shutting down PHY\n",
|
||||||
|
(rc == -ERANGE) ? "reported fault" : "failed");
|
||||||
|
efx->phy_mode |= PHY_MODE_LOW_POWER;
|
||||||
|
falcon_sim_phy_event(efx);
|
||||||
|
}
|
||||||
|
efx->phy_op->poll(efx);
|
||||||
|
efx->mac_op->poll(efx);
|
||||||
|
}
|
||||||
|
|
||||||
/* Zeroes out the SRAM contents. This routine must be called in
|
/* Zeroes out the SRAM contents. This routine must be called in
|
||||||
* process context and is allowed to sleep.
|
* process context and is allowed to sleep.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -158,6 +158,7 @@ extern int falcon_probe_nic(struct efx_nic *efx);
|
||||||
extern int falcon_init_nic(struct efx_nic *efx);
|
extern int falcon_init_nic(struct efx_nic *efx);
|
||||||
extern int falcon_flush_queues(struct efx_nic *efx);
|
extern int falcon_flush_queues(struct efx_nic *efx);
|
||||||
extern int falcon_reset_hw(struct efx_nic *efx, enum reset_type method);
|
extern int falcon_reset_hw(struct efx_nic *efx, enum reset_type method);
|
||||||
|
extern void falcon_monitor(struct efx_nic *efx);
|
||||||
extern void falcon_remove_nic(struct efx_nic *efx);
|
extern void falcon_remove_nic(struct efx_nic *efx);
|
||||||
extern void falcon_update_nic_stats(struct efx_nic *efx);
|
extern void falcon_update_nic_stats(struct efx_nic *efx);
|
||||||
extern void falcon_start_nic_stats(struct efx_nic *efx);
|
extern void falcon_start_nic_stats(struct efx_nic *efx);
|
||||||
|
|
Loading…
Reference in a new issue