include/ufs/ufs.h

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

File Facts

System
Linux kernel
Corpus path
include/ufs/ufs.h
Extension
.h
Size
20030 bytes
Lines
667
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 utp_cmd_rsp {
	__be32 residual_transfer_count;
	__be32 reserved[4];
	__be16 sense_data_len;
	u8 sense_data[UFS_SENSE_SIZE];
};

static_assert(sizeof(struct utp_cmd_rsp) == 40);

/**
 * struct utp_upiu_rsp - general upiu response structure
 * @header: UPIU header structure DW-0 to DW-2
 * @sr: fields structure for scsi command DW-3 to DW-12
 * @qr: fields structure for query request DW-3 to DW-7
 */
struct utp_upiu_rsp {
	struct utp_upiu_header header;
	union {
		struct utp_cmd_rsp sr;
		struct utp_upiu_query qr;
	};
};

/*
 * VCCQ & VCCQ2 current requirement when UFS device is in sleep state
 * and link is in Hibern8 state.
 */
#define UFS_VREG_LPM_LOAD_UA	1000 /* uA */

struct ufs_vreg {
	struct regulator *reg;
	const char *name;
	bool always_on;
	bool enabled;
	int max_uA;
};

struct ufs_vreg_info {
	struct ufs_vreg *vcc;
	struct ufs_vreg *vccq;
	struct ufs_vreg *vccq2;
	struct ufs_vreg *vdd_hba;
};

/* UFS device descriptor wPeriodicRTCUpdate bit9 defines RTC time baseline */
#define UFS_RTC_TIME_BASELINE BIT(9)

enum ufs_rtc_time {
	UFS_RTC_RELATIVE,
	UFS_RTC_ABSOLUTE
};

struct ufs_dev_info {
	bool	f_power_on_wp_en;
	/* Keeps information if any of the LU is power on write protected */
	bool	is_lu_power_on_wp;
	/* Maximum number of general LU supported by the UFS device */
	u8	max_lu_supported;
	u16	wmanufacturerid;
	/*UFS device Product Name */
	u8	*model;
	u16	wspecversion;
	u32	clk_gating_wait_us;
	/* Stores the depth of queue in UFS device */
	u8	bqueuedepth;

	/* UFS WB related flags */
	bool    wb_enabled;
	bool    wb_buf_flush_enabled;
	u8	wb_dedicated_lu;
	u8      wb_buffer_type;
	u16	ext_wb_sup;

	bool	b_rpm_dev_flush_capable;
	u8	b_presrv_uspc_en;

	bool    b_advanced_rpmb_en;

	/* UFS RTC */
	enum ufs_rtc_time rtc_type;
	time64_t rtc_time_baseline;
	u32 rtc_update_period;

	u8 rtt_cap; /* bDeviceRTTCap */

	bool hid_sup;

	/* Unique device ID string (manufacturer+model+serial+version+date) */
	char *device_id;
	u8 rpmb_io_size;

Annotation

Implementation Notes