#define AR8XXX_NUM_PHYS 5
+static void ar8216_set_mirror_regs(struct ar8xxx_priv *priv);
+static void ar8327_set_mirror_regs(struct ar8xxx_priv *priv);
+
enum {
AR8XXX_VER_AR8216 = 0x01,
AR8XXX_VER_AR8236 = 0x03,
void (*vtu_flush)(struct ar8xxx_priv *priv);
void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32 vid, u32 port_mask);
void (*phy_fixup)(struct ar8xxx_priv *priv, int phy);
+ void (*set_mirror_regs)(struct ar8xxx_priv *priv);
const struct ar8xxx_mib_desc *mib_decs;
unsigned num_mibs;
.atu_flush = ar8216_atu_flush,
.vtu_flush = ar8216_vtu_flush,
.vtu_load_vlan = ar8216_vtu_load_vlan,
+ .set_mirror_regs = ar8216_set_mirror_regs,
.num_mibs = ARRAY_SIZE(ar8216_mibs),
.mib_decs = ar8216_mibs,
.atu_flush = ar8216_atu_flush,
.vtu_flush = ar8216_vtu_flush,
.vtu_load_vlan = ar8216_vtu_load_vlan,
+ .set_mirror_regs = ar8216_set_mirror_regs,
.num_mibs = ARRAY_SIZE(ar8236_mibs),
.mib_decs = ar8236_mibs,
.atu_flush = ar8216_atu_flush,
.vtu_flush = ar8216_vtu_flush,
.vtu_load_vlan = ar8216_vtu_load_vlan,
+ .set_mirror_regs = ar8216_set_mirror_regs,
.num_mibs = ARRAY_SIZE(ar8236_mibs),
.mib_decs = ar8236_mibs,
.vtu_flush = ar8327_vtu_flush,
.vtu_load_vlan = ar8327_vtu_load_vlan,
.phy_fixup = ar8327_phy_fixup,
+ .set_mirror_regs = ar8327_set_mirror_regs,
.num_mibs = ARRAY_SIZE(ar8236_mibs),
.mib_decs = ar8236_mibs,
AR8216_PORT_CTRL_MIRROR_TX);
}
-static void
-ar8xxx_set_mirror_regs(struct ar8xxx_priv *priv)
-{
- if (chip_is_ar8327(priv) || chip_is_ar8337(priv)) {
- ar8327_set_mirror_regs(priv);
- } else {
- ar8216_set_mirror_regs(priv);
- }
-}
-
static int
ar8xxx_sw_hw_apply(struct switch_dev *dev)
{
priv->chip->setup_port(priv, i, portmask[i]);
}
- ar8xxx_set_mirror_regs(priv);
+ priv->chip->set_mirror_regs(priv);
mutex_unlock(&priv->reg_mutex);
return 0;
mutex_lock(&priv->reg_mutex);
priv->mirror_rx = !!val->value.i;
- ar8xxx_set_mirror_regs(priv);
+ priv->chip->set_mirror_regs(priv);
mutex_unlock(&priv->reg_mutex);
return 0;
mutex_lock(&priv->reg_mutex);
priv->mirror_tx = !!val->value.i;
- ar8xxx_set_mirror_regs(priv);
+ priv->chip->set_mirror_regs(priv);
mutex_unlock(&priv->reg_mutex);
return 0;
mutex_lock(&priv->reg_mutex);
priv->monitor_port = val->value.i;
- ar8xxx_set_mirror_regs(priv);
+ priv->chip->set_mirror_regs(priv);
mutex_unlock(&priv->reg_mutex);
return 0;
mutex_lock(&priv->reg_mutex);
priv->source_port = val->value.i;
- ar8xxx_set_mirror_regs(priv);
+ priv->chip->set_mirror_regs(priv);
mutex_unlock(&priv->reg_mutex);
return 0;