STRUCT KERNEL_HWTSTAMP_CONFIG(9)
β¨ 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β seestruct hwtstamp_config. that's it, that's the whole description, she's mysterious like that πtx_typeβ seestruct hwtstamp_config. same deal bestie πrx_filterβ seestruct hwtstamp_config. yep, third one, also a forward reference, we love a consistent queen β¨ifrβ pointer toifreqstructure 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 thenetdevor from an attachedphylibPHY. netdev girlie or PHY girlie, you gotta pick πqualifierβ qualifier of thehwtstampprovider. 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,SIOCGHWTSTAMPandSIOCSHWTSTAMPare 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_typeandrx_filterall just point you atstruct hwtstamp_configfor 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
- 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