STRUCT UFSHCD_LRB(9)
π struct ufshcd_lrb(9) β the local reference block, bestie
okay so like, this is from the Kernel API Manual, and it's literally the glow-up guide to struct ufshcd_lrb. no cap, this is the main character of UFS command tracking π
πΈ NAME πΈ
struct ufshcd_lrb β local reference block. that's it. that's the vibe. it's the little block that holds all the deets for one command. iconic behavior honestly π
β¨ SYNOPSIS β¨
struct ufshcd_lrb {
struct utp_transfer_req_desc *utr_descriptor_ptr;
struct utp_upiu_req *ucd_req_ptr;
struct utp_upiu_rsp *ucd_rsp_ptr;
struct ufshcd_sg_entry *ucd_prdt_ptr;
dma_addr_t utrd_dma_addr;
dma_addr_t ucd_req_dma_addr;
dma_addr_t ucd_rsp_dma_addr;
dma_addr_t ucd_prdt_dma_addr;
int scsi_status;
int command_type;
u8 lun;
bool intr_cmd;
bool req_abort_skip;
ktime_t issue_time_stamp;
u64 issue_time_stamp_local_clock;
ktime_t compl_time_stamp;
u64 compl_time_stamp_local_clock;
#ifdef CONFIG_SCSI_UFS_CRYPTO;
int crypto_key_slot;
u64 data_unit_num;
#endif;
};
look at all those fields, bestie. it's giving organized. it's giving prepared. it's giving everything u need in one place π¦
π§ Members π§
the pointers (the real ones)
utr_descriptor_ptrβ the UTRD address of the command. like, where the whole thing lives in memory, yk?ucd_req_ptrβ the UCD address of the command π«Άucd_rsp_ptrβ the Response UPIU address for this command. the reply guy, basically.ucd_prdt_ptrβ the PRDT address of the command. slay.
the dma addresses (for debug, lowkey important)
utrd_dma_addrβ UTRD dma address for debug. yes, for debug. πucd_req_dma_addrβ UPIU request dma address for debug π₯ucd_rsp_dma_addrβ UPIU response dma address for debug πucd_prdt_dma_addrβ PRDT dma address for debug. we love a debug trail, fr fr.
the status + type girlies
scsi_statusβ SCSI status of the command. how did it go? this knows.command_typeβ literally says "SCSI, UFS, Query." pick a lane, babe π
the identifiers
lunβ LUN of the command. the whole logical unit number, not a vibe check.
the booleans (yes/no energy)
intr_cmdβ Interrupt command. and here's the tea: it doesn't participate in interrupt aggregation. not invited to the party, periodt πreq_abort_skipβ skip request abort task flag. it's a flag, bestie, it does what it says on the tin.
the timestamps (for the girlies who love data)
issue_time_stampβ time stamp for debug purposes (CLOCK_MONOTONIC) β±οΈissue_time_stamp_local_clockβ time stamp for debug purposes (local_clock). different clock, same debug energy.compl_time_stampβ time stamp for statistics (CLOCK_MONOTONIC). this one's for the numbers, the stats, the math β¨compl_time_stamp_local_clockβ time stamp for debug purposes (local_clock). yes another one. we love thorough documentation.
the crypto section (conditional! very exclusive)
only here if CONFIG_SCSI_UFS_CRYPTO is defined, so it's giving VIP section π§ββοΈ
crypto_key_slotβ the key slot to use for inline crypto (-1if none). so if it's-1, no key, no crypto, no tea.data_unit_numβ the data unit number for the first block for inline crypto. the first block! the opener! the main character of the data unit.
π SEE ALSO π
like, go read the Kernel file ./include/ufs/ufshcd.h first, and then these icons:
struct uic_command(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_hba_variant_ops(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)
that's the whole friend group right there. no skips. π
okay and finally, the sign-off bestie: this page is from ./include/ufs and it says October 2026 on the cover. so like, it's literally from the future or whatever. periodt. π
β¨
current mood: struct ufshcd_lrb is the blueprint, and everyone else is just living in it.
π¦ 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