• Vladimir Oltean's avatar
    net: dsa: tag_sja1105: split sja1105_tagger_data into private and public sections · 950a419d
    Vladimir Oltean authored
    The sja1105 driver messes with the tagging protocol's state when PTP RX
    timestamping is enabled/disabled. This is fundamentally necessary
    because the tagger needs to know what to do when it receives a PTP
    packet. If RX timestamping is enabled, then a metadata follow-up frame
    is expected, and this holds the (partial) timestamp. So the tagger plays
    hide-and-seek with the network stack until it also gets the metadata
    frame, and then presents a single packet, the timestamped PTP packet.
    But when RX timestamping isn't enabled, there is no metadata frame
    expected, so the hide-and-seek game must be turned off and the packet
    must be delivered right away to the network stack.
    
    Considering this, we create a pseudo isolation by devising two tagger
    methods callable by the switch: one to get the RX timestamping state,
    and one to set it. Since we can't export symbols between the tagger and
    the switch driver, these methods are exposed through function pointers.
    
    After this change, the public portion of the sja1105_tagger_data
    contains only function pointers.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    950a419d
sja1105_ptp.c 27 KB