STRUCT FW_CDEV_GET_CYCLE_TIMER2(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct fw_cdev_get_cycle_timer2(9) πŸ’…

okay so welcome to the Kernel API Manual, bestie β€” this page is literally all about struct fw_cdev_get_cycle_timer2, and no cap it's a whole vibe. let's get into it πŸŽ€


✨ NAME ✨

struct fw_cdev_get_cycle_timer2 β€” read cycle timer register 🌸 that's the whole job, she's a reader not a fighter


πŸ¦‹ SYNOPSIS πŸ¦‹

struct fw_cdev_get_cycle_timer2 {
    __s64 tv_sec;
    __s32 tv_nsec;
    __s32 clk_id;
    __u32 cycle_timer;
 };

lowkey obsessed with how tidy that is. four fields, zero drama. ✨


πŸ‘‘ MEMBERS πŸ‘‘

  • tv_sec β€” system time, in seconds. the big number, the main character πŸ’…
  • tv_nsec β€” system time, sub-seconds part, in nanoseconds. she's the tiny little detail that still matters, don't sleep on her 🫢
  • clk_id β€” this one's an input parameter, bestie: the clock you wanna pull the system time from πŸ•
  • cycle_timer β€” the Cycle Time register contents, just sitting there being iconic πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

So the FW_CDEV_IOC_GET_CYCLE_TIMER2 ioctl does two things at once, and honestly? multitasking queen. it reads the isochronous cycle timer and it reads the system clock. why does that matter, you ask? because it lets you correlate the reception time of isochronous packets with system time. iykyk ⭐

clk_id is where you pick your clock, like with POSIX's clock_gettime function. the supported clk_id values are, fr fr:

  • POSIX's CLOCK_REALTIME
  • POSIX's CLOCK_MONOTONIC
  • Linux's CLOCK_MONOTONIC_RAW

that's the list, don't try to sneak in anything else πŸ™ˆ

And cycle_timer? it's made of three little slices, all in host byte order:

  • 7 bits β€” cycleSeconds
  • 13 bits β€” cycleCount
  • 12 bits β€” cycleOffset

cf. the Cycle Time register per IEEE 1394, or the Isochronous Cycle Timer register per OHCI-1394. πŸ’€ yes those are two different spec names for basically the same vibe, that's just how it is.


🌈 SEE ALSO 🌈

Kernel file ./include/uapi/linux/firewire-cdev.h, plus this whole friend group right here β€” she runs with a crowd 🧚:

  • 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_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_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, every last flag and field accounted for, no skips, no gaps. slay.

okay so this lil diva lives at ./include/uapi/linux, and this edition is dated October 2026 β€” so like, mark your calendar bestie πŸ—“οΈβœ¨ periodt, that's the sign-off, mwah πŸ’‹

πŸ“¦ where this page comes from