• Yangbo Lu's avatar
    net: mscc: ocelot: support PTP Sync one-step timestamping · 39e5308b
    Yangbo Lu authored
    Although HWTSTAMP_TX_ONESTEP_SYNC existed in ioctl for hardware timestamp
    configuration, the PTP Sync one-step timestamping had never been supported.
    
    This patch is to truely support it.
    
    - ocelot_port_txtstamp_request()
      This function handles tx timestamp request by storing
      ptp_cmd(tx timestamp type) in OCELOT_SKB_CB(skb)->ptp_cmd,
      and additionally for two-step timestamp storing ts_id in
      OCELOT_SKB_CB(clone)->ptp_cmd.
    
    - ocelot_ptp_rew_op()
      During xmit, this function is called to get rew_op (rewriter option) by
      checking skb->cb for tx timestamp request, and configure to transmitting.
    
    Non-onestep-Sync packet with one-step timestamp request falls back to use
    two-step timestamp.
    Signed-off-by: default avatarYangbo Lu <yangbo.lu@nxp.com>
    Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    39e5308b
ocelot.c 57.7 KB