ssam_request_sync_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ssam_request_sync_alloc(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so picture this: you're deep in the kernel, you need a synchronous request, and you need somebody to set one up for you. That somebody is ssam_request_sync_alloc. She's a helper, she's a giver, she allocates. Let's get into it ✨


🌸 SYNOPSIS 🌸

int ssam_request_sync_alloc(size_t payload_len, gfp_t flags,
                            struct ssam_request_sync **rqst,
                            struct ssam_span *buffer);

🫢 ARGUMENTS 🫢

  • payload_len β€” the length of the request payload. How much room the payload needs, that's her whole thing.
  • flags β€” the flags used for allocation. Like, the allocation vibes. gfp_t, you know how it is.
  • rqst β€” where to store the pointer to the allocated request. That's the out-param she hands you back, main character energy.
  • buffer β€” where to store the buffer descriptor for the message buffer of the request. Yes, a descriptor for the buffer. She's thorough πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

So what she actually does: allocates a synchronous request with its corresponding message buffer. Both. Package deal, no cap πŸ’–

But β€” and this is the important part, don't skip it β€” the request is not ready to go yet. It still needs to be initialized with ssam_request_sync_init before it can be submitted. And the message buffer data must still be set to the returned buffer via ssam_request_sync_set_data after it has been filled β€” if need be, with an adjusted message length. Like, fill it up first, then point the buffer at it. Order matters, bestie 😭

After use, the request and its corresponding message buffer should be freed via ssam_request_sync_free.

🚨 IMPORTANT: the buffer must not be freed separately. Not even a little. Not even if you're feeling independent. ssam_request_sync_free handles both, and freelancing the buffer is how you get double-frees. periodt πŸ’€

⭐ RETURN ⭐

  • Returns zero on success πŸŽ‰
  • Returns -ENOMEM if the request could not be allocated πŸ˜” (time to free some stuff, or check the flags)

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/platform/surface/aggregator/controller.c β€” go read it, iykyk πŸ“–

And here's the whole extended fam, all up in your business:


and that's the whole page, bestie πŸ§šπŸ’œ this one's from the Kernel API Manual, sourced from ./drivers/platform/surface/agg..., dated October 2026 β€” go forth and ssam_request_sync_alloc responsibly, and remember: free the pair together, never separate πŸ“

πŸ“¦ where this page comes from