提交 a468ef45 编写于 作者: F Florian Fainelli 提交者: David S. Miller

net: dsa: bcm_sf2: Split fast age into a helper function

Add a helper function to fast age something that is controlled by the
caller: port, VLAN. We will use this to implement a VLAN fast age
operation.
Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 cf515802
...@@ -461,17 +461,11 @@ static int bcm_sf2_sw_set_eee(struct dsa_switch *ds, int port, ...@@ -461,17 +461,11 @@ static int bcm_sf2_sw_set_eee(struct dsa_switch *ds, int port,
return 0; return 0;
} }
/* Fast-ageing of ARL entries for a given port, equivalent to an ARL static int bcm_sf2_fast_age_op(struct bcm_sf2_priv *priv)
* flush for that port.
*/
static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port)
{ {
struct bcm_sf2_priv *priv = ds_to_priv(ds);
unsigned int timeout = 1000; unsigned int timeout = 1000;
u32 reg; u32 reg;
core_writel(priv, port, CORE_FAST_AGE_PORT);
reg = core_readl(priv, CORE_FAST_AGE_CTRL); reg = core_readl(priv, CORE_FAST_AGE_CTRL);
reg |= EN_AGE_PORT | EN_AGE_DYNAMIC | FAST_AGE_STR_DONE; reg |= EN_AGE_PORT | EN_AGE_DYNAMIC | FAST_AGE_STR_DONE;
core_writel(priv, reg, CORE_FAST_AGE_CTRL); core_writel(priv, reg, CORE_FAST_AGE_CTRL);
...@@ -492,6 +486,18 @@ static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port) ...@@ -492,6 +486,18 @@ static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port)
return 0; return 0;
} }
/* Fast-ageing of ARL entries for a given port, equivalent to an ARL
* flush for that port.
*/
static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port)
{
struct bcm_sf2_priv *priv = ds_to_priv(ds);
core_writel(priv, port, CORE_FAST_AGE_PORT);
return bcm_sf2_fast_age_op(priv);
}
static int bcm_sf2_sw_br_join(struct dsa_switch *ds, int port, static int bcm_sf2_sw_br_join(struct dsa_switch *ds, int port,
struct net_device *bridge) struct net_device *bridge)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册