SSAM_DEFINE_SYNC_REQUEST_R(9)
π« 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
ctrlparameter 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
retparameter (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:
enum ssam_event_flags(9)struct ssam_event(9)enum ssam_request_flags(9)struct ssam_request(9)struct ssam_response(9)struct ssam_request_sync(9)ssam_request_sync_set_data(9)ssam_request_sync_set_resp(9)ssam_request_sync_wait(9)ssam_request_do_sync_onstack(9)__ssam_retry(9)ssam_retry(9)struct ssam_request_spec(9)struct ssam_request_spec_md(9)SSAM_DEFINE_SYNC_REQUEST_N(9)SSAM_DEFINE_SYNC_REQUEST_W(9)SSAM_DEFINE_SYNC_REQUEST_WR(9)SSAM_DEFINE_SYNC_REQUEST_MD_N(9)SSAM_DEFINE_SYNC_REQUEST_MD_W(9)SSAM_DEFINE_SYNC_REQUEST_MD_R(9)SSAM_DEFINE_SYNC_REQUEST_MD_WR(9)enum ssam_notif_flags(9)struct ssam_notifier_block(9)ssam_notifier_from_errno(9)ssam_notifier_to_errno(9)struct ssam_event_registry(9)struct ssam_event_id(9)enum ssam_event_mask(9)SSAM_EVENT_REGISTRY(9)enum ssam_event_notifier_flags(9)struct ssam_event_notifier(9)ssam_notifier_unregister(9)
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
- 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