• Vladimir Oltean's avatar
    net: dsa: stop exposing tag proto module helpers to the world · 9999f85b
    Vladimir Oltean authored
    The DSA tagging protocol driver macros are in the public include/net/dsa.h
    probably because that's also where the DSA_TAG_PROTO_*_VALUE macros are
    (MODULE_ALIAS_DSA_TAG_DRIVER hinges on those macro definitions).
    
    But there is no reason to expose these helpers to <net/dsa.h>. That
    header is shared between switch drivers (drivers/net/dsa/), tagging
    protocol drivers (net/dsa/tag_*.c), the DSA core (net/dsa/ sans tag_*.c),
    and the rest of the world (DSA master drivers, network stack, etc).
    Too much exposure.
    
    On the other hand, net/dsa/dsa_priv.h is included only by the DSA core
    and by DSA tagging protocol drivers (or IOW, "friend" modules). Also a
    bit too much exposure - I've contemplated creating a new header which is
    only included by tagging protocol drivers, but completely separating a
    new dsa_tag_proto.h from dsa_priv.h is not immediately trivial - for
    example dsa_slave_to_port() is used both from the fast path and from the
    control path.
    
    So for now, move these definitions to dsa_priv.h which at least hides
    them from the world.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Tested-by: default avatarMichael Walle <michael@walle.cc>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    9999f85b
dsa_priv.h 22.1 KB