ssam_request_sync_alloc(9)
π 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
-ENOMEMif the request could not be allocated π (time to free some stuff, or check theflags)
π 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:
ssh_seq_reset(9)ssh_seq_next(9)ssh_rqid_reset(9)ssh_rqid_next(9)ssam_event_matches_notifier(9)ssam_nfblk_call_chain(9)ssam_nfblk_insert(9)ssam_nfblk_find(9)ssam_nfblk_remove(9)ssam_nf_head_init(9)ssam_nf_head_destroy(9)struct ssam_nf_refcount_key(9)struct ssam_nf_refcount_entry(9)ssam_nf_refcount_inc(9)ssam_nf_refcount_dec(9)ssam_nf_refcount_dec_free(9)ssam_nf_refcount_empty(9)ssam_nf_call(9)ssam_nf_init(9)ssam_nf_destroy(9)ssam_event_item_cache_init(9)ssam_event_item_cache_destroy(9)ssam_event_item_free(9)ssam_event_item_alloc(9)ssam_event_queue_push(9)ssam_event_queue_pop(9)ssam_event_queue_is_empty(9)ssam_cplt_get_event_queue(9)ssam_cplt_submit(9)ssam_cplt_submit_event(9)ssam_cplt_flush(9)ssam_event_queue_init(9)ssam_cplt_init(9)ssam_cplt_destroy(9)ssam_controller_device(9)ssam_controller_get(9)ssam_controller_put(9)ssam_controller_statelock(9)ssam_controller_stateunlock(9)ssam_controller_lock(9)ssam_controller_caps_load_from_acpi(9)ssam_controller_caps_load_from_of(9)ssam_controller_caps_load(9)ssam_controller_init(9)ssam_controller_start(9)ssam_controller_shutdown(9)ssam_controller_destroy(9)ssam_controller_suspend(9)ssam_controller_resume(9)ssam_request_write_data(9)ssam_request_sync_free(9)ssam_request_sync_init(9)ssam_request_sync_submit(9)ssam_request_do_sync(9)ssam_request_do_sync_with_buffer(9)struct ssh_notification_params(9)ssam_ssh_event_enable(9)ssam_ssh_event_disable(9)ssam_get_firmware_version(9)ssam_ctrl_notif_display_off(9)ssam_ctrl_notif_display_on(9)ssam_ctrl_notif_d0_exit(9)ssam_ctrl_notif_d0_entry(9)ssam_nf_refcount_enable(9)ssam_nf_refcount_disable_free(9)ssam_notifier_register(9)__ssam_notifier_unregister(9)ssam_controller_event_enable(9)ssam_controller_event_disable(9)ssam_notifier_disable_registered(9)ssam_notifier_restore_registered(9)ssam_notifier_is_empty(9)ssam_notifier_unregister_all(9)ssam_irq_setup(9)ssam_irq_free(9)ssam_irq_arm_for_wakeup(9)ssam_irq_disarm_wakeup(9)
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
- 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