(eme == EFX_MCDI_EXCEPTION_MC_REBOOT) ? "REBOOT" :
(eme == EFX_MCDI_EXCEPTION_MC_BADASSERT) ? "BADASSERT" : "UNKNOWN");
- sfc_schedule_restart(sa);
+ mcdi->ops->sched_restart(mcdi->ops_cookie);
}
#define SFC_MCDI_LOG_BUF_SIZE 128
efx_mcdi_transport_t *emtp;
int rc;
- if (ops->dma_alloc == NULL || ops->dma_free == NULL)
+ if (ops->dma_alloc == NULL || ops->dma_free == NULL ||
+ ops->sched_restart == NULL)
return EINVAL;
SFC_ASSERT(mcdi->state == SFC_EFX_MCDI_UNINITIALIZED);
sfc_dma_free(sa, esmp);
}
+static sfc_efx_mcdi_sched_restart_cb sfc_mcdi_sched_restart;
+static void
+sfc_mcdi_sched_restart(void *cookie)
+{
+ struct sfc_adapter *sa = cookie;
+
+ sfc_schedule_restart(sa);
+}
+
static const struct sfc_efx_mcdi_ops sfc_mcdi_ops = {
.dma_alloc = sfc_mcdi_dma_alloc,
.dma_free = sfc_mcdi_dma_free,
+ .sched_restart = sfc_mcdi_sched_restart,
};
int
typedef void (sfc_efx_mcdi_dma_free_cb)(void *cookie, efsys_mem_t *esmp);
+typedef void (sfc_efx_mcdi_sched_restart_cb)(void *cookie);
+
struct sfc_efx_mcdi_ops {
sfc_efx_mcdi_dma_alloc_cb *dma_alloc;
sfc_efx_mcdi_dma_free_cb *dma_free;
+ sfc_efx_mcdi_sched_restart_cb *sched_restart;
};
struct sfc_efx_mcdi {