include/scsi/scsi.h
Source file repositories/reference/linux-study-clean/include/scsi/scsi.h
File Facts
- System
- Linux kernel
- Corpus path
include/scsi/scsi.h- Extension
.h- Size
- 6063 bytes
- Lines
- 229
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hasm/param.hscsi/scsi_common.hscsi/scsi_proto.hscsi/scsi_status.h
Detected Declarations
struct scsi_cmndstruct ccs_modesel_headenum scsi_timeoutsenum scsi_dispositionenum scsi_qc_statusfunction LUNSfunction scsi_status_is_check_conditionfunction msg_byte
Annotated Snippet
struct ccs_modesel_head {
__u8 _r1; /* reserved */
__u8 medium; /* device-specific medium type */
__u8 _r2; /* reserved */
__u8 block_desc_length; /* block descriptor length */
__u8 density; /* device-specific density code */
__u8 number_blocks_hi; /* number of blocks in this block desc */
__u8 number_blocks_med;
__u8 number_blocks_lo;
__u8 _r3;
__u8 block_length_hi; /* block length for blocks in this desc */
__u8 block_length_med;
__u8 block_length_lo;
};
/*
* The Well Known LUNS (SAM-3) in our int representation of a LUN
*/
#define SCSI_W_LUN_BASE 0xc100
#define SCSI_W_LUN_REPORT_LUNS (SCSI_W_LUN_BASE + 1)
#define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2)
#define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3)
static inline int scsi_is_wlun(u64 lun)
{
return (lun & 0xff00) == SCSI_W_LUN_BASE;
}
/**
* scsi_status_is_check_condition - check the status return.
*
* @status: the status passed up from the driver (including host and
* driver components)
*
* Returns: %true if the status code is SAM_STAT_CHECK_CONDITION.
*/
static inline int scsi_status_is_check_condition(int status)
{
if (status < 0)
return false;
status &= 0xfe;
return status == SAM_STAT_CHECK_CONDITION;
}
/*
* Extended message codes.
*/
#define EXTENDED_MODIFY_DATA_POINTER 0x00
#define EXTENDED_SDTR 0x01
#define EXTENDED_EXTENDED_IDENTIFY 0x02 /* SCSI-I only */
#define EXTENDED_WDTR 0x03
#define EXTENDED_PPR 0x04
#define EXTENDED_MODIFY_BIDI_DATA_PTR 0x05
/*
* Internal return values.
*/
enum scsi_disposition {
NEEDS_RETRY = 0x2001,
SUCCESS = 0x2002,
FAILED = 0x2003,
QUEUED = 0x2004,
SOFT_ERROR = 0x2005,
ADD_TO_MLQUEUE = 0x2006,
TIMEOUT_ERROR = 0x2007,
SCSI_RETURN_NOT_HANDLED = 0x2008,
FAST_IO_FAIL = 0x2009,
};
/*
* Status values returned by the .queuecommand() callback if a command has not
* been queued.
*/
enum scsi_qc_status {
SCSI_MLQUEUE_HOST_BUSY = 0x1055,
SCSI_MLQUEUE_DEVICE_BUSY = 0x1056,
SCSI_MLQUEUE_EH_RETRY = 0x1057,
SCSI_MLQUEUE_TARGET_BUSY = 0x1058,
};
/*
* Use these to separate status msg and our bytes
*
* These are set by:
*
* status byte = set from target device
* msg_byte (unused)
* host_byte = set by low-level driver to indicate status.
*/
#define status_byte(result) (result & 0xff)
Annotation
- Immediate include surface: `linux/types.h`, `asm/param.h`, `scsi/scsi_common.h`, `scsi/scsi_proto.h`, `scsi/scsi_status.h`.
- Detected declarations: `struct scsi_cmnd`, `struct ccs_modesel_head`, `enum scsi_timeouts`, `enum scsi_disposition`, `enum scsi_qc_status`, `function LUNS`, `function scsi_status_is_check_condition`, `function msg_byte`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
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.