@@ -42,10 +42,6 @@ static const u32 *ocelot_regmap[TARGET_MAX] = {
[DEV_GMII] = vsc7514_dev_gmii_regmap,
};
-static const struct ocelot_stat_layout ocelot_stats_layout[OCELOT_NUM_STATS] = {
- OCELOT_COMMON_STATS,
-};
-
static void ocelot_pll5_init(struct ocelot *ocelot)
{
/* Configure PLL5. This will need a proper CCF driver
@@ -80,7 +76,7 @@ static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops)
int ret;
ocelot->map = ocelot_regmap;
- ocelot->stats_layout = ocelot_stats_layout;
+ ocelot->stats_layout = vsc7514_stats_layout;
ocelot->num_mact_rows = 1024;
ocelot->ops = ops;
@@ -9,6 +9,11 @@
#include <soc/mscc/vsc7514_regs.h>
#include "ocelot.h"
+const struct ocelot_stat_layout vsc7514_stats_layout[OCELOT_NUM_STATS] = {
+ OCELOT_COMMON_STATS,
+};
+EXPORT_SYMBOL(vsc7514_stats_layout);
+
const struct reg_field vsc7514_regfields[REGFIELD_MAX] = {
[ANA_ADVLEARN_VLAN_CHK] = REG_FIELD(ANA_ADVLEARN, 11, 11),
[ANA_ADVLEARN_LEARN_MIRROR] = REG_FIELD(ANA_ADVLEARN, 0, 10),
@@ -8,8 +8,11 @@
#ifndef VSC7514_REGS_H
#define VSC7514_REGS_H
+#include <soc/mscc/ocelot.h>
#include <soc/mscc/ocelot_vcap.h>
+extern const struct ocelot_stat_layout vsc7514_stats_layout[];
+
extern const struct reg_field vsc7514_regfields[REGFIELD_MAX];
extern const u32 vsc7514_ana_regmap[];
The ocelot_stats_layout array is common between several different chips, some of which can only be controlled externally. Export this structure so it doesn't have to be duplicated in these other drivers. Rename the structure as well, to follow the conventions of other shared resources. Signed-off-by: Colin Foster <colin.foster@in-advantage.com> --- v2 & v3 * No change v1 from previous RFC: * Utilize OCELOT_COMMON_STATS --- drivers/net/ethernet/mscc/ocelot_vsc7514.c | 6 +----- drivers/net/ethernet/mscc/vsc7514_regs.c | 5 +++++ include/soc/mscc/vsc7514_regs.h | 3 +++ 3 files changed, 9 insertions(+), 5 deletions(-)