SSAM_DEFINE_...EQUEST_CL_WR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… SSAM_DEFINE_SYNC_REQUEST_CL_WR β€” okay bestie, listen

This is a kernel API manual page for SSAM_DEFINE_SYNC_REQUEST_CL_WR(9), and honestly? It's giving macro magic. Let's get into it ✨


🌸 NAME 🌸

SSAM_DEFINE_SYNC_REQUEST_CL_WR β€” defines a synchronous client-device SAM request function that takes an argument and hands you back a return value. Both. At once. Iconic behavior fr fr.


πŸŽ€ SYNOPSIS πŸŽ€

SSAM_DEFINE_SYNC_REQUEST_CL_WR (name , atype , rtype , spec... );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • name β€” the name you're giving to the generated function. Your baby, your naming rights πŸ’–
  • atype β€” the type of the request's argument. What you're feeding in.
  • rtype β€” the type of the request's return value. What you're getting back 🫢
  • spec β€” the spec, aka a struct ssam_request_spec_md, that defines the request. This is the blueprint, the whole plan.

✨ DESCRIPTION ✨

So what this macro does is: it defines a function that executes the synchronous SAM request described by spec. The request takes an argument of type atype and has a return value of type rtype. Both, together, one function. Slay.

Here's the cute part β€” the device-specifying parameters are not hard-coded. Instead they're provided via the client device, specifically its UID, which you supply when you call the function. No cap, that's the whole vibe.

The generated function handles all the tedious stuff for you:

  • setting up the request struct
  • buffer allocation
  • execution of the request itself

…and it returns once the request has been fully completed. And the required transport buffer? Allocated on the stack. Lowkey efficient 🧚

The generated function is defined exactly like this:

static int name(struct ssam_device *sdev, const atype *arg, rtype *ret)

It returns the status of the request β€” zero on success, negative on failure. Bet.

Now let's break down those params, because they matter:

  • sdev specifies both the target device of the request and, by association, the controller via which the request is sent. Two jobs, one pointer, main character energy πŸ‘‘
  • arg β€” the request's argument goes here, via the arg pointer.
  • ret β€” the request's return value gets written to the memory pointed to by the ret parameter.
Wanna know more about how the generated function actually behaves? Go read ssam_request_do_sync_onstack. It's got the lore πŸ“–

🌈 SEE ALSO 🌈

Kernel file ./include/linux/surface_aggregator/device.h, plus this whole friend group:


That's the whole page, bestie β€” go forth and define your synchronous client-device SAM request functions πŸ’…

This one's from the kernel file ./include/linux/surface_aggreg..., dated October 2026. Mwah, take care, iykyk πŸ“

πŸ“¦ where this page comes from