STRUCT MII_TIMESTAMPER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 for skb, and ngl this one comes with a promise 🩷 if the skb is accepted, the MII time stamping device promises to deliver it using netif_rx as soon as a timestamp becomes available. one of the PTP_CLASS_ values gets passed in type. and bestie, the function must return true if the skb is accepted for delivery. no cap.
  • txtstamp β€” asks for a Tx timestamp for skb, and again: the MII time stamping device promises to deliver it using skb_complete_tx_timestamp as soon as a timestamp becomes available. one of the PTP_CLASS_ values gets passed in type. slay, consistent queen πŸ’…
  • hwtstamp_set β€” handles the SIOCSHWTSTAMP ioctl for hardware time stamping.
  • hwtstamp_get β€” handles the SIOCGHWTSTAMP ioctl 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 the phy_device mutex. 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_timestamper within a private structure, obtaining a reference to it using container_of. classic move, iconic, we love an embedded struct πŸ’–
  • Drivers for non-PHY time stamping devices should return a pointer to a mii_timestamper from the probe_channel callback of their mii_timestamping_ctrl interface. different path, same slay 🌈

⭐ SEE ALSO ⭐

  • Kernel file ./include/linux/mii_timestamper.h struct mii_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