include/ufs/ufshcd.h
Source file repositories/reference/linux-study-clean/include/ufs/ufshcd.h
File Facts
- System
- Linux kernel
- Corpus path
include/ufs/ufshcd.h- Extension
.h- Size
- 55833 bytes
- Lines
- 1661
- 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/bitfield.hlinux/blk-crypto-profile.hlinux/blk-mq.hlinux/devfreq.hlinux/fault-inject.hlinux/debugfs.hlinux/msi.hlinux/pm_runtime.hlinux/dma-direction.hscsi/scsi_device.hscsi/scsi_host.hufs/unipro.hufs/ufs.hufs/ufs_quirks.hufs/ufshci.h
Detected Declarations
struct scsi_devicestruct ufs_hbastruct uic_commandstruct ufs_pm_lvl_statesstruct ufshcd_lrbstruct ufs_query_reqstruct ufs_query_resstruct ufs_querystruct ufs_dev_cmdstruct ufs_clk_infostruct ufs_pa_layer_attrstruct ufs_pwr_mode_infostruct tx_eqtr_iterstruct ufshcd_tx_eq_settingsstruct ufshcd_tx_eqtr_datastruct ufshcd_tx_eqtr_recordstruct ufshcd_tx_eq_paramsstruct ufs_hba_variant_opsstruct ufs_clk_gatingstruct ufs_clk_scalingstruct ufs_event_histstruct ufs_statsstruct ufs_hba_variant_paramsstruct ufs_hba_monitorstruct ufshcd_mcq_opr_info_tstruct ufs_hbastruct ufs_hw_queueenum dev_cmd_typeenum ufs_event_typeenum ufs_pm_openum uic_link_stateenum ufs_pm_levelenum ufs_notify_change_statusenum clk_gating_stateenum ufshcd_stateenum ufshcd_pmc_policyenum ufshcd_quirksenum ufshcd_capsenum ufshcd_mcq_oprfunction ufshcd_mcq_opr_offsetfunction ufshcd_mcq_cfg_offsetfunction ufshcd_sg_entry_sizefunction ufshcd_set_sg_entry_sizefunction ufshcd_sg_entry_sizefunction ufs_hba_from_crypto_profilefunction ufshcd_get_ucd_sizefunction ufshcd_is_clkgating_allowedfunction ufshcd_can_hibern8_during_gating
Annotated Snippet
struct uic_command {
const u32 command;
const u32 argument1;
u32 argument2;
u32 argument3;
bool cmd_active;
struct completion done;
};
/* Used to differentiate the power management options */
enum ufs_pm_op {
UFS_RUNTIME_PM,
UFS_SYSTEM_PM,
UFS_SHUTDOWN_PM,
};
/* Host <-> Device UniPro Link state */
enum uic_link_state {
UIC_LINK_OFF_STATE = 0, /* Link powered down or disabled */
UIC_LINK_ACTIVE_STATE = 1, /* Link is in Fast/Slow/Sleep state */
UIC_LINK_HIBERN8_STATE = 2, /* Link is in Hibernate state */
UIC_LINK_BROKEN_STATE = 3, /* Link is in broken state */
};
#define ufshcd_is_link_off(hba) ((hba)->uic_link_state == UIC_LINK_OFF_STATE)
#define ufshcd_is_link_active(hba) ((hba)->uic_link_state == \
UIC_LINK_ACTIVE_STATE)
#define ufshcd_is_link_hibern8(hba) ((hba)->uic_link_state == \
UIC_LINK_HIBERN8_STATE)
#define ufshcd_is_link_broken(hba) ((hba)->uic_link_state == \
UIC_LINK_BROKEN_STATE)
#define ufshcd_set_link_off(hba) ((hba)->uic_link_state = UIC_LINK_OFF_STATE)
#define ufshcd_set_link_active(hba) ((hba)->uic_link_state = \
UIC_LINK_ACTIVE_STATE)
#define ufshcd_set_link_hibern8(hba) ((hba)->uic_link_state = \
UIC_LINK_HIBERN8_STATE)
#define ufshcd_set_link_broken(hba) ((hba)->uic_link_state = \
UIC_LINK_BROKEN_STATE)
#define ufshcd_set_ufs_dev_active(h) \
((h)->curr_dev_pwr_mode = UFS_ACTIVE_PWR_MODE)
#define ufshcd_set_ufs_dev_sleep(h) \
((h)->curr_dev_pwr_mode = UFS_SLEEP_PWR_MODE)
#define ufshcd_set_ufs_dev_poweroff(h) \
((h)->curr_dev_pwr_mode = UFS_POWERDOWN_PWR_MODE)
#define ufshcd_set_ufs_dev_deepsleep(h) \
((h)->curr_dev_pwr_mode = UFS_DEEPSLEEP_PWR_MODE)
#define ufshcd_is_ufs_dev_active(h) \
((h)->curr_dev_pwr_mode == UFS_ACTIVE_PWR_MODE)
#define ufshcd_is_ufs_dev_sleep(h) \
((h)->curr_dev_pwr_mode == UFS_SLEEP_PWR_MODE)
#define ufshcd_is_ufs_dev_poweroff(h) \
((h)->curr_dev_pwr_mode == UFS_POWERDOWN_PWR_MODE)
#define ufshcd_is_ufs_dev_deepsleep(h) \
((h)->curr_dev_pwr_mode == UFS_DEEPSLEEP_PWR_MODE)
/*
* UFS Power management levels.
* Each level is in increasing order of power savings, except DeepSleep
* which is lower than PowerDown with power on but not PowerDown with
* power off.
*/
enum ufs_pm_level {
UFS_PM_LVL_0,
UFS_PM_LVL_1,
UFS_PM_LVL_2,
UFS_PM_LVL_3,
UFS_PM_LVL_4,
UFS_PM_LVL_5,
UFS_PM_LVL_6,
UFS_PM_LVL_MAX
};
struct ufs_pm_lvl_states {
enum ufs_dev_pwr_mode dev_state;
enum uic_link_state link_state;
};
/**
* struct ufshcd_lrb - local reference block
* @utr_descriptor_ptr: UTRD address of the command
* @ucd_req_ptr: UCD address of the command
* @ucd_rsp_ptr: Response UPIU address for this command
* @ucd_prdt_ptr: PRDT address of the command
* @utrd_dma_addr: UTRD dma address for debug
* @ucd_prdt_dma_addr: PRDT dma address for debug
* @ucd_rsp_dma_addr: UPIU response dma address for debug
* @ucd_req_dma_addr: UPIU request dma address for debug
* @scsi_status: SCSI status of the command
* @command_type: SCSI, UFS, Query.
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/blk-crypto-profile.h`, `linux/blk-mq.h`, `linux/devfreq.h`, `linux/fault-inject.h`, `linux/debugfs.h`, `linux/msi.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct scsi_device`, `struct ufs_hba`, `struct uic_command`, `struct ufs_pm_lvl_states`, `struct ufshcd_lrb`, `struct ufs_query_req`, `struct ufs_query_res`, `struct ufs_query`, `struct ufs_dev_cmd`, `struct ufs_clk_info`.
- 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.