igb_ptp_systim_to_hwtstamp(9)
π igb_ptp_systim_to_hwtstamp(9) π
okay bestie, so this is the igb_ptp_systim_to_hwtstamp page from the Kernel API Manual, and it's literally gonna teach you how to turn a system time value into a hardware timestamp. slay.
β¨ NAME β¨
igb_ptp_systim_to_hwtstamp β convert system time value to hw timestamp π°οΈ
π¦ SYNOPSIS π¦
void igb_ptp_systim_to_hwtstamp (struct igb_adapter *adapter , struct
skb_shared_hwtstamps *hwtstamps , u64 systim );
π ARGUMENTS π
adapterβ the board private structure, iykyk π«Άhwtstampsβ the timestamp structure you're updating, no capsystimβ an unsigned 64bit system time value. literally 64 bits of time energy β³
πΈ DESCRIPTION πΈ
okay so here's the vibe: we need to convert the system time value stored in the RX/TXSTMP registers into a hwtstamp β and that's the one the upper level timestamping functions can actually use. main character conversion arc fr fr.
the 'tmreg_lock' spinlock is used to protect the consistency of the system time value. why do we even need it? because reading the 64 bit time value involves reading two (or three) 32 bit registers, and the first read latches the value. ditto for writing. so yeah, that lock is doing the Lord's work keeping it all consistent π₯
ngl, don't skip the locking thought process β it's there for a real reason, bestie.
in addition, here have extended the system time with an overflow counter in software. cute little software overflow counter, iconic β¨
π SEE ALSO π
- Kernel file:
./drivers/net/ethernet/intel/igb/igb_ptp.c igb_ptp_tx_work(9)igb_ptp_rx_hang(9)igb_ptp_tx_hang(9)igb_ptp_tx_hwtstamp(9)igb_ptp_rx_pktstamp(9)igb_ptp_rx_rgtstamp(9)igb_ptp_hwtstamp_get(9)igb_ptp_set_timestamp_mode(9)igb_ptp_hwtstamp_set(9)igb_ptp_init(9)igb_ptp_sdp_init(9)igb_ptp_suspend(9)igb_ptp_stop(9)igb_ptp_reset(9)
and that's the whole page, bestie π₯Ή this gem lives in ./drivers/net/ethernet/intel/igb, it's from the Kernel API Manual, dated October 2026, and it's literally giving igb_ptp_systim_to_hwtstamp(9) energy. go off, timestamp icon ππ
π¦ 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