diff options
| author | Arun Ramadoss <[email protected]> | 2022-06-22 09:04:17 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-06-24 10:31:43 +0000 |
| commit | 1ca6437fafc9ffddda7a6fa9b61059bcf8774b10 (patch) | |
| tree | f70c58b6cf4c9ceaae4e2aa4e7efba580b2c8beb /drivers/net/dsa/microchip/ksz_common.h | |
| parent | net: dsa: microchip: move setup function to ksz_common (diff) | |
| download | kernel-1ca6437fafc9ffddda7a6fa9b61059bcf8774b10.tar.gz kernel-1ca6437fafc9ffddda7a6fa9b61059bcf8774b10.zip | |
net: dsa: microchip: move broadcast rate limit to ksz_setup
This patch move the 10% broadcast protection from the individual setup
to ksz_setup. In the ksz9477, broadcast protection is updated in reset
function.
Signed-off-by: Arun Ramadoss <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz_common.h')
| -rw-r--r-- | drivers/net/dsa/microchip/ksz_common.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index 3b8e1d1887b8..6aeee4771f06 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -47,6 +47,7 @@ struct ksz_chip_data { int mib_cnt; u8 reg_mib_cnt; int stp_ctrl_reg; + int broadcast_ctrl_reg; bool supports_mii[KSZ_MAX_NUM_PORTS]; bool supports_rmii[KSZ_MAX_NUM_PORTS]; bool supports_rgmii[KSZ_MAX_NUM_PORTS]; @@ -415,6 +416,16 @@ static inline void ksz_regmap_unlock(void *__mtx) #define SW_REV_ID_M GENMASK(7, 4) +/* Driver set switch broadcast storm protection at 10% rate. */ +#define BROADCAST_STORM_PROT_RATE 10 + +/* 148,800 frames * 67 ms / 100 */ +#define BROADCAST_STORM_VALUE 9969 + +#define BROADCAST_STORM_RATE_HI 0x07 +#define BROADCAST_STORM_RATE_LO 0xFF +#define BROADCAST_STORM_RATE 0x07FF + /* Regmap tables generation */ #define KSZ_SPI_OP_RD 3 #define KSZ_SPI_OP_WR 2 |
