OSDN Git Service

net: dsa: tag_ocelot: convert to tagger-owned data
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 9 Dec 2021 23:34:38 +0000 (01:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 Dec 2021 12:51:33 +0000 (12:51 +0000)
commit35d976802124303a5b3eb7ec3ed188d568204373
tree297e2ec0b3d0fea83a1c6a8481008163c914a179
parentdc452a471dbae8aca8257c565174212620880093
net: dsa: tag_ocelot: convert to tagger-owned data

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: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/ocelot/felix.c
include/linux/dsa/ocelot.h
net/dsa/tag_ocelot_8021q.c