wx_ptp_convert_to_hwtstamp(9)
π wx_ptp_convert_to_hwtstamp(9) π
okay so bestie, welcome to the Kernel API Manual β yes it's giving "important kernel documentation" energy and honestly? iconic. we're literally in wx_ptp_convert_to_hwtstamp(9) rn and it's about turning raw register values into a hardware timestamp. slay.
β¨ NAME β¨
wx_ptp_convert_to_hwtstamp β no cap, this one converts a register value into a hw timestamp π°οΈβ¨
π¦ SYNOPSIS π¦
void wx_ptp_convert_to_hwtstamp (struct wx *wx , struct
skb_shared_hwtstamps *hwtstamp , u64 timestamp );
that's the whole signature, iykyk β she takes three things and returns void (so basically she does the work and dips π
).
π ARGUMENTS π
wxβ the private board structure. it's the adapter's lil home base, the main character honestly π«Άhwtstampβ the stack timestamp structure. this is where the converted timestamp lands, cute πtimestampβ an unsigned 64bit system time value. big number, lots of bits, she's got range π₯
πΈ DESCRIPTION πΈ
so the whole vibe here is: we need to convert the adapter's RX/TXSTMP registers into a hwtstamp value which can be used by the stack's ptp functions. that's the mission, that's the assignment, and she ate fr fr π
the lock is used to protect consistency of the cyclecounter and the SYSTIME registers. lowkey important. however, it does not need to protect against the Rx or Tx timestamp registers, as there can't be a new timestamp until the old one is unlatched by reading. so like, the read itself is the unlatcher, it's self-synchronizing bestie, no extra guarding needed π
in addition to the timestamp in hardware, some controllers need a software overflow cyclecounter, and this function takes this into account as well. so she's handling both the hardware tea and the software overflow tea β multitasking queen π§π
π SEE ALSO π
- Kernel file
./drivers/net/ethernet/wangxun/libwx/wx_ptp.cβ that's the source file, go read her if you want the lore π __wx_ptp_detach_tx_skb(9)wx_ptp_clear_tx_timestamp(9)wx_ptp_tx_hwtstamp_work(9)wx_ptp_overflow_check(9)wx_ptp_rx_hang(9)wx_ptp_tx_hang(9)wx_ptp_reset_cyclecounter(9)wx_ptp_suspend(9)wx_ptp_stop(9)wx_ptp_rx_hwtstamp(9)
the whole friend group, we love a supporting cast πβ
lowkey remember bestie: this is kernel code, so the details are the whole personality. don't go changing flags or inventing options, periodt π
and that's the page!! shipped from ./drivers/net/ethernet/wangxun... with a date stamp of October 2026, and the version footer is literally the same title again (wx_ptp_convert_to_hwtstamp(9)) because she's consistent like that π
π thanks for reading, mwah, go forth and timestamp β¨π
π¦ 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