SSAM_DEFINE...REQUEST_MD_N(9)
π SSAM_DEFINE...REQUEST_MD_N(9) β Kernel API Manual β¨
okay so bestie, welcome to the SSAM_DEFINE...REQUEST_MD_N(9) page from the Kernel API Manual β this one's a macro that literally builds functions for you and ngl it's kind of iconic π
πΈ NAME πΈ
SSAM_DEFINE_SYNC_REQUEST_MD_N β Define synchronous multi-device SAM request function with neither argument nor return value. Yes, neither. She takes nothing, she returns nothing, she's just vibing π
β¨ SYNOPSIS β¨
SSAM_DEFINE_SYNC_REQUEST_MD_N (name , spec... );
π¦ ARGUMENTS π¦
nameβ Name of the generated function. you're naming your child here, choose wisely π«Άspecβ Specification (struct ssam_request_spec_md) defining the request. this is the blueprint, the vision board, the whole plan π
π DESCRIPTION π
So what does this macro do, you ask? It defines a function executing the synchronous SAM request specified by spec, with the request having neither argument nor return value. no args, no return, no notes, periodt π
The device specifying parameters are not hard-coded β instead they must be provided to the function. so like, you don't bake them in, you pass them through. flexible queen behavior π
The generated function takes care of setting up the request struct, buffer allocation, as well as execution of the request itself, returning once the request has been fully completed. she does it all, honestly. main character energy π₯
The required transport buffer will be allocated on the stack. lowkey important detail, don't forget it π
The generated function is defined as:
static int name(struct ssam_controller *ctrl, u8 tid, u8 iid)
returning the status of the request, which is zero on success and negative on failure β¨ breaking it down for you:
- the
ctrlparameter is the controller via which the request is sent π tidis the target ID for the request π―iidis the instance ID π·οΈ
if you want the full tea on how the generated function actually behaves, refer to ssam_request_do_sync_onstack β she's the source of truth, iykyk π
π₯ SEE ALSO π₯
Kernel file ./include/linux/surface_aggregator/controller.h and honestly, 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_R(9)SSAM_DEFINE_SYNC_REQUEST_WR(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 π«Ά this one came from ./include/linux/surface_aggreg... and it's dated October 2026, so mark your calendars β¨ stay hydrated, go read ssam_request_do_sync_onstack(9), and slay your kernel dev journey π
π¦ 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