spu_aead_rx_sg_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« spu_aead_rx_sg_create β€” the Kernel API Manual moment ✨

okay so bestie, we're in the Kernel API Manual (spu_aead_rx_sg_create(9), section 9, kernel-space teas) and this function is literally the person who builds the scatterlist of buffers used to receive a SPU response message for an AEAD request πŸŽ€ and yes, it also includes buffers to catch SPU message headers and the response data. iykyk πŸ’…


🌸 NAME 🌸

spu_aead_rx_sg_create β€” build up the scatterlist of buffers used to receive a SPU response message for an AEAD request πŸ’– includes buffers to catch SPU message headers and the response data, no cap.


✨ SYNOPSIS ✨

int spu_aead_rx_sg_create (struct brcm_message *mssg , struct
       aead_request *req , struct iproc_reqctx_s *rctx , u8 rx_frag_num ,
       unsigned int assoc_len , u32 ret_iv_len , unsigned int resp_len ,
       unsigned int digestsize , u32 stat_pad_len );

like, that's nine whole arguments bestie, she's highkey doing the most and we love her for it 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mssg β€” the mailbox message containing the receive sg πŸ“¬ that's her whole ride.
  • req β€” the Crypto API request, main character energy fr.
  • rctx β€” the crypto request context, the little sidekick carrying the details.
  • rx_frag_num β€” number of scatterlist elements required to hold the SPU response message. count 'em, bestie.
  • assoc_len β€” length of associated data included in the crypto request.
  • ret_iv_len β€” length of IV returned in response πŸŽ€
  • resp_len β€” number of bytes of response data expected to be written to dst buffer from crypto API.
  • digestsize β€” length of hash digest, in bytes ⭐
  • stat_pad_len β€” number of bytes required to pad the STAT field to a 4-byte boundary. yes she's padding, she's aligned, she's iconic πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

so the scatterlist that gets allocated here is freed in spu_chunk_cleanup when the request completes β€” and it happens whether the request is handled successfully or there is an error 😭 so no leaks, she cleans up after herself either way. periodt.


πŸ”₯ RETURN πŸ”₯

0 if successful, < 0 if an error. that's it, that's the vibe check 🌈


🌼 SEE ALSO 🌼

kernel file ./drivers/crypto/bcm/cipher.c and the whole friend group:


bestie reminder: that scatterlist is freed in spu_chunk_cleanup on completion, success or error πŸ’€ don't go holding onto it.

and that's the page! 🧚 from ./drivers/crypto/bcm, dated October 2026 β€” stay hydrated, keep your buffers aligned, and slay πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from