Skip to content

Commit a468ef4

Browse files
ffainellidavem330
authored andcommitted
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: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cf51580 commit a468ef4

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

drivers/net/dsa/bcm_sf2.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,17 +461,11 @@ static int bcm_sf2_sw_set_eee(struct dsa_switch *ds, int port,
461461
return 0;
462462
}
463463

464-
/* Fast-ageing of ARL entries for a given port, equivalent to an ARL
465-
* flush for that port.
466-
*/
467-
static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port)
464+
static int bcm_sf2_fast_age_op(struct bcm_sf2_priv *priv)
468465
{
469-
struct bcm_sf2_priv *priv = ds_to_priv(ds);
470466
unsigned int timeout = 1000;
471467
u32 reg;
472468

473-
core_writel(priv, port, CORE_FAST_AGE_PORT);
474-
475469
reg = core_readl(priv, CORE_FAST_AGE_CTRL);
476470
reg |= EN_AGE_PORT | EN_AGE_DYNAMIC | FAST_AGE_STR_DONE;
477471
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)
492486
return 0;
493487
}
494488

489+
/* Fast-ageing of ARL entries for a given port, equivalent to an ARL
490+
* flush for that port.
491+
*/
492+
static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port)
493+
{
494+
struct bcm_sf2_priv *priv = ds_to_priv(ds);
495+
496+
core_writel(priv, port, CORE_FAST_AGE_PORT);
497+
498+
return bcm_sf2_fast_age_op(priv);
499+
}
500+
495501
static int bcm_sf2_sw_br_join(struct dsa_switch *ds, int port,
496502
struct net_device *bridge)
497503
{

0 commit comments

Comments
 (0)