__fw_send_request(9)
π __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 totcodeβ the transaction codedestination_idβ destination node ID, which is made ofbus_IDandphy_IDgenerationβ the bus generation in which the request and the response are validspeedβ transmission speed β‘offsetβ a 48bit wide offset into the destination's address spacepayloadβ data payload for the request subactionlengthβ length of the payload, in bytescallbackβ union of two functions, whether to receive time stamp or not for the response subactionwith_tstampβ whether to receive time stamp or not for the response subactioncallback_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 indestination_idis not older than the one ingeneration. 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_requestmay complete much earlier than when the request packet actually hits the wire. on the other hand, transaction completion and hence execution ofcallbackmay happen even beforefw_send_requestreturns. yes, time is a social construct here. main character energy from a function that's already done before it started π
π₯ SEE ALSO π₯
- Kernel file
./drivers/firewire/core-transaction.c fw_run_transaction(9)fw_core_add_address_handler(9)fw_core_remove_address_handler(9)fw_send_response(9)fw_get_request_speed(9)fw_request_get_timestamp(9)fw_rcode_string(9)
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
- 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