/** * enum cdx_mcdi_cmd_state - State for an individual MCDI command * @MCDI_STATE_QUEUED: Command not started and is waiting to run. * @MCDI_STATE_RETRY: Command was submitted and MC rejected with no resources, * as MC have too many outstanding commands. Command will be retried once * another command returns. * @MCDI_STATE_RUNNING: Command was accepted and is running. * @MCDI_STATE_RUNNING_CANCELLED: Command is running but the issuer cancelled * the command. * @MCDI_STATE_FINISHED: Processing of this command has completed.
*/
/** * struct cdx_mcdi_cmd - An outstanding MCDI command * @ref: Reference count. There will be one reference if the command is * in the mcdi_iface cmd_list, another if it's on a cleanup list, * and a third if it's queued in the work queue. * @list: The data for this entry in mcdi->cmd_list * @cleanup_list: The data for this entry in a cleanup list * @work: The work item for this command, queued in mcdi->workqueue * @mcdi: The mcdi_iface for this command * @state: The state of this command * @inlen: inbuf length * @inbuf: Input buffer * @quiet: Whether to silence errors * @reboot_seen: Whether a reboot has been seen during this command, * to prevent duplicates * @seq: Sequence number * @started: Jiffies this command was started at * @cookie: Context for completion function * @completer: Completion function * @handle: Command handle * @cmd: Command number * @rc: Return code * @outlen: Length of output buffer * @outbuf: Output buffer
*/ struct cdx_mcdi_cmd { struct kref ref; struct list_head list; struct list_head cleanup_list; struct work_struct work; struct cdx_mcdi_iface *mcdi; enum cdx_mcdi_cmd_state state;
size_t inlen; conststruct cdx_dword *inbuf; bool quiet; bool reboot_seen;
u8 seq; unsignedlong started; unsignedlong cookie;
cdx_mcdi_async_completer *completer; unsignedint handle; unsignedint cmd; int rc;
size_t outlen; struct cdx_dword *outbuf; /* followed by inbuf data if necessary */
};
/** * struct cdx_mcdi_iface - MCDI protocol context * @cdx: The associated NIC * @iface_lock: Serialise access to this structure * @outstanding_cleanups: Count of cleanups * @cmd_list: List of outstanding and running commands * @workqueue: Workqueue used for delayed processing * @cmd_complete_wq: Waitqueue for command completion * @db_held_by: Command the MC doorbell is in use by * @seq_held_by: Command each sequence number is in use by * @prev_handle: The last used command handle * @mode: Poll for mcdi completion, or wait for an mcdi_event * @prev_seq: The last used sequence number * @new_epoch: Indicates start of day or start of MC reboot recovery
*/ struct cdx_mcdi_iface { struct cdx_mcdi *cdx; /* Serialise access */ struct mutex iface_lock; unsignedint outstanding_cleanups; struct list_head cmd_list; struct workqueue_struct *workqueue;
wait_queue_head_t cmd_complete_wq; struct cdx_mcdi_cmd *db_held_by; struct cdx_mcdi_cmd *seq_held_by[16]; unsignedint prev_handle; enum cdx_mcdi_mode mode;
u8 prev_seq; bool new_epoch;
};
/** * struct cdx_mcdi_data - extra state for NICs that implement MCDI * @iface: Interface/protocol state * @fn_flags: Flags for this function, as returned by %MC_CMD_DRV_ATTACH.
*/ struct cdx_mcdi_data { struct cdx_mcdi_iface iface;
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.