ssam_request_write_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ssam_request_write_data(9) ✨

okay bestie, welcome to the Kernel API Manual page for ssam_request_write_data β€” the function that constructs and writes a SAM request message to a buffer. No cap, it's giving β€œbuild the packet, then yeet it into the buffer” energy. 🫢


πŸŽ€ NAME πŸŽ€

ssam_request_write_data β€” construct and write SAM request message to buffer.

✨ SYNOPSIS ✨

ssize_t ssam_request_write_data (struct ssam_span *buf , struct ssam_controller *ctrl , const struct ssam_request *spec );

🌸 ARGUMENTS 🌸

here are the three besties this function takes:

  • buf β€” the buffer where the data is written. πŸ’–
  • ctrl β€” the controller through which the request will be sent. πŸ¦‹
  • spec β€” the request data and specification. πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what's the actual tea? This constructs a SAM/SSH request message and writes it to the provided buffer. 🫢

The request and transport counters β€” specifically RQID and SEQ β€” will be set in this call. These counters are obtained from the controller. So bestie, it is thus only valid to send the resulting message via the controller specified here. 🚨

For calculation of the required buffer size, refer to the SSH_COMMAND_MESSAGE_LENGTH macro. iykyk. ✨

πŸ”₯ RETURN πŸ”₯

On success, it slays and returns the number of bytes used in the buffer. It returns -EINVAL if the payload length provided in the request specification is too large (larger than SSH_COMMAND_MAX_PAYLOAD_SIZE) or if the provided buffer is too small. That's the vibe check fail, bestie. πŸ’€

🌈 SEE ALSO 🌈

Kernel file: ./drivers/platform/surface/aggregator/controller.c

and the whole friend group: 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_sync_alloc(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)


okay that's the whole page, bestie β€” source/version: ./drivers/platform/surface/agg..., date: October 2026 πŸŽ€πŸ’–

πŸ“¦ where this page comes from