/Linux-v4.19/drivers/net/ethernet/mellanox/mlxsw/ |
D | core.h | 21 struct mlxsw_core; 27 unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core); 29 void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core); 38 void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, bool reload); 45 bool mlxsw_core_skb_transmit_busy(struct mlxsw_core *mlxsw_core, 47 int mlxsw_core_skb_transmit(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, 107 int mlxsw_core_rx_listener_register(struct mlxsw_core *mlxsw_core, 110 void mlxsw_core_rx_listener_unregister(struct mlxsw_core *mlxsw_core, 114 int mlxsw_core_event_listener_register(struct mlxsw_core *mlxsw_core, 117 void mlxsw_core_event_listener_unregister(struct mlxsw_core *mlxsw_core, [all …]
|
D | core.c | 61 struct mlxsw_core { struct 90 static int mlxsw_ports_init(struct mlxsw_core *mlxsw_core) in mlxsw_ports_init() argument 93 if (MLXSW_CORE_RES_VALID(mlxsw_core, MAX_SYSTEM_PORT)) in mlxsw_ports_init() 94 mlxsw_core->max_ports = MLXSW_CORE_RES_GET(mlxsw_core, in mlxsw_ports_init() 97 mlxsw_core->max_ports = MLXSW_PORT_MAX_PORTS_DEFAULT + 1; in mlxsw_ports_init() 99 mlxsw_core->ports = kcalloc(mlxsw_core->max_ports, in mlxsw_ports_init() 101 if (!mlxsw_core->ports) in mlxsw_ports_init() 107 static void mlxsw_ports_fini(struct mlxsw_core *mlxsw_core) in mlxsw_ports_fini() argument 109 kfree(mlxsw_core->ports); in mlxsw_ports_fini() 112 unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core) in mlxsw_core_max_ports() argument [all …]
|
D | cmd.h | 26 struct mlxsw_core; 28 int mlxsw_cmd_exec(struct mlxsw_core *mlxsw_core, u16 opcode, u8 opcode_mod, 33 static inline int mlxsw_cmd_exec_in(struct mlxsw_core *mlxsw_core, u16 opcode, in mlxsw_cmd_exec_in() argument 37 return mlxsw_cmd_exec(mlxsw_core, opcode, opcode_mod, in_mod, false, in mlxsw_cmd_exec_in() 41 static inline int mlxsw_cmd_exec_out(struct mlxsw_core *mlxsw_core, u16 opcode, in mlxsw_cmd_exec_out() argument 46 return mlxsw_cmd_exec(mlxsw_core, opcode, opcode_mod, in_mod, in mlxsw_cmd_exec_out() 51 static inline int mlxsw_cmd_exec_none(struct mlxsw_core *mlxsw_core, u16 opcode, in mlxsw_cmd_exec_none() argument 54 return mlxsw_cmd_exec(mlxsw_core, opcode, opcode_mod, in_mod, false, in mlxsw_cmd_exec_none() 199 static inline int mlxsw_cmd_query_fw(struct mlxsw_core *mlxsw_core, in mlxsw_cmd_query_fw() argument 202 return mlxsw_cmd_exec_out(mlxsw_core, MLXSW_CMD_OPCODE_QUERY_FW, in mlxsw_cmd_query_fw() [all …]
|
D | spectrum_buffers.c | 156 static void mlxsw_sp_sb_pm_occ_query_cb(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_pm_occ_query_cb() argument 656 int mlxsw_sp_sb_pool_get(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_pool_get() argument 660 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_sb_pool_get() 671 int mlxsw_sp_sb_pool_set(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_pool_set() argument 675 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_sb_pool_set() 815 static void mlxsw_sp_sb_sr_occ_query_cb(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_sr_occ_query_cb() argument 819 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_sb_sr_occ_query_cb() 831 local_port < mlxsw_core_max_ports(mlxsw_core); local_port++) { in mlxsw_sp_sb_sr_occ_query_cb() 845 local_port < mlxsw_core_max_ports(mlxsw_core); local_port++) { in mlxsw_sp_sb_sr_occ_query_cb() 859 int mlxsw_sp_sb_occ_snapshot(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_occ_snapshot() argument [all …]
|
D | Makefile | 2 obj-$(CONFIG_MLXSW_CORE) += mlxsw_core.o 3 mlxsw_core-objs := core.o core_acl_flex_keys.o \ 5 mlxsw_core-$(CONFIG_MLXSW_CORE_HWMON) += core_hwmon.o 6 mlxsw_core-$(CONFIG_MLXSW_CORE_THERMAL) += core_thermal.o
|
D | switchib.c | 31 struct mlxsw_core *core; 419 static int mlxsw_sib_basic_trap_groups_set(struct mlxsw_core *mlxsw_core) in mlxsw_sib_basic_trap_groups_set() argument 430 return mlxsw_reg_write(mlxsw_core, MLXSW_REG(htgt), htgt_pl); in mlxsw_sib_basic_trap_groups_set() 433 static int mlxsw_sib_init(struct mlxsw_core *mlxsw_core, in mlxsw_sib_init() argument 436 struct mlxsw_sib *mlxsw_sib = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sib_init() 439 mlxsw_sib->core = mlxsw_core; in mlxsw_sib_init() 461 static void mlxsw_sib_fini(struct mlxsw_core *mlxsw_core) in mlxsw_sib_fini() argument 463 struct mlxsw_sib *mlxsw_sib = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sib_fini()
|
D | spectrum.h | 122 struct mlxsw_core *core; 281 int mlxsw_sp_sb_pool_get(struct mlxsw_core *mlxsw_core, 284 int mlxsw_sp_sb_pool_set(struct mlxsw_core *mlxsw_core, 301 int mlxsw_sp_sb_occ_snapshot(struct mlxsw_core *mlxsw_core, 303 int mlxsw_sp_sb_occ_max_clear(struct mlxsw_core *mlxsw_core, 473 int mlxsw_sp1_kvdl_resources_register(struct mlxsw_core *mlxsw_core);
|
D | spectrum.c | 3182 static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port, in mlxsw_sp_port_split() argument 3186 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_port_split() 3250 static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port, in mlxsw_sp_port_unsplit() argument 3253 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_port_unsplit() 3477 static int mlxsw_sp_cpu_policers_set(struct mlxsw_core *mlxsw_core) in mlxsw_sp_cpu_policers_set() argument 3487 if (!MLXSW_CORE_RES_VALID(mlxsw_core, MAX_CPU_POLICERS)) in mlxsw_sp_cpu_policers_set() 3490 max_cpu_policers = MLXSW_CORE_RES_GET(mlxsw_core, MAX_CPU_POLICERS); in mlxsw_sp_cpu_policers_set() 3532 err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(qpcr), qpcr_pl); in mlxsw_sp_cpu_policers_set() 3540 static int mlxsw_sp_trap_groups_set(struct mlxsw_core *mlxsw_core) in mlxsw_sp_trap_groups_set() argument 3550 if (!MLXSW_CORE_RES_VALID(mlxsw_core, MAX_TRAP_GROUPS)) in mlxsw_sp_trap_groups_set() [all …]
|
D | spectrum1_kvdl.c | 386 int mlxsw_sp1_kvdl_resources_register(struct mlxsw_core *mlxsw_core) in mlxsw_sp1_kvdl_resources_register() argument 388 struct devlink *devlink = priv_to_devlink(mlxsw_core); in mlxsw_sp1_kvdl_resources_register() 393 kvdl_max_size = MLXSW_CORE_RES_GET(mlxsw_core, KVD_SIZE) - in mlxsw_sp1_kvdl_resources_register() 394 MLXSW_CORE_RES_GET(mlxsw_core, KVD_SINGLE_MIN_SIZE) - in mlxsw_sp1_kvdl_resources_register() 395 MLXSW_CORE_RES_GET(mlxsw_core, KVD_DOUBLE_MIN_SIZE); in mlxsw_sp1_kvdl_resources_register()
|
D | switchx2.c | 31 struct mlxsw_core *core; 1402 static int mlxsw_sx_port_type_set(struct mlxsw_core *mlxsw_core, u8 local_port, in mlxsw_sx_port_type_set() argument 1405 struct mlxsw_sx *mlxsw_sx = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sx_port_type_set() 1577 static int mlxsw_sx_basic_trap_groups_set(struct mlxsw_core *mlxsw_core) in mlxsw_sx_basic_trap_groups_set() argument 1588 return mlxsw_reg_write(mlxsw_core, MLXSW_REG(htgt), htgt_pl); in mlxsw_sx_basic_trap_groups_set() 1591 static int mlxsw_sx_init(struct mlxsw_core *mlxsw_core, in mlxsw_sx_init() argument 1594 struct mlxsw_sx *mlxsw_sx = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sx_init() 1597 mlxsw_sx->core = mlxsw_core; in mlxsw_sx_init() 1633 static void mlxsw_sx_fini(struct mlxsw_core *mlxsw_core) in mlxsw_sx_fini() argument 1635 struct mlxsw_sx *mlxsw_sx = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sx_fini()
|
D | core_hwmon.c | 25 struct mlxsw_core *core; 298 int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, in mlxsw_hwmon_init() argument 309 mlxsw_hwmon->core = mlxsw_core; in mlxsw_hwmon_init()
|
D | i2c.c | 68 struct mlxsw_core *core; 415 mlxsw_i2c_init(void *bus_priv, struct mlxsw_core *mlxsw_core, in mlxsw_i2c_init() argument 421 mlxsw_i2c->core = mlxsw_core; in mlxsw_i2c_init()
|
D | pci.c | 107 struct mlxsw_core *core; 1389 static int mlxsw_pci_init(void *bus_priv, struct mlxsw_core *mlxsw_core, in mlxsw_pci_init() argument 1402 mlxsw_pci->core = mlxsw_core; in mlxsw_pci_init() 1426 err = mlxsw_cmd_query_fw(mlxsw_core, mbox); in mlxsw_pci_init() 1464 if (MLXSW_CORE_RES_VALID(mlxsw_core, CQE_V2) && in mlxsw_pci_init() 1465 MLXSW_CORE_RES_GET(mlxsw_core, CQE_V2)) in mlxsw_pci_init() 1467 else if (MLXSW_CORE_RES_VALID(mlxsw_core, CQE_V1) && in mlxsw_pci_init() 1468 MLXSW_CORE_RES_GET(mlxsw_core, CQE_V1)) in mlxsw_pci_init() 1470 else if ((MLXSW_CORE_RES_VALID(mlxsw_core, CQE_V0) && in mlxsw_pci_init() 1471 MLXSW_CORE_RES_GET(mlxsw_core, CQE_V0)) || in mlxsw_pci_init() [all …]
|
D | core_thermal.c | 67 struct mlxsw_core *core; 309 int mlxsw_thermal_init(struct mlxsw_core *core, in mlxsw_thermal_init()
|
D | Kconfig | 12 module will be called mlxsw_core.
|