diff options
author | Andrew Lunn <andrew@lunn.ch> | 2019-04-28 19:37:12 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-28 19:41:01 -0400 |
commit | 0b42f03363706609d621c31324fae5c1250f579f (patch) | |
tree | b4b66ab0f485b8d885446a55d450772eb22c7e08 /net | |
parent | 875138f81d71af3cfa80df57e32fe9efbc4f95bc (diff) | |
download | linux-0b42f03363706609d621c31324fae5c1250f579f.tar.bz2 |
dsa: Add MODULE_ALIAS to taggers in preparation to become modules
When the tag drivers become modules, we will need to dynamically load
them based on what the switch drivers need. Add aliases to map between
the TAG protocol and the driver.
In order to do this, we need the tag protocol number as something
which the C pre-processor can stringinfy. Only the compiler knows the
value of an enum, CPP cannot use them. So add #defines.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/dsa/tag_brcm.c | 4 | ||||
-rw-r--r-- | net/dsa/tag_dsa.c | 2 | ||||
-rw-r--r-- | net/dsa/tag_edsa.c | 2 | ||||
-rw-r--r-- | net/dsa/tag_gswip.c | 2 | ||||
-rw-r--r-- | net/dsa/tag_ksz.c | 4 | ||||
-rw-r--r-- | net/dsa/tag_lan9303.c | 2 | ||||
-rw-r--r-- | net/dsa/tag_mtk.c | 2 | ||||
-rw-r--r-- | net/dsa/tag_qca.c | 2 | ||||
-rw-r--r-- | net/dsa/tag_trailer.c | 2 |
9 files changed, 22 insertions, 0 deletions
diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c index 1b7dfbe6b3ae..24d8f45a7e6f 100644 --- a/net/dsa/tag_brcm.c +++ b/net/dsa/tag_brcm.c @@ -173,6 +173,8 @@ const struct dsa_device_ops brcm_netdev_ops = { .rcv = brcm_tag_rcv, .overhead = BRCM_TAG_LEN, }; + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_BRCM); #endif #ifdef CONFIG_NET_DSA_TAG_BRCM_PREPEND @@ -198,3 +200,5 @@ const struct dsa_device_ops brcm_prepend_netdev_ops = { .overhead = BRCM_TAG_LEN, }; #endif + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_BRCM_PREPEND); diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c index e1c90709de6c..8aefaf96c1ca 100644 --- a/net/dsa/tag_dsa.c +++ b/net/dsa/tag_dsa.c @@ -157,3 +157,5 @@ const struct dsa_device_ops dsa_netdev_ops = { .flow_dissect = dsa_tag_flow_dissect, .overhead = DSA_HLEN, }; + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_DSA); diff --git a/net/dsa/tag_edsa.c b/net/dsa/tag_edsa.c index b936b4660b71..bad12e760f3d 100644 --- a/net/dsa/tag_edsa.c +++ b/net/dsa/tag_edsa.c @@ -176,3 +176,5 @@ const struct dsa_device_ops edsa_netdev_ops = { .flow_dissect = edsa_tag_flow_dissect, .overhead = EDSA_HLEN, }; + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_EDSA); diff --git a/net/dsa/tag_gswip.c b/net/dsa/tag_gswip.c index d1c1e7db87b6..30bf7036620f 100644 --- a/net/dsa/tag_gswip.c +++ b/net/dsa/tag_gswip.c @@ -109,3 +109,5 @@ const struct dsa_device_ops gswip_netdev_ops = { .rcv = gswip_tag_rcv, .overhead = GSWIP_RX_HEADER_LEN, }; + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_GSWIP); diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c index 631094599514..9be0f5f12afb 100644 --- a/net/dsa/tag_ksz.c +++ b/net/dsa/tag_ksz.c @@ -140,6 +140,8 @@ const struct dsa_device_ops ksz9477_netdev_ops = { .overhead = KSZ9477_INGRESS_TAG_LEN, }; +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_KSZ9477); + #define KSZ9893_TAIL_TAG_OVERRIDE BIT(5) #define KSZ9893_TAIL_TAG_LOOKUP BIT(6) @@ -173,3 +175,5 @@ const struct dsa_device_ops ksz9893_netdev_ops = { .rcv = ksz9477_rcv, .overhead = KSZ_INGRESS_TAG_LEN, }; + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_KSZ9893); diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c index 67d70339536d..48bca20024d4 100644 --- a/net/dsa/tag_lan9303.c +++ b/net/dsa/tag_lan9303.c @@ -134,3 +134,5 @@ const struct dsa_device_ops lan9303_netdev_ops = { .rcv = lan9303_rcv, .overhead = LAN9303_TAG_LEN, }; + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_LAN9303); diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c index dc537d9a18c0..23210a65cbed 100644 --- a/net/dsa/tag_mtk.c +++ b/net/dsa/tag_mtk.c @@ -105,3 +105,5 @@ const struct dsa_device_ops mtk_netdev_ops = { .flow_dissect = mtk_tag_flow_dissect, .overhead = MTK_HDR_LEN, }; + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_MTK); diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c index f62296ffc5b7..7d9cb178da3d 100644 --- a/net/dsa/tag_qca.c +++ b/net/dsa/tag_qca.c @@ -106,3 +106,5 @@ const struct dsa_device_ops qca_netdev_ops = { .flow_dissect = qca_tag_flow_dissect, .overhead = QCA_HDR_LEN, }; + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_QCA); diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c index 20ee7f84fe4d..00d521cf9c48 100644 --- a/net/dsa/tag_trailer.c +++ b/net/dsa/tag_trailer.c @@ -83,3 +83,5 @@ const struct dsa_device_ops trailer_netdev_ops = { .rcv = trailer_rcv, .overhead = 4, }; + +MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_TRAILER); |