STRUCT UFS_HBA_VARIANT_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ 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 in init.
  • get_ufs_hci_version β€” called to get the UFS HCI version.
  • set_dma_mask β€” for setting another DMA mask than the 64AS capability 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 around hibern8 enter/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