• Vladimir Oltean's avatar
    net: dsa: tag_ocelot: convert to tagger-owned data · 35d97680
    Vladimir Oltean authored
    The felix driver makes very light use of dp->priv, and the tagger is
    effectively stateless. dp->priv is practically only needed to set up a
    callback to perform deferred xmit of PTP and STP packets using the
    ocelot-8021q tagging protocol (the main ocelot tagging protocol makes no
    use of dp->priv, although this driver sets up dp->priv irrespective of
    actual tagging protocol in use).
    
    struct felix_port (what used to be pointed to by dp->priv) is removed
    and replaced with a two-sided structure. The public side of this
    structure, visible to the switch driver, is ocelot_8021q_tagger_data.
    The private side is ocelot_8021q_tagger_private, and the latter
    structure physically encapsulates the former. The public half of the
    tagger data structure can be accessed through a helper of the same name
    (ocelot_8021q_tagger_data) which also sanity-checks the protocol
    currently in use by the switch. The public/private split was requested
    by Andrew Lunn.
    Suggested-by: default avatarAndrew Lunn <andrew@lunn.ch>
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    35d97680
felix.c 45.6 KB