- struct sfc_adapter *sa = (struct sfc_adapter *)arg;
- struct sfc_mcdi *mcdi = &sa->mcdi;
- uint32_t proxy_handle;
-
- rte_spinlock_lock(&mcdi->lock);
-
- SFC_ASSERT(mcdi->state == SFC_MCDI_INITIALIZED);
-
- efx_mcdi_request_start(sa->nic, emrp, B_FALSE);
- sfc_mcdi_poll(sa, B_FALSE);
-
- if (efx_mcdi_get_proxy_handle(sa->nic, emrp, &proxy_handle) == 0) {
- /*
- * Authorization is required for the MCDI request;
- * wait for an MCDI proxy response event to bring
- * a non-zero proxy handle (should be the same as
- * the value obtained above) and operation status
- */
- sfc_mcdi_poll(sa, B_TRUE);
-
- if ((mcdi->proxy_handle != 0) &&
- (mcdi->proxy_handle != proxy_handle)) {
- sfc_err(sa, "Unexpected MCDI proxy event");
- emrp->emr_rc = EFAULT;
- } else if (mcdi->proxy_result == 0) {
- /*
- * Authorization succeeded; re-issue the original
- * request and poll for an ordinary MCDI response
- */
- efx_mcdi_request_start(sa->nic, emrp, B_FALSE);
- sfc_mcdi_poll(sa, B_FALSE);
- } else {
- emrp->emr_rc = mcdi->proxy_result;
- sfc_err(sa, "MCDI proxy authorization failed "
- "(handle=%08x, result=%d)",
- proxy_handle, mcdi->proxy_result);
- }
- }
-
- rte_spinlock_unlock(&mcdi->lock);
-}
-
-static void
-sfc_mcdi_ev_cpl(void *arg)
-{
- struct sfc_adapter *sa = (struct sfc_adapter *)arg;
- struct sfc_mcdi *mcdi __rte_unused;
-
- mcdi = &sa->mcdi;
- SFC_ASSERT(mcdi->state == SFC_MCDI_INITIALIZED);
-
- /* MCDI is polled, completions are not expected */
- SFC_ASSERT(0);
-}
-
-static void
-sfc_mcdi_exception(void *arg, efx_mcdi_exception_t eme)
-{
- struct sfc_adapter *sa = (struct sfc_adapter *)arg;
-
- sfc_warn(sa, "MC %s",
- (eme == EFX_MCDI_EXCEPTION_MC_REBOOT) ? "REBOOT" :
- (eme == EFX_MCDI_EXCEPTION_MC_BADASSERT) ? "BADASSERT" : "UNKNOWN");