diff options
author | Nogah Frankel <nogahf@mellanox.com> | 2016-11-25 10:33:40 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-25 21:22:14 -0500 |
commit | 9d87fceac6e1a7885e3f7766de3ec2ab7d152aa2 (patch) | |
tree | 290ae3a750c84d756d6ad748b1d0cfe8a74ab308 /drivers/net/ethernet/mellanox/mlxsw/switchib.c | |
parent | 0fb78a4e9c8563e1f95358794bd168c5c1e72009 (diff) |
mlxsw: core: Change emad trap group settings
Currently, the emad trap init was done in the core. In the future we will
want to add some changes to the traps groups, according to device type.
This commit create a driver function to create the trap group for the
emad, so later it can be changed by devices. It also changes the emad
registration to use the new generic functions.
Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/switchib.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/switchib.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchib.c b/drivers/net/ethernet/mellanox/mlxsw/switchib.c index b798711a9c78..9a5f829239cb 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/switchib.c +++ b/drivers/net/ethernet/mellanox/mlxsw/switchib.c @@ -447,6 +447,14 @@ static void mlxsw_sib_traps_fini(struct mlxsw_sib *mlxsw_sib) } } +static int mlxsw_sib_basic_trap_groups_set(struct mlxsw_core *mlxsw_core) +{ + char htgt_pl[MLXSW_REG_HTGT_LEN]; + + mlxsw_reg_htgt_pack(htgt_pl, MLXSW_REG_HTGT_TRAP_GROUP_EMAD); + return mlxsw_reg_write(mlxsw_core, MLXSW_REG(htgt), htgt_pl); +} + static int mlxsw_sib_init(struct mlxsw_core *mlxsw_core, const struct mlxsw_bus_info *mlxsw_bus_info) { @@ -504,6 +512,7 @@ static struct mlxsw_driver mlxsw_sib_driver = { .priv_size = sizeof(struct mlxsw_sib), .init = mlxsw_sib_init, .fini = mlxsw_sib_fini, + .basic_trap_groups_set = mlxsw_sib_basic_trap_groups_set, .txhdr_construct = mlxsw_sib_tx_v1_hdr_construct, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sib_config_profile, @@ -514,6 +523,7 @@ static struct mlxsw_driver mlxsw_sib2_driver = { .priv_size = sizeof(struct mlxsw_sib), .init = mlxsw_sib_init, .fini = mlxsw_sib_fini, + .basic_trap_groups_set = mlxsw_sib_basic_trap_groups_set, .txhdr_construct = mlxsw_sib_tx_v1_hdr_construct, .txhdr_len = MLXSW_TXHDR_LEN, .profile = &mlxsw_sib_config_profile, |