dev_get_hwtstamp_phylib(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– dev_get_hwtstamp_phylib β€” like, the whole vibe ✨

okay so real talk, bestie: this is a page from the Kernel API Manual, section 9 (the kernel-functions girlies 🧚), and the star of the show is dev_get_hwtstamp_phylib. Get into it.


🌸 NAME 🌸

dev_get_hwtstamp_phylib β€” literally the function that gets you the hardware timestamping settings of a NIC, or of a phylib PHY that's attached to it. no cap, that's the whole job 🫢


πŸŽ€ SYNOPSIS πŸŽ€

int dev_get_hwtstamp_phylib (struct net_device *dev , struct kernel_hwtstamp_config *cfg );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the network device in question. your NIC, your fave, the main character 🎬
  • cfg β€” the timestamping configuration structure. this is where the settings live, and it's what you're here for πŸ’…

⭐ DESCRIPTION ⭐

It's a helper for calling the default hardware provider timestamping. that's it, that's the function. short and iconic, lowkeyπŸ’œ


πŸ™ˆ NOTE πŸ™ˆ

okay so this part matters, don't skim it:

phy_mii_ioctl only handles SIOCSHWTSTAMP β€” not SIOCGHWTSTAMP. but plot twist: phydev->mii_ts has both hwtstamp_get and hwtstamp_set methods, so it's giving options ✨

so for phylib, this will return -EOPNOTSUPP only if hwtstamp_get is not implemented, for now. which is still more accurate than letting the netdev handle the GET request. fr fr, accuracy ate πŸ’€


πŸ”₯ SEE ALSO πŸ”₯


ngl bestie, if you're poking at timestamps and it's throwing -EOPNOTSUPP at you, check whether hwtstamp_get is even implemented. that's the whole tea β˜•

and that's the page!! πŸ“ courtesy of the kernel file ./net/core, dated October 2026 β€” ily, go timestamp something πŸ’–πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from