include/linux/usb/storage.h

Source file repositories/reference/linux-study-clean/include/linux/usb/storage.h

File Facts

System
Linux kernel
Corpus path
include/linux/usb/storage.h
Extension
.h
Size
2834 bytes
Lines
94
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct bulk_cb_wrap {
	__le32	Signature;		/* contains 'USBC' */
	__u32	Tag;			/* unique per command id */
	__le32	DataTransferLength;	/* size of data */
	__u8	Flags;			/* direction in bit 7 */
	__u8	Lun;			/* LUN normally 0 */
	__u8	Length;			/* length of the CDB */
	__u8	CDB[16];		/* max command */
};

#define US_BULK_CB_WRAP_LEN	31
#define US_BULK_CB_SIGN		0x43425355	/* spells out 'USBC' */
#define US_BULK_FLAG_IN		(1 << 7)
#define US_BULK_FLAG_OUT	0

/* command status wrapper */
struct bulk_cs_wrap {
	__le32	Signature;	/* contains 'USBS' */
	__u32	Tag;		/* same as original command */
	__le32	Residue;	/* amount not transferred */
	__u8	Status;		/* see below */
};

#define US_BULK_CS_WRAP_LEN	13
#define US_BULK_CS_SIGN		0x53425355      /* spells out 'USBS' */
#define US_BULK_STAT_OK		0
#define US_BULK_STAT_FAIL	1
#define US_BULK_STAT_PHASE	2

/* bulk-only class specific requests */
#define US_BULK_RESET_REQUEST   0xff
#define US_BULK_GET_MAX_LUN     0xfe

/*
 * If 4 LUNs are supported then the LUNs would be
 * numbered from 0 to 3, and the return value for
 * US_BULK_GET_MAX_LUN request would be 3. The valid
 * LUN field is 4 bits wide, the upper limit is 0x0f.
 */
#define US_BULK_MAX_LUN_LIMIT   0x0f

#endif

Annotation

Implementation Notes