STRUCT FW_CDEV_CREATE_ISO_CONTEXT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct fw_cdev_create_iso_context πŸŽ€

okay bestie, welcome to the Kernel API Manual β€” this is the struct fw_cdev_create_iso_context(9) page and honestly? it's giving "let me introduce you to your new isochronous bestie." periodt. πŸ’…


✨ NAME ✨

struct fw_cdev_create_iso_context β€” literally the struct that creates a context for isochronous I/O. no cap, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

struct fw_cdev_create_iso_context {
    __u32 type;
    __u32 header_size;
    __u32 channel;
    __u32 speed;
    __u64 closure;
    __u32 handle;
 };

look at her. six fields. main character energy. πŸ‘‘


πŸ’– Members πŸ’– (yes, capital M, we're being fancy)

  • type β€” pick your fighter: FW_CDEV_ISO_CONTEXT_TRANSMIT or FW_CDEV_ISO_CONTEXT_RECEIVE or FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL. choose wisely 🫢
  • header_size β€” the header size to strip when you're doing single-channel reception. it's the little detail that matters.
  • channel β€” the channel to bind to, in single-channel reception or transmission. single-channel girlies only πŸ’…
  • speed β€” the transmission speed. vroom.
  • closure β€” this one comes back to you later, in fw_cdev_event_iso_interrupt or fw_cdev_event_iso_interrupt_multichannel. it's like a little note-to-self the kernel holds onto for you πŸŽ€
  • handle β€” the handle to the context, written back by the kernel. you don't set this, the kernel does. she's the one writing. ✨

πŸ”₯ Description πŸ”₯

so before you can send or receive isochronous I/O, a context has to be created first. like, you can't skip the setup era. the context records all the deets about your transmit-or-receive configuration, and it typically maps to an underlying hardware resource β€” real "this is where the actual silicon lives" energy. a context is set up for either sending or receiving, and it's bound to a specific isochronous channel. πŸ¦‹

ngl, in the multichannel reception case, header_size and channel are just ignored β€” the channels get selected by FW_CDEV_IOC_SET_ISO_CHANNELS instead. not them being sidelined 😭

for FW_CDEV_ISO_CONTEXT_RECEIVE contexts, header_size must be at least 4 and must be a multiple of 4. in other context types it's ignored, so she simply doesn't care. πŸ’€

speed is ignored in receive context types too. yeah. she's not listening.

if a context was successfully created, the kernel writes back a handle to the context, and you must pass that handle in for subsequent operations on that context. that's the key, bestie β€” lose it and it's over. πŸ—οΈ

Limitations (the not-fun part, but we respect her): no more than one iso context can be created per fd. and the total number of contexts that all userspace and kernelspace drivers can create on a card at a time is a hardware limit β€” typically 4 or 8 contexts per direction β€” and of those, at most one multichannel receive context. that's the budget, spend it wisely. 🌸


⭐ SEE ALSO ⭐

the whole friend group, fr fr:

  • Kernel file ./include/uapi/linux/firewire-cdev.h β€” 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_request3(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_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)

that's the page, bestie β€” go create your context and slay. πŸ’œ

🧚 sign-off era: this was Kernel API Manual, source ./include/uapi/linux, dated October 2026, page struct fw_cdev_create_iso_context(9). mwah. πŸ’‹πŸŒˆ
πŸ“¦ where this page comes from