diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2016-06-09 20:42:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-10 01:12:48 -0400 |
commit | a468ef452ab91907215e29e98cfadff8cb1c15f7 (patch) | |
tree | d1bf5a79a31b058ef5ab7c250a0cc06f4d56641e /drivers/net/dsa | |
parent | cf515802043cccecfe9ab75065f8fc71e6ec9bab (diff) |
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 <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/bcm_sf2.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index d6625783703f..ad22caba51e5 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c | |||
@@ -461,17 +461,11 @@ static int bcm_sf2_sw_set_eee(struct dsa_switch *ds, int port, | |||
461 | return 0; | 461 | return 0; |
462 | } | 462 | } |
463 | 463 | ||
464 | /* Fast-ageing of ARL entries for a given port, equivalent to an ARL | 464 | static int bcm_sf2_fast_age_op(struct bcm_sf2_priv *priv) |
465 | * flush for that port. | ||
466 | */ | ||
467 | static int bcm_sf2_sw_fast_age_port(struct dsa_switch *ds, int port) | ||
468 | { | 465 | { |
469 | struct bcm_sf2_priv *priv = ds_to_priv(ds); | ||
470 | unsigned int timeout = 1000; | 466 | unsigned int timeout = 1000; |
471 | u32 reg; | 467 | u32 reg; |
472 | 468 | ||
473 | core_writel(priv, port, CORE_FAST_AGE_PORT); | ||
474 | |||
475 | reg = core_readl(priv, CORE_FAST_AGE_CTRL); | 469 | reg = core_readl(priv, CORE_FAST_AGE_CTRL); |
476 | reg |= EN_AGE_PORT | EN_AGE_DYNAMIC | FAST_AGE_STR_DONE; | 470 | reg |= EN_AGE_PORT | EN_AGE_DYNAMIC | FAST_AGE_STR_DONE; |
477 | core_writel(priv, reg, CORE_FAST_AGE_CTRL); | 471 | 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 | return 0; | 486 | return 0; |
493 | } | 487 | } |
494 | 488 | ||
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 | |||
495 | static int bcm_sf2_sw_br_join(struct dsa_switch *ds, int port, | 501 | static int bcm_sf2_sw_br_join(struct dsa_switch *ds, int port, |
496 | struct net_device *bridge) | 502 | struct net_device *bridge) |
497 | { | 503 | { |