STRUCT KERNEL_HWTSTAMP_CONFIG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct kernel_hwtstamp_config(9) ✨

okay so this is from the Kernel API Manual bestie, and honestly? it's giving "the glow-up version of a struct you already know" πŸ’… we're talking about struct kernel_hwtstamp_config today and it's lowkey iconic.


πŸŽ€ NAME πŸŽ€

struct kernel_hwtstamp_config β€” the kernel's own copy of struct hwtstamp_config. yes queen, it's a duplicate, but with lore. πŸ¦‹


🌸 SYNOPSIS 🌸

okay here's the whole vibe, copy it exactly, no cap:

struct kernel_hwtstamp_config {
    int flags;
    int tx_type;
    int rx_filter;
    struct ifreq *ifr;
    bool copied_to_user;
    enum hwtstamp_source source;
    enum hwtstamp_provider_qualifier qualifier;
 };

look at her. seven members. main character energy fr fr πŸ‘‘


πŸ’– Members πŸ’–

let's meet the cast, one by one 🫢

  • flags β€” see struct hwtstamp_config. that's it, that's the whole description, she's mysterious like that πŸ™ˆ
  • tx_type β€” see struct hwtstamp_config. same deal bestie πŸ’€
  • rx_filter β€” see struct hwtstamp_config. yep, third one, also a forward reference, we love a consistent queen ✨
  • ifr β€” pointer to ifreq structure from the original ioctl request, to pass to a legacy implementation of a lower driver. so it's literally the original request, being handed down to the old-school driver like "here, you deal with this" 😭
  • copied_to_user β€” request was passed to a legacy implementation which already copied the ioctl request back to user space. this bool is basically a receipt: the legacy path already sent it back to userspace, so don't do it twice okay πŸ’…
  • source β€” indication whether timestamps should come from the netdev or from an attached phylib PHY. netdev girlie or PHY girlie, you gotta pick 🌈
  • qualifier β€” qualifier of the hwtstamp provider. a little extra specificity on who's providing the hardware stamps πŸŽ€

πŸ¦‹ Description πŸ¦‹

prefer using this structure for in-kernel processing of hardware timestamping configuration, over the inextensible struct hwtstamp_config exposed to the SIOCGHWTSTAMP and SIOCSHWTSTAMP ioctl UAPI.

so basically: in-kernel peeps, use struct kernel_hwtstamp_config. the other one is inextensible β€” you literally cannot extend it, she's frozen in time 😭 which is fine for the UAPI, but in-kernel you deserve room to grow bestie. know the difference, periodt.

and yes, SIOCGHWTSTAMP and SIOCSHWTSTAMP are the ioctl names, spell them right, they're case-sensitive and they will humble you πŸ’€

⭐ SEE ALSO ⭐

go read these next, iykyk 🧚

  • Kernel file ./include/linux/net_tstamp.h
  • struct hwtstamp_provider_desc(9)
  • struct hwtstamp_provider(9)

🌸 little vibe check: flags, tx_type and rx_filter all just point you at struct hwtstamp_config for the actual meaning β€” this page is not gonna re-explain them, so don't come for her, she's just the messenger πŸ’–

and that's the whole page bestie, you ate that 🫢✨ this cutie lives in ./include/linux and was dated October 2026 β€” mwah, go forth and timestamp responsibly πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from