net: mscc: ocelot: expose vcap_props structure
authorColin Foster <colin.foster@in-advantage.com>
Fri, 27 Jan 2023 19:35:49 +0000 (11:35 -0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 31 Jan 2023 05:07:20 +0000 (21:07 -0800)
The vcap_props structure is common to other devices, specifically the
VSC7512 chip that can only be controlled externally. Export this structure
so it doesn't need to be recreated.

Signed-off-by: Colin Foster <colin.foster@in-advantage.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> # regression
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot_vsc7514.c
drivers/net/ethernet/mscc/vsc7514_regs.c
include/soc/mscc/vsc7514_regs.h

index 8a90b5e8c8fabd3478f2b89a5c06732e5a1433df..381d099f41b1e62a9bb4e2e17b1bee4e1a14e1fc 100644 (file)
@@ -180,49 +180,6 @@ static const struct ocelot_ops ocelot_ops = {
        .netdev_to_port         = ocelot_netdev_to_port,
 };
 
-static struct vcap_props vsc7514_vcap_props[] = {
-       [VCAP_ES0] = {
-               .action_type_width = 0,
-               .action_table = {
-                       [ES0_ACTION_TYPE_NORMAL] = {
-                               .width = 73, /* HIT_STICKY not included */
-                               .count = 1,
-                       },
-               },
-               .target = S0,
-               .keys = vsc7514_vcap_es0_keys,
-               .actions = vsc7514_vcap_es0_actions,
-       },
-       [VCAP_IS1] = {
-               .action_type_width = 0,
-               .action_table = {
-                       [IS1_ACTION_TYPE_NORMAL] = {
-                               .width = 78, /* HIT_STICKY not included */
-                               .count = 4,
-                       },
-               },
-               .target = S1,
-               .keys = vsc7514_vcap_is1_keys,
-               .actions = vsc7514_vcap_is1_actions,
-       },
-       [VCAP_IS2] = {
-               .action_type_width = 1,
-               .action_table = {
-                       [IS2_ACTION_TYPE_NORMAL] = {
-                               .width = 49,
-                               .count = 2
-                       },
-                       [IS2_ACTION_TYPE_SMAC_SIP] = {
-                               .width = 6,
-                               .count = 4
-                       },
-               },
-               .target = S2,
-               .keys = vsc7514_vcap_is2_keys,
-               .actions = vsc7514_vcap_is2_actions,
-       },
-};
-
 static struct ptp_clock_info ocelot_ptp_clock_info = {
        .owner          = THIS_MODULE,
        .name           = "ocelot ptp",
index 123175618251fb3bcdd3d9467e52b8f21dc86d68..c3ad01722829433ded8ecad27618596898230f95 100644 (file)
@@ -639,3 +639,47 @@ const struct vcap_field vsc7514_vcap_is2_actions[] = {
        [VCAP_IS2_ACT_HIT_CNT]                  = { 49, 32 },
 };
 EXPORT_SYMBOL(vsc7514_vcap_is2_actions);
+
+struct vcap_props vsc7514_vcap_props[] = {
+       [VCAP_ES0] = {
+               .action_type_width = 0,
+               .action_table = {
+                       [ES0_ACTION_TYPE_NORMAL] = {
+                               .width = 73, /* HIT_STICKY not included */
+                               .count = 1,
+                       },
+               },
+               .target = S0,
+               .keys = vsc7514_vcap_es0_keys,
+               .actions = vsc7514_vcap_es0_actions,
+       },
+       [VCAP_IS1] = {
+               .action_type_width = 0,
+               .action_table = {
+                       [IS1_ACTION_TYPE_NORMAL] = {
+                               .width = 78, /* HIT_STICKY not included */
+                               .count = 4,
+                       },
+               },
+               .target = S1,
+               .keys = vsc7514_vcap_is1_keys,
+               .actions = vsc7514_vcap_is1_actions,
+       },
+       [VCAP_IS2] = {
+               .action_type_width = 1,
+               .action_table = {
+                       [IS2_ACTION_TYPE_NORMAL] = {
+                               .width = 49,
+                               .count = 2
+                       },
+                       [IS2_ACTION_TYPE_SMAC_SIP] = {
+                               .width = 6,
+                               .count = 4
+                       },
+               },
+               .target = S2,
+               .keys = vsc7514_vcap_is2_keys,
+               .actions = vsc7514_vcap_is2_actions,
+       },
+};
+EXPORT_SYMBOL(vsc7514_vcap_props);
index 9b40e7d00ec5d95f266033d4b6d023fb652d2d72..8cfbc7ec07f8aef54148f772974bb7e8798ad0f1 100644 (file)
@@ -10,6 +10,8 @@
 
 #include <soc/mscc/ocelot_vcap.h>
 
+extern struct vcap_props vsc7514_vcap_props[];
+
 extern const struct reg_field vsc7514_regfields[REGFIELD_MAX];
 
 extern const u32 vsc7514_ana_regmap[];