{
const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic);
struct sfc_mae *mae = &sa->mae;
+ int rc;
sfc_log_init(sa, "entry");
return 0;
}
+ sfc_log_init(sa, "init MAE");
+ rc = efx_mae_init(sa->nic);
+ if (rc != 0)
+ goto fail_mae_init;
+
mae->status = SFC_MAE_STATUS_SUPPORTED;
sfc_log_init(sa, "done");
return 0;
+
+fail_mae_init:
+ sfc_log_init(sa, "failed %d", rc);
+
+ return rc;
}
void
sfc_mae_detach(struct sfc_adapter *sa)
{
struct sfc_mae *mae = &sa->mae;
+ enum sfc_mae_status status_prev = mae->status;
sfc_log_init(sa, "entry");
mae->status = SFC_MAE_STATUS_UNKNOWN;
+ if (status_prev != SFC_MAE_STATUS_SUPPORTED)
+ return;
+
+ efx_mae_fini(sa->nic);
+
sfc_log_init(sa, "done");
}