caam_drv_ctx_init(9)
π caam_drv_ctx_init(9) β the Kernel API Manual, bestie edition β¨
okay so you found your way into the CAAM/QI corner of the kernel, and honestly? iconic of you. this is caam_drv_ctx_init from the Kernel API Manual, and it's literally the lil function that makes your driver context exist. let's get into it π
β¨ NAME β¨
caam_drv_ctx_init β Initialise a CAAM/QI driver context π¦
πΈ SYNOPSIS πΈ
struct caam_drv_ctx * caam_drv_ctx_init (struct device *qidev , int *cpu
, u32 *sh_desc );
that's the whole shape of it, no cap. three args, one pointer back to a struct caam_drv_ctx π
π ARGUMENTS π
qidevβ honestly? undescribed π the original says-- undescribed --and we are not out here making things up, so that's the tea.cpuβ this is the CPU where the application prefers that the driver receive CAAM responses. the request completion callback would be issued from this CPU, so yeah, it matters.sh_descβ the shared descriptor pointer that gets attached to the CAAM/QI driver context. it's giving "your descriptor's plus-one" π«Ά
π DESCRIPTION π
so here's the vibe: a CAAM/QI driver context must be attached to each cryptographic context. not optional, not a suggestion, it's required, periodt.
this function allocates the memory for the CAAM/QI context and hands a handle back to the application. and that handle? you have to submit it along with each enqueue request to the driver from the application. every single one. no skipping π
on success you get a driver context back. on failure you get a negative error code β so like, check it, bestie π
π SEE ALSO π
- Kernel file
./drivers/crypto/caam/qi.h caam_qi_enqueue(9)caam_drv_ctx_busy(9)caam_drv_ctx_update(9)caam_drv_ctx_rel(9)qi_cache_alloc(9)qi_cache_free(9)
lowkey the whole friend group lives in ./drivers/crypto/caam/qi.h, so go say hi π
sign-off era π§: this page lives in the tree at ./drivers/crypto/caam, dated October 2026 β and it's caam_drv_ctx_init(9) all the way down, 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