STRUCT FW_CDEV_EVENT_REQUEST3(9)
π struct fw_cdev_event_request3(9) π
ok so this is from the Kernel API Manual, section 9 β and bestie, it's giving "incoming firewire request dropped into your lap and now you have to deal with it." Let's get into it β¨
π NAME π
struct fw_cdev_event_request3 β literally the event that gets sent when a request comes in to an address region. That's it. That's the whole vibe. π¦
β¨ SYNOPSIS β¨
struct fw_cdev_event_request3 {
__u64 closure;
__u32 type;
__u32 tcode;
__u64 offset;
__u32 source_node_id;
__u32 destination_node_id;
__u32 card;
__u32 generation;
__u32 handle;
__u32 length;
__u32 tstamp;
__u32 padding;
__u32 data[];
};
look at her. all those fields. main character struct fr fr π
πΈ Members πΈ
closureβ look atfw_cdev_event_commonfor the deets; this one gets set by theFW_CDEV_IOC_ALLOCATEioctl π«Άtypeβ also seefw_cdev_event_common; it is alwaysFW_CDEV_EVENT_REQUEST2(yes bestie, in request3. don't ask, it's iconic) πtcodeβ the transaction code of the request that just rolled in π«offsetβ where in the 48-bit per-node address space we're at, no cap πsource_node_idβ the sender's node ID, i.e. who sent it πdestination_node_idβ the destination node ID, i.e. who it's for π―cardβ the index of the card the request came from πgenerationβ the bus generation where this request is actually valid β³handleβ a reference to the kernel-side pending request. hold onto this one, you'll need it πlengthβ data length, meaning the request's payload size in bytes πtstampβ the time stamp of the isochronous cycle when the request arrived. clocked it β°paddingβ filler bytes keeping the struct size a multiple of 8 across architectures, because the System V ABI for i386 uses 4 byte alignment for 8 byte object types. it's giving "structural support" πdataβ the incoming data, if there is any π
π₯ Description π₯
okay so picture this: the stack gets an incoming request to an address region that was registered with the FW_CDEV_IOC_ALLOCATE ioctl, and this event is what gets sent. periodt. π
the request is guaranteed to be completely contained in the specified region β love that for you. your job, as userspace, is to send the response back via the FW_CDEV_IOC_SEND_RESPONSE ioctl, using the same handle. don't lose the handle, bestie π
for requests that carry data (write requests and lock requests), the payload data follows immediately and you can get at it through the data field. slay π¦
unlike fw_cdev_event_request, the tcode of lock requests is one of the firewire-core specific range TCODE_LOCK_MASK_SWAP...TCODE_LOCK_VENDOR_DEPENDENT β meaning it encodes the extended transaction code. iykyk π
card may differ from fw_cdev_get_info.card, and that's because requests get received from all the cards of the Linux host. source_node_id, destination_node_id, and generation all pertain to that card. so the destination node ID and the bus generation may differ from the corresponding fields of the last fw_cdev_event_bus_reset. it's not a glitch, it's a feature π
destination_node_id may also differ from the current node ID β either because of a non-local bus ID part, or in the case of a broadcast write request. side note bestie: a client must call an FW_CDEV_IOC_SEND_RESPONSE ioctl even in the case of a broadcast write request. the kernel will then release the kernel-side pending request but will not actually send a response packet. so likeβ¦ you still have to call it, it just doesn't do the reply part π
in the case of a write request to FCP_REQUEST or FCP_RESPONSE, the kernel already sent a write response immediately after the request was received. in this case the client must still call an FW_CDEV_IOC_SEND_RESPONSE ioctl to release the kernel-side pending request, though another response won't be sent. same energy: call it anyway, it's about the release not the reply π
β important bestie: if the client subsequently needs to initiate requests to the sender node of anfw_cdev_event_request3, it needs to use a device file with a matchingcardindex, node ID, andgenerationfor outbound requests. match the vibes or it won't work π«Ά
tstamp is the isochronous cycle at which the request arrived. it's a 16 bit integer value β the higher 3 bits express three low order bits of the second field in the format of the CYCLE_TIME register, and the rest of the 13 bits express the cycle field. math but make it cute β¨
β SEE ALSO β
Kernel file ./include/uapi/linux/firewire-cdev.h, plus the whole squad:
struct fw_cdev_event_common(9)struct fw_cdev_event_bus_reset(9)struct fw_cdev_event_response(9)struct fw_cdev_event_response2(9)struct fw_cdev_event_request(9)struct fw_cdev_event_request2(9)struct fw_cdev_event_iso_interrupt(9)struct fw_cdev_event_iso_interrupt_mc(9)struct fw_cdev_event_iso_resource(9)struct fw_cdev_event_phy_packet(9)struct fw_cdev_event_phy_packet2(9)union fw_cdev_event(9)struct fw_cdev_get_info(9)struct fw_cdev_send_request(9)struct fw_cdev_send_response(9)struct fw_cdev_allocate(9)struct fw_cdev_deallocate(9)struct fw_cdev_initiate_bus_reset(9)struct fw_cdev_add_descriptor(9)struct fw_cdev_remove_descriptor(9)struct fw_cdev_create_iso_context(9)struct fw_cdev_set_iso_channels(9)struct fw_cdev_iso_packet(9)struct fw_cdev_queue_iso(9)struct fw_cdev_start_iso(9)struct fw_cdev_stop_iso(9)struct fw_cdev_flush_iso(9)struct fw_cdev_get_cycle_timer(9)struct fw_cdev_get_cycle_timer2(9)struct fw_cdev_allocate_iso_resource(9)struct fw_cdev_send_stream_packet(9)struct fw_cdev_send_phy_packet(9)struct fw_cdev_receive_phy_packets(9)
and that's the whole page bestie π this one lives in ./include/uapi/linux and it's dated October 2026 β so like, future icon behavior π mwah, go release those pending requests, ily π«Άπ
π¦ 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