ARRAY_SIZE(mv88e6123_table));
}
-static int mv88e6123_setup_global(struct dsa_switch *ds)
-{
- struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
-
- /* Disable remote management for now, and set the switch's
- * DSA device number.
- */
- return mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_CONTROL_2,
- ds->index & 0x1f);
-}
-
static int mv88e6123_setup(struct dsa_switch *ds)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
if (ret < 0)
return ret;
- ret = mv88e6123_setup_global(ds);
- if (ret < 0)
- return ret;
-
return mv88e6xxx_setup_ports(ds);
}
static int mv88e6131_setup_global(struct dsa_switch *ds)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
- int ret;
-
- /* Disable cascade port functionality unless this device
- * is used in a cascade configuration, and set the switch's
- * DSA device number.
- */
- if (ds->dst->pd->nr_chips > 1)
- ret = mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_CONTROL_2,
- GLOBAL_CONTROL_2_MULTIPLE_CASCADE |
- (ds->index & 0x1f));
- else
- ret = mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_CONTROL_2,
- GLOBAL_CONTROL_2_NO_CASCADE |
- (ds->index & 0x1f));
- if (ret)
- return ret;
/* Force the priority of IGMP/MLD snoop frames and ARP frames
* to the highest setting.
ARRAY_SIZE(mv88e6171_table));
}
-static int mv88e6171_setup_global(struct dsa_switch *ds)
-{
- struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
-
- /* Disable remote management for now, and set the switch's
- * DSA device number.
- */
- return mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_CONTROL_2,
- ds->index & 0x1f);
-}
-
static int mv88e6171_setup(struct dsa_switch *ds)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
if (ret < 0)
return ret;
- ret = mv88e6171_setup_global(ds);
- if (ret < 0)
- return ret;
-
return mv88e6xxx_setup_ports(ds);
}
ARRAY_SIZE(mv88e6352_table));
}
-static int mv88e6352_setup_global(struct dsa_switch *ds)
-{
- struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
-
- /* Disable remote management for now, and set the switch's
- * DSA device number.
- */
- return mv88e6xxx_reg_write(ps, REG_GLOBAL, 0x1c, ds->index & 0x1f);
-}
-
static int mv88e6352_setup(struct dsa_switch *ds)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
if (ret < 0)
return ret;
- ret = mv88e6352_setup_global(ds);
- if (ret < 0)
- return ret;
-
return mv88e6xxx_setup_ports(ds);
}
if (err)
return err;
+ /* Disable remote management, and set the switch's DSA device number. */
+ err = _mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_CONTROL_2,
+ GLOBAL_CONTROL_2_MULTIPLE_CASCADE |
+ (ds->index & 0x1f));
+ if (err)
+ return err;
+
/* Set the default address aging time to 5 minutes, and
* enable address learn messages to be sent to all message
* ports.