caam_drv_ctx_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 🌈


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