__fw_send_request(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’Œ __fw_send_request(9) β€” kernel API manual, bestie edition ✨

okay so this is a page from the Kernel API Manual, and it's about __fw_send_request β€” the function that submits a request packet for transmission so you get a callback for the response subaction, with or without a time stamp. yeah. we're doing firewire today, strap in πŸŽ€


✨ NAME ✨

__fw_send_request β€” submit a request packet for transmission to generate callback for response subaction with or without time stamp.


πŸ¦‹ SYNOPSIS πŸ¦‹

void __fw_send_request (struct fw_card *card , struct fw_transaction *t
, int tcode , int destination_id , int generation , int speed , unsigned
long long offset , void *payload , size_t length , union
fw_transaction_callback callback , bool with_tstamp , void
*callback_data );

like, yes, that's a lot of arguments. she's thriving though πŸ’…


🌸 ARGUMENTS 🌸

  • card β€” the interface to send the request at πŸ’–
  • t β€” the transaction instance this request belongs to
  • tcode β€” the transaction code
  • destination_id β€” destination node ID, which is made of bus_ID and phy_ID
  • generation β€” the bus generation in which the request and the response are valid
  • speed β€” transmission speed ⚑
  • offset β€” a 48bit wide offset into the destination's address space
  • payload β€” data payload for the request subaction
  • length β€” length of the payload, in bytes
  • callback β€” union of two functions, whether to receive time stamp or not for the response subaction
  • with_tstamp β€” whether to receive time stamp or not for the response subaction
  • callback_data β€” data to be passed to the transaction completion callback 🫢

πŸ’œ DESCRIPTION πŸ’œ

so what it actually does: it submits a request packet into the asynchronous request transmission queue. and yes, it can be called from atomic context β€” iconic. if you'd rather have a blocking API, use fw_run_transaction in a context that can sleep 😴

for lock requests, you specify one of the firewire-core specific TCODE_ constants instead of TCODE_LOCK_REQUEST in tcode. no cap, that's the move.

⚠️ make sure the value in destination_id is not older than the one in generation. otherwise your request is in danger of being sent to a wrong node. that's it's giving "wrong number, bestie" energy and we do not want that πŸ’€

for asynchronous stream packets, i.e. TCODE_STREAM_DATA, the caller needs to synthesize destination_id with fw_stream_packet_destination_id. in that case it will contain tag, channel, and sy data instead of a node ID. different vibe entirely ✨

the payload buffer at data is going to be DMA-mapped β€” except in the case of length <= 8 or of local (loopback) requests. so please make sure that buffer complies with the restrictions of the streaming DMA mapping API. and payload must not be freed before the callback is called. seriously. don't. 😭

for request types without a payload, data is NULL and length is 0. simple as that πŸ“

after the transaction is completed β€” successfully or unsuccessfully, either way β€” the callback will be called. among its parameters is the response code, which is either one of the rcodes per IEEE 1394, or, in case of internal errors, the firewire-core specific RCODE_SEND_ERROR. the other firewire-core specific rcodes β€” RCODE_CANCELLED, RCODE_BUSY, RCODE_GENERATION, RCODE_NO_ACK β€” denote transaction timeout, busy responder, stale request generation, or missing ACK respectively. iykyk πŸ”₯

πŸ’€ note some timing corner cases: fw_send_request may complete much earlier than when the request packet actually hits the wire. on the other hand, transaction completion and hence execution of callback may happen even before fw_send_request returns. yes, time is a social construct here. main character energy from a function that's already done before it started πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

go read them, they're all lowkey obsessed with this one πŸ‘‘


that's the whole page, bestie πŸ’– this came out of ./drivers/firewire and it's dated October 2026 β€” so like, keep it in your bookmarks and slay your firewire transactions responsibly. periodt. πŸŒˆπŸ¦‹πŸ’…

πŸ“¦ where this page comes from