From: Gautam Dawar <gda...@solarflare.com> Add the capability to receive MCDI proxy event from firmware and invoke the client driver registered function to handle it.
Signed-off-by: Gautam Dawar <gda...@solarflare.com> Signed-off-by: Andrew Rybchenko <arybche...@solarflare.com> --- drivers/net/sfc/base/ef10_ev.c | 7 +++++++ drivers/net/sfc/base/efx.h | 3 +++ drivers/net/sfc/base/efx_check.h | 9 ++++++++- drivers/net/sfc/base/efx_mcdi.c | 12 ++++++++++++ drivers/net/sfc/base/efx_mcdi.h | 7 +++++++ 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/drivers/net/sfc/base/ef10_ev.c b/drivers/net/sfc/base/ef10_ev.c index 99cae3f..8cabb4e 100644 --- a/drivers/net/sfc/base/ef10_ev.c +++ b/drivers/net/sfc/base/ef10_ev.c @@ -1227,6 +1227,13 @@ break; #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ +#if EFSYS_OPT_MCDI_PROXY_AUTH_SERVER + case MCDI_EVENT_CODE_PROXY_REQUEST: + efx_mcdi_ev_proxy_request(enp, + MCDI_EV_FIELD(eqp, PROXY_REQUEST_BUFF_INDEX)); + break; +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH_SERVER */ + case MCDI_EVENT_CODE_LINKCHANGE: { efx_link_mode_t link_mode; diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h index 8a3eb17..97c4e62 100644 --- a/drivers/net/sfc/base/efx.h +++ b/drivers/net/sfc/base/efx.h @@ -243,6 +243,9 @@ enum { #if EFSYS_OPT_MCDI_PROXY_AUTH void (*emt_ev_proxy_response)(void *, uint32_t, efx_rc_t); #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ +#if EFSYS_OPT_MCDI_PROXY_AUTH_SERVER + void (*emt_ev_proxy_request)(void *, uint32_t); +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH_SERVER */ } efx_mcdi_transport_t; extern __checkReturn efx_rc_t diff --git a/drivers/net/sfc/base/efx_check.h b/drivers/net/sfc/base/efx_check.h index 85edaef..06983dc 100644 --- a/drivers/net/sfc/base/efx_check.h +++ b/drivers/net/sfc/base/efx_check.h @@ -119,8 +119,15 @@ # endif #endif /* EFSYS_OPT_MCDI_LOGGING */ +#if EFSYS_OPT_MCDI_PROXY_AUTH_SERVER +/* Support MCDI proxy authorization (server) */ +# if !EFSYS_OPT_MCDI_PROXY_AUTH +# error "MCDI_PROXY_AUTH_SERVER requires MCDI_PROXY_AUTH" +# endif +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH_SERVER */ + #if EFSYS_OPT_MCDI_PROXY_AUTH -/* Support MCDI proxy authorization */ +/* Support MCDI proxy authorization (client) */ # if !EFSYS_OPT_MCDI # error "MCDI_PROXY_AUTH requires MCDI" # endif diff --git a/drivers/net/sfc/base/efx_mcdi.c b/drivers/net/sfc/base/efx_mcdi.c index 584fd4d..325c2e4 100644 --- a/drivers/net/sfc/base/efx_mcdi.c +++ b/drivers/net/sfc/base/efx_mcdi.c @@ -845,6 +845,18 @@ } #endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ +#if EFSYS_OPT_MCDI_PROXY_AUTH_SERVER + void +efx_mcdi_ev_proxy_request( + __in efx_nic_t *enp, + __in unsigned int index) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + + if (emtp->emt_ev_proxy_request != NULL) + emtp->emt_ev_proxy_request(emtp->emt_context, index); +} +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH_SERVER */ void efx_mcdi_ev_death( __in efx_nic_t *enp, diff --git a/drivers/net/sfc/base/efx_mcdi.h b/drivers/net/sfc/base/efx_mcdi.h index a9e0255..56c0ab1 100644 --- a/drivers/net/sfc/base/efx_mcdi.h +++ b/drivers/net/sfc/base/efx_mcdi.h @@ -87,6 +87,13 @@ struct efx_mcdi_req_s { __in unsigned int status); #endif +#if EFSYS_OPT_MCDI_PROXY_AUTH_SERVER +extern void +efx_mcdi_ev_proxy_request( + __in efx_nic_t *enp, + __in unsigned int index); +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH_SERVER */ + extern void efx_mcdi_ev_death( __in efx_nic_t *enp, -- 1.8.3.1