STRUCT UFS_HBA_VARIANT_OPS(9)
π¦ bestie's guide to struct ufs_hba_variant_ops(9) (Kernel API Manual) π¦
β¨ NAME β¨
struct ufs_hba_variant_ops β variant specific callbacks. that's the whole vibe, no cap.
πΈ SYNOPSIS πΈ
okay so here's the struct exactly as it appears β every callback, every signature, not a single crumb missing:
struct ufs_hba_variant_ops {
const char *name;
int (*init)(struct ufs_hba *);
void (*exit)(struct ufs_hba *);
u32 (*get_ufs_hci_version)(struct ufs_hba *);
int (*set_dma_mask)(struct ufs_hba *);
int (*clk_scale_notify)(struct ufs_hba *, bool, unsigned long, enum
ufs_notify_change_status);
int (*setup_clocks)(struct ufs_hba *, bool, enum
ufs_notify_change_status);
int (*hce_enable_notify)(struct ufs_hba *, enum
ufs_notify_change_status);
int (*link_startup_notify)(struct ufs_hba *, enum
ufs_notify_change_status);
int (*negotiate_pwr_mode)(struct ufs_hba *hba, const struct
ufs_pa_layer_attr *desired_pwr_mode, struct ufs_pa_layer_attr
*final_params);
int (*pwr_change_notify)(struct ufs_hba *hba, enum
ufs_notify_change_status status, struct ufs_pa_layer_attr
*final_params);
void (*setup_xfer_req)(struct ufs_hba *hba, int tag, bool
is_scsi_cmd);
void (*setup_task_mgmt)(struct ufs_hba *, int, u8);
void (*hibern8_notify)(struct ufs_hba *, enum uic_cmd_dme, enum
ufs_notify_change_status);
int (*apply_dev_quirks)(struct ufs_hba *hba);
void (*fixup_dev_quirks)(struct ufs_hba *hba);
int (*suspend)(struct ufs_hba *, enum ufs_pm_op, enum
ufs_notify_change_status);
int (*resume)(struct ufs_hba *, enum ufs_pm_op);
void (*dbg_register_dump)(struct ufs_hba *hba);
int (*phy_initialization)(struct ufs_hba *);
int (*device_reset)(struct ufs_hba *hba);
void (*config_scaling_param)(struct ufs_hba *hba, struct
devfreq_dev_profile *profile, struct devfreq_simple_ondemand_data
*data);
int (*fill_crypto_prdt)(struct ufs_hba *hba, const struct
bio_crypt_ctx *crypt_ctx, void *prdt, unsigned int num_segments);
void (*event_notify)(struct ufs_hba *hba, enum ufs_event_type evt,
void *data);
int (*mcq_config_resource)(struct ufs_hba *hba);
int (*get_hba_mac)(struct ufs_hba *hba);
int (*op_runtime_config)(struct ufs_hba *hba);
int (*get_outstanding_cqs)(struct ufs_hba *hba, unsigned long
*ocqs);
int (*config_esi)(struct ufs_hba *hba);
void (*config_scsi_dev)(struct scsi_device *sdev);
u32 (*freq_to_gear_speed)(struct ufs_hba *hba, unsigned long freq);
int (*get_rx_fom)(struct ufs_hba *hba, struct ufs_pa_layer_attr
*pwr_mode, struct tx_eqtr_iter *h_iter, struct tx_eqtr_iter *d_iter);
int (*apply_tx_eqtr_settings)(struct ufs_hba *hba, struct
ufs_pa_layer_attr *pwr_mode, struct tx_eqtr_iter *h_iter, struct
tx_eqtr_iter *d_iter);
int (*tx_eqtr_notify)(struct ufs_hba *hba, enum
ufs_notify_change_status status, struct ufs_pa_layer_attr *pwr_mode);
int (*get_hba_nortt)(struct ufs_hba *hba);
};
π Members π
member-by-member, bestie β every single callback gets its little moment:
nameβ the variant name. periodt.initβ called when the driver is initialized.exitβ called to clean up everything done ininit.get_ufs_hci_versionβ called to get the UFS HCI version.set_dma_maskβ for setting another DMA mask than the64AScapability bit indicates.clk_scale_notifyβ notifies that clks are scaled up/down.setup_clocksβ called before touching any of the controller registers. very important, don't skip.hce_enable_notifyβ called before and after the HCE enable bit is set, so variant specific Uni-Pro initialization can happen.link_startup_notifyβ called before and after Link startup is carried out, so variant specific Uni-Pro initialization can happen.negotiate_pwr_modeβ called to negotiate power mode.pwr_change_notifyβ called before and after a power mode change is carried out, so vendor specific capabilities can be set.setup_xfer_reqβ called before any transfer request is issued to set some things.setup_task_mgmtβ called before any task management request is issued to set some things.hibern8_notifyβ called aroundhibern8enter/exit.apply_dev_quirksβ called to apply device specific quirks.fixup_dev_quirksβ called to modify device specific quirks.suspendβ called during host controller PM callback.resumeβ called during host controller PM callback.dbg_register_dumpβ used to dump controller debug information.phy_initializationβ used to initialize phys.device_resetβ called to issue a reset pulse on the UFS device.config_scaling_paramβ called to configure clock scaling parameters.fill_crypto_prdtβ initialize crypto-related fields in the PRDT.event_notifyβ called to notify important events.mcq_config_resourceβ called to configure MCQ platform resources.get_hba_macβ reports maximum number of outstanding commands supported by the controller. Should be implemented for UFSHCI 4.0 or later controllers that are not compliant with the UFSHCI 4.0 specification. iykyk, that's a real spec note.op_runtime_configβ called to config Operation and runtime regs Pointers.get_outstanding_cqsβ called to get outstanding completion queues.config_esiβ called to config Event Specific Interrupt.config_scsi_devβ called to configure SCSI device parameters.freq_to_gear_speedβ called to map clock frequency to the max supported gear speed.get_rx_fomβ called to get Figure of Merit (FOM) value.apply_tx_eqtr_settingsβ called to apply settings for TX Equalization Training settings.tx_eqtr_notifyβ called before and after TX Equalization Training procedure, so platform vendor specific configs can take place.get_hba_norttβ called to get maximum number of outstanding RTTs supported by the controller.
π¦ SEE ALSO π¦
go read these too, bestie:
Kernel file ./include/ufs/ufshcd.h, plus the whole crew:
struct uic_command(9)struct ufshcd_lrb(9)struct ufs_query_req(9)struct ufs_query_res(9)struct ufs_query(9)struct ufs_dev_cmd(9)struct ufs_clk_info(9)struct tx_eqtr_iter(9)struct ufshcd_tx_eq_settings(9)struct ufshcd_tx_eqtr_data(9)struct ufshcd_tx_eqtr_record(9)struct ufshcd_tx_eq_params(9)struct ufs_clk_gating(9)struct ufs_clk_scaling(9)struct ufs_event_hist(9)struct ufs_stats(9)enum ufshcd_state(9)enum ufshcd_pmc_policy(9)struct ufshcd_mcq_opr_info_t(9)struct ufs_hba(9)struct ufs_hw_queue(9)ufshcd_rmwl(9)ufshcd_set_variant(9)ufshcd_get_variant(9)
π cute sign-off π this page's footer lives at ./include/ufs, and the date on it is October 2026. mwah π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms