include/ufs/ufshci.h

Source file repositories/reference/linux-study-clean/include/ufs/ufshci.h

File Facts

System
Linux kernel
Corpus path
include/ufs/ufshci.h
Extension
.h
Size
16175 bytes
Lines
629
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ufshcd_sg_entry {
	__le64    addr;
	__le32    reserved;
	__le32    size;
	/*
	 * followed by variant-specific fields if
	 * CONFIG_SCSI_UFS_VARIABLE_SG_ENTRY_SIZE has been defined.
	 */
};

/**
 * struct utp_transfer_cmd_desc - UTP Command Descriptor (UCD)
 * @command_upiu: Command UPIU Frame address
 * @response_upiu: Response UPIU Frame address
 * @prd_table: Physical Region Descriptor: an array of SG_ALL struct
 *	ufshcd_sg_entry's.  Variant-specific fields may be present after each.
 */
struct utp_transfer_cmd_desc {
	u8 command_upiu[ALIGNED_UPIU_SIZE];
	u8 response_upiu[ALIGNED_UPIU_SIZE];
	u8 prd_table[];
};

/**
 * struct request_desc_header - Descriptor Header common to both UTRD and UTMRD
 */
struct request_desc_header {
	u8 cci;
	u8 ehs_length;
#if defined(__BIG_ENDIAN)
	u8 enable_crypto:1;
	u8 reserved2:7;

	u8 command_type:4;
	u8 reserved1:1;
	u8 data_direction:2;
	u8 interrupt:1;
#elif defined(__LITTLE_ENDIAN)
	u8 reserved2:7;
	u8 enable_crypto:1;

	u8 interrupt:1;
	u8 data_direction:2;
	u8 reserved1:1;
	u8 command_type:4;
#else
#error
#endif

	__le32 dunl;
	u8 ocs;
	u8 cds;
	__le16 ldbc;
	__le32 dunu;
};

static_assert(sizeof(struct request_desc_header) == 16);

/**
 * struct utp_transfer_req_desc - UTP Transfer Request Descriptor (UTRD)
 * @header: UTRD header DW-0 to DW-3
 * @command_desc_base_addr: UCD base address DW 4-5
 * @response_upiu_length: response UPIU length DW-6
 * @response_upiu_offset: response UPIU offset DW-6
 * @prd_table_length: Physical region descriptor length DW-7
 * @prd_table_offset: Physical region descriptor offset DW-7
 */
struct utp_transfer_req_desc {

	/* DW 0-3 */
	struct request_desc_header header;

	/* DW 4-5*/
	__le64  command_desc_base_addr;

	/* DW 6 */
	__le16  response_upiu_length;
	__le16  response_upiu_offset;

	/* DW 7 */
	__le16  prd_table_length;
	__le16  prd_table_offset;
};

/* MCQ Completion Queue Entry */
struct cq_entry {
	/* DW 0-1 */
	__le64 command_desc_base_addr;

	/* DW 2 */

Annotation

Implementation Notes