/* SPDX-License-Identifier: GPL-2.0-only */ /**************************************************************************** * Driver for Solarflare network controllers and boards * Copyright 2008-2013 Solarflare Communications Inc.
*/
#ifndef EFX_MCDI_H #define EFX_MCDI_H
/** * enum efx_mcdi_state - MCDI request handling state * @MCDI_STATE_QUIESCENT: No pending MCDI requests. If the caller holds the * mcdi @iface_lock then they are able to move to %MCDI_STATE_RUNNING * @MCDI_STATE_RUNNING_SYNC: There is a synchronous MCDI request pending. * Only the thread that moved into this state is allowed to move out of it. * @MCDI_STATE_RUNNING_ASYNC: There is an asynchronous MCDI request pending. * @MCDI_STATE_PROXY_WAIT: An MCDI request has completed with a response that * indicates we must wait for a proxy try again message. * @MCDI_STATE_COMPLETED: An MCDI request has completed, but the owning thread * has not yet consumed the result. For all other threads, equivalent to * %MCDI_STATE_RUNNING.
*/ enum efx_mcdi_state {
MCDI_STATE_QUIESCENT,
MCDI_STATE_RUNNING_SYNC,
MCDI_STATE_RUNNING_ASYNC,
MCDI_STATE_PROXY_WAIT,
MCDI_STATE_COMPLETED,
};
/** * enum efx_mcdi_mode - MCDI transaction mode * @MCDI_MODE_POLL: poll for MCDI completion, until timeout * @MCDI_MODE_EVENTS: wait for an mcdi_event. On timeout, poll once * @MCDI_MODE_FAIL: we think MCDI is dead, so fail-fast all calls
*/ enum efx_mcdi_mode {
MCDI_MODE_POLL,
MCDI_MODE_EVENTS,
MCDI_MODE_FAIL,
};
/** * struct efx_mcdi_iface - MCDI protocol context * @efx: The associated NIC. * @state: Request handling state. Waited for by @wq. * @mode: Poll for mcdi completion, or wait for an mcdi_event. * @wq: Wait queue for threads waiting for @state != %MCDI_STATE_RUNNING * @new_epoch: Indicates start of day or start of MC reboot recovery * @iface_lock: Serialises access to @seqno, @credits and response metadata * @seqno: The next sequence number to use for mcdi requests. * @credits: Number of spurious MCDI completion events allowed before we * trigger a fatal error * @resprc: Response error/success code (Linux numbering) * @resp_hdr_len: Response header length * @resp_data_len: Response data (SDU or error) length * @async_lock: Serialises access to @async_list while event processing is * enabled * @async_list: Queue of asynchronous requests * @async_timer: Timer for asynchronous request timeout * @logging_buffer: buffer that may be used to build MCDI tracing messages * @logging_enabled: whether to trace MCDI * @proxy_rx_handle: Most recently received proxy authorisation handle * @proxy_rx_status: Status of most recent proxy authorisation * @proxy_rx_wq: Wait queue for updates to proxy_rx_handle
*/ struct efx_mcdi_iface { struct efx_nic *efx; enum efx_mcdi_state state; enum efx_mcdi_mode mode;
wait_queue_head_t wq;
spinlock_t iface_lock; bool new_epoch; unsignedint credits; unsignedint seqno; int resprc; int resprc_raw;
size_t resp_hdr_len;
size_t resp_data_len;
spinlock_t async_lock; struct list_head async_list; struct timer_list async_timer; #ifdef CONFIG_SFC_SIENA_MCDI_LOGGING char *logging_buffer; bool logging_enabled; #endif unsignedint proxy_rx_handle; int proxy_rx_status;
wait_queue_head_t proxy_rx_wq;
};
/** * struct efx_mcdi_data - extra state for NICs that implement MCDI * @iface: Interface/protocol state * @hwmon: Hardware monitor state * @fn_flags: Flags for this function, as returned by %MC_CMD_DRV_ATTACH.
*/ struct efx_mcdi_data { struct efx_mcdi_iface iface; #ifdef CONFIG_SFC_SIENA_MCDI_MON struct efx_mcdi_mon hwmon; #endif
u32 fn_flags;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.