dev_set_hwtstamp_phylib(9)
πΈ NAME πΈ
dev_set_hwtstamp_phylib β okay so this is the one that changes the hardware timestamping of a NIC, or of an attached phylib PHY. Like, it flips the timestamping situation. π
β¨ SYNOPSIS β¨
int dev_set_hwtstamp_phylib (struct net_device *dev , struct
kernel_hwtstamp_config *cfg , struct netlink_ext_ack *extack );
π ARGUMENTS π
devβ the network device. bestie. the NIC in question. π₯οΈcfgβ the timestamping configuration structure. this is where the actual settings live, okurrr πextackβ the Netlink extended ack message structure, and it's literally there for error reporting. so if stuff goes sideways, this is where the tea gets spilled π
π¦ DESCRIPTION π¦
So this is a helper function, and its whole job is enforcing a common policy. And the policy is giving very much main character energy:
phylib timestamping, if it's available, should take precedence in front of hardware timestamping provided by the netdev. periodt. PHY wins the vibe check, and the netdev-provided hardware timestamping is behind it in line. π
But okay, here's the part you actually need to know, because it's lowkey important: if the netdev driver needs to do specific actions even for PHY timestamping to work properly β and the example is literally a switch port must trap the timestamped frames and not forward them β then it must set dev->see_all_hwtstamp_requests. no cap, that's the flag, that's the move. set it or your switch port is out here forwarding frames it should've trapped and the timestamping situation is giving chaos π
fr fr, don't skip the dev->see_all_hwtstamp_requests part. the driver has specific actions to perform? set it. it's not optional, it's the whole point π«Ά
π§ SEE ALSO π§
- Kernel file
./net/core/dev_ioctl.cdev_get_hwtstamp_phylib(9)β the getter to this setter, they're a matched set, iconic duo β dev_load(9)dev_ioctl(9)
and that's the whole page bestie, you ate that π
this one's from ./net/core, dated October 2026, and it lives in the Kernel API Manual like the little legend it is. go forth and timestamp correctly ππβ¨
π¦ 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