STRUCT MII_TIMESTAMPER(9)
π struct mii_timestamper(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β this one's all about struct mii_timestamper, aka the callback interface to MII time stamping devices. yes, time stamping. we're being precise about when things happened. it's giving main character energy for packets π«Ά
πΈ NAME πΈ
struct mii_timestamper β the callback interface to MII time stamping devices, periodt.
β¨ SYNOPSIS β¨
struct mii_timestamper {
bool (*rxtstamp)(struct mii_timestamper *mii_ts, struct sk_buff
*skb, int type);
void (*txtstamp)(struct mii_timestamper *mii_ts, struct sk_buff
*skb, int type);
int (*hwtstamp_set)(struct mii_timestamper *mii_ts, struct
kernel_hwtstamp_config *kernel_config, struct netlink_ext_ack *extack);
int (*hwtstamp_get)(struct mii_timestamper *mii_ts, struct
kernel_hwtstamp_config *kernel_config);
void (*link_state)(struct mii_timestamper *mii_ts, struct phy_device
*phydev);
int (*ts_info)(struct mii_timestamper *mii_ts, struct
kernel_ethtool_ts_info *ts_info);
struct device *device;
};
π Members π
rxtstampβ asks for a Rx timestamp forskb, and ngl this one comes with a promise π©· if the skb is accepted, the MII time stamping device promises to deliver it usingnetif_rxas soon as a timestamp becomes available. one of thePTP_CLASS_values gets passed intype. and bestie, the function must return true if the skb is accepted for delivery. no cap.txtstampβ asks for a Tx timestamp forskb, and again: the MII time stamping device promises to deliver it usingskb_complete_tx_timestampas soon as a timestamp becomes available. one of thePTP_CLASS_values gets passed intype. slay, consistent queen πhwtstamp_setβ handles theSIOCSHWTSTAMPioctl for hardware time stamping.hwtstamp_getβ handles theSIOCGHWTSTAMPioctl for hardware time stamping. (yes, get is a whole different ioctl from set β don't mix them up, iykyk π)link_stateβ lets the device respond to changes in the link state. heads up though: the caller invokes this function while holding thephy_devicemutex. so likeβ¦ mind the lock, bestie πts_infoβ handles ethtool queries for hardware time stamping.deviceβ remembers the device to which the instance belongs. it's literally keeping receipts π§Ύ
π¦ Description π¦
okay so here's the vibe check on how you actually use this thing:
- Drivers for PHY time stamping devices should embed their
mii_timestamperwithin a private structure, obtaining a reference to it usingcontainer_of. classic move, iconic, we love an embedded struct π - Drivers for non-PHY time stamping devices should return a pointer to a
mii_timestamperfrom theprobe_channelcallback of theirmii_timestamping_ctrlinterface. different path, same slay π
β SEE ALSO β
- Kernel file
./include/linux/mii_timestamper.hstructmii_timestamping_ctrl(9)
and that's the whole page, bestie π§ no skips, no summaries, every single callback accounted for β¨
this masterpiece lives in ./include/linux, dated October 2026, and it's filed under struct mii_timestamper(9) in the Kernel API Manual β 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