include/scsi/scsi_host.h
Source file repositories/reference/linux-study-clean/include/scsi/scsi_host.h
File Facts
- System
- Linux kernel
- Corpus path
include/scsi/scsi_host.h- Extension
.h- Size
- 28847 bytes
- Lines
- 946
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/list.hlinux/types.hlinux/workqueue.hlinux/mutex.hlinux/seq_file.hlinux/blk-mq.hscsi/scsi.h
Detected Declarations
struct block_devicestruct completionstruct modulestruct scsi_cmndstruct scsi_devicestruct scsi_targetstruct Scsi_Hoststruct scsi_transport_templatestruct scsi_host_templatestruct Scsi_Hoststruct class_containerenum scsi_timeout_actionenum scsi_host_stateenum scsi_host_prot_capabilitiesenum scsi_host_guard_typefunction scsi_host_in_recoveryfunction scsi_add_hostfunction scsi_host_scan_allowedfunction scsi_host_set_protfunction scsi_host_get_protfunction scsi_host_prot_dmafunction scsi_host_dif_capablefunction scsi_host_dix_capablefunction scsi_host_set_guardfunction scsi_host_get_guard
Annotated Snippet
struct scsi_host_template {
/*
* Put fields referenced in IO submission path together in
* same cacheline
*/
/*
* Additional per-command data allocated for the driver.
*/
unsigned int cmd_size;
/*
* The queuecommand function is used to queue up a scsi
* command block to the LLDD. When the driver finished
* processing the command the done callback is invoked.
*
* If queuecommand returns 0, then the driver has accepted the
* command. It must also push it to the HBA if the scsi_cmnd
* flag SCMD_LAST is set, or if the driver does not implement
* commit_rqs. The done() function must be called on the command
* when the driver has finished with it. (you may call done on the
* command before queuecommand returns, but in this case you
* *must* return 0 from queuecommand).
*
* Queuecommand may also reject the command, in which case it may
* not touch the command and must not call done() for it.
*
* There are two possible rejection returns:
*
* SCSI_MLQUEUE_DEVICE_BUSY: Block this device temporarily, but
* allow commands to other devices serviced by this host.
*
* SCSI_MLQUEUE_HOST_BUSY: Block all devices served by this
* host temporarily.
*
* For compatibility, any other non-zero return is treated the
* same as SCSI_MLQUEUE_HOST_BUSY.
*
* NOTE: "temporarily" means either until the next command for#
* this device/host completes, or a period of time determined by
* I/O pressure in the system if there are no other outstanding
* commands.
*
* STATUS: REQUIRED
*/
enum scsi_qc_status (*queuecommand)(struct Scsi_Host *,
struct scsi_cmnd *);
/*
* Queue a reserved command (BLK_MQ_REQ_RESERVED). The .queuecommand()
* documentation also applies to the .queue_reserved_command() callback.
*/
enum scsi_qc_status (*queue_reserved_command)(struct Scsi_Host *,
struct scsi_cmnd *);
/*
* The commit_rqs function is used to trigger a hardware
* doorbell after some requests have been queued with
* queuecommand, when an error is encountered before sending
* the request with SCMD_LAST set.
*
* STATUS: OPTIONAL
*/
void (*commit_rqs)(struct Scsi_Host *, u16);
struct module *module;
const char *name;
/*
* The info function will return whatever useful information the
* developer sees fit. If not provided, then the name field will
* be used instead.
*
* Status: OPTIONAL
*/
const char *(*info)(struct Scsi_Host *);
/*
* Ioctl interface
*
* Status: OPTIONAL
*/
int (*ioctl)(struct scsi_device *dev, unsigned int cmd,
void __user *arg);
#ifdef CONFIG_COMPAT
/*
* Compat handler. Handle 32bit ABI.
* When unknown ioctl is passed return -ENOIOCTLCMD.
Annotation
- Immediate include surface: `linux/device.h`, `linux/list.h`, `linux/types.h`, `linux/workqueue.h`, `linux/mutex.h`, `linux/seq_file.h`, `linux/blk-mq.h`, `scsi/scsi.h`.
- Detected declarations: `struct block_device`, `struct completion`, `struct module`, `struct scsi_cmnd`, `struct scsi_device`, `struct scsi_target`, `struct Scsi_Host`, `struct scsi_transport_template`, `struct scsi_host_template`, `struct Scsi_Host`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.