提交 a2ac29d2 编写于 作者: V Vivien Didelot 提交者: David S. Miller

net: dsa: mv88e6xxx: add ATU setup helper

Move the configuration of the default ageing time in a new
mv88e6xxx_atu_setup function.

That function will be extended later to contain all ATU related
configuration bits.
Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 720c6343
...@@ -1306,6 +1306,11 @@ static void mv88e6xxx_port_stp_state_set(struct dsa_switch *ds, int port, ...@@ -1306,6 +1306,11 @@ static void mv88e6xxx_port_stp_state_set(struct dsa_switch *ds, int port,
netdev_err(ds->ports[port].netdev, "failed to update state\n"); netdev_err(ds->ports[port].netdev, "failed to update state\n");
} }
static int mv88e6xxx_atu_setup(struct mv88e6xxx_chip *chip)
{
return mv88e6xxx_g1_atu_set_age_time(chip, 300000);
}
static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port) static void mv88e6xxx_port_fast_age(struct dsa_switch *ds, int port)
{ {
struct mv88e6xxx_chip *chip = ds->priv; struct mv88e6xxx_chip *chip = ds->priv;
...@@ -2756,10 +2761,6 @@ static int mv88e6xxx_g1_setup(struct mv88e6xxx_chip *chip) ...@@ -2756,10 +2761,6 @@ static int mv88e6xxx_g1_setup(struct mv88e6xxx_chip *chip)
if (err) if (err)
return err; return err;
err = mv88e6xxx_g1_atu_set_age_time(chip, 300000);
if (err)
return err;
/* Clear all ATU entries */ /* Clear all ATU entries */
err = _mv88e6xxx_atu_flush(chip, 0, true); err = _mv88e6xxx_atu_flush(chip, 0, true);
if (err) if (err)
...@@ -2845,6 +2846,10 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) ...@@ -2845,6 +2846,10 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
goto unlock; goto unlock;
} }
err = mv88e6xxx_atu_setup(chip);
if (err)
goto unlock;
/* Some generations have the configuration of sending reserved /* Some generations have the configuration of sending reserved
* management frames to the CPU in global2, others in * management frames to the CPU in global2, others in
* global1. Hence it does not fit the two setup functions * global1. Hence it does not fit the two setup functions
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册