SSAM_DEFINE_SYNC_REQUEST_R(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« SSAM_DEFINE_SYNC_REQUEST_R πŸ’«

okay bestie, this is a page from the Kernel API Manual (kernel macro era, we love to see it) and it's literally about defining a synchronous SAM request function that hands you a return value. she's giving "make the compiler write the boring part for you" and honestly? iconic. ✨


πŸŽ€ NAME πŸŽ€

SSAM_DEFINE_SYNC_REQUEST_R β€” the macro that defines a synchronous SAM request function with a return value. no cap, that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

SSAM_DEFINE_SYNC_REQUEST_R (name , rtype , spec... );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • name β€” the name your shiny new generated function gets. main character naming rights fr fr. πŸ‘‘
  • rtype β€” the type of the request's return value. like, what are we getting back here bestie.
  • spec β€” the specification (struct ssam_request_spec) that actually defines the request. the blueprint, the whole plan. πŸ“‹

πŸ’– DESCRIPTION πŸ’–

so what this does: it defines a function that executes the synchronous SAM request specified by spec. the request takes no argument, but it does have a return value of type rtype. so it's the "no thoughts, just results" one of the family. πŸ™ˆ

the generated function handles literally all the setup for you β€” setting up the request and response structs, buffer allocation, and then actually executing the request itself. it returns once the request has been fully completed, so no sneaky async nonsense, she waits. the required transport buffer gets allocated on the stack. ✨

here's the generated function's shape, exactly:

static int name(struct ssam_controller *ctrl, rtype *ret)

it returns the status of the request β€” zero on success and negative on failure. πŸ™

  • the ctrl parameter is the controller via which the request is sent (the transport bestie πŸš€)
  • the request's return value gets written to the memory pointed to by the ret parameter (that's your little output slot 🫢)

if you want the full tea on how the generated function behaves, go read ssam_request_do_sync_onstack. she's the source of truth. ⭐


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/linux/surface_aggregator/controller.h, plus the whole friend group:


and that's the whole page, bestie, love that for us πŸ’œ

sign-off time: this little number lives at source ./include/linux/surface_aggreg..., dated October 2026, and yes, the whole thing is filed under SSAM_DEFINE_SYNC_REQUEST_R(9) πŸ“πŸ§š go forth and define your requests. periodt. πŸ’…

πŸ“¦ where this page comes from