Home
last modified time | relevance | path

Searched refs:mlxsw_core (Results 1 – 24 of 24) sorted by relevance

/Linux-v5.10/drivers/net/ethernet/mellanox/mlxsw/
Dcore.h22 struct mlxsw_core;
29 unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core);
31 void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core);
33 bool mlxsw_core_res_query_enabled(const struct mlxsw_core *mlxsw_core);
35 bool mlxsw_core_temp_warn_enabled(const struct mlxsw_core *mlxsw_core);
49 void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, bool reload);
56 bool mlxsw_core_skb_transmit_busy(struct mlxsw_core *mlxsw_core,
58 int mlxsw_core_skb_transmit(struct mlxsw_core *mlxsw_core, struct sk_buff *skb,
60 void mlxsw_core_ptp_transmitted(struct mlxsw_core *mlxsw_core,
142 int mlxsw_core_rx_listener_register(struct mlxsw_core *mlxsw_core,
[all …]
Dcore.c64 struct mlxsw_core { struct
99 static int mlxsw_ports_init(struct mlxsw_core *mlxsw_core) in mlxsw_ports_init() argument
102 if (MLXSW_CORE_RES_VALID(mlxsw_core, MAX_SYSTEM_PORT)) in mlxsw_ports_init()
103 mlxsw_core->max_ports = MLXSW_CORE_RES_GET(mlxsw_core, in mlxsw_ports_init()
106 mlxsw_core->max_ports = MLXSW_PORT_MAX_PORTS_DEFAULT + 1; in mlxsw_ports_init()
108 mlxsw_core->ports = kcalloc(mlxsw_core->max_ports, in mlxsw_ports_init()
110 if (!mlxsw_core->ports) in mlxsw_ports_init()
116 static void mlxsw_ports_fini(struct mlxsw_core *mlxsw_core) in mlxsw_ports_fini() argument
118 kfree(mlxsw_core->ports); in mlxsw_ports_fini()
121 unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core) in mlxsw_core_max_ports() argument
[all …]
Dcmd.h26 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 …]
Dcore_env.c19 struct mlxsw_core *core;
25 static int mlxsw_env_validate_cable_ident(struct mlxsw_core *core, int id, in mlxsw_env_validate_cable_ident()
62 mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, int module, in mlxsw_env_query_module_eeprom() argument
110 err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mcia), mcia_pl); in mlxsw_env_query_module_eeprom()
125 int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module, in mlxsw_env_module_temp_thresholds_get()
195 int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module, in mlxsw_env_get_module_info() argument
204 err = mlxsw_env_query_module_eeprom(mlxsw_core, module, 0, offset, in mlxsw_env_get_module_info()
234 err = mlxsw_env_query_module_eeprom(mlxsw_core, module, in mlxsw_env_get_module_info()
274 struct mlxsw_core *mlxsw_core, int module, in mlxsw_env_get_module_eeprom() argument
288 err = mlxsw_env_validate_cable_ident(mlxsw_core, module, &qsfp, &cmis); in mlxsw_env_get_module_eeprom()
[all …]
Dcore_env.h7 int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, int module,
10 int mlxsw_env_get_module_info(struct mlxsw_core *mlxsw_core, int module,
14 struct mlxsw_core *mlxsw_core, int module,
18 mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 module,
20 int mlxsw_env_init(struct mlxsw_core *core, struct mlxsw_env **p_env);
Dspectrum.c1874 static int mlxsw_sp_local_ports_offset(struct mlxsw_core *mlxsw_core, in mlxsw_sp_local_ports_offset() argument
1890 if (!mlxsw_core_res_valid(mlxsw_core, local_ports_in_x_res_id)) in mlxsw_sp_local_ports_offset()
1892 return mlxsw_core_res_get(mlxsw_core, local_ports_in_x_res_id); in mlxsw_sp_local_ports_offset()
1903 static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port, in mlxsw_sp_port_split() argument
1907 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_port_split()
1924 max_width = mlxsw_core_module_max_width(mlxsw_core, in mlxsw_sp_port_split()
1939 offset = mlxsw_sp_local_ports_offset(mlxsw_core, count, max_width); in mlxsw_sp_port_split()
1987 static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port, in mlxsw_sp_port_unsplit() argument
1990 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_port_unsplit()
2012 max_width = mlxsw_core_module_max_width(mlxsw_core, in mlxsw_sp_port_unsplit()
[all …]
Dspectrum.h144 struct mlxsw_core *core;
487 int mlxsw_sp_sb_pool_get(struct mlxsw_core *mlxsw_core,
490 int mlxsw_sp_sb_pool_set(struct mlxsw_core *mlxsw_core,
509 int mlxsw_sp_sb_occ_snapshot(struct mlxsw_core *mlxsw_core,
511 int mlxsw_sp_sb_occ_max_clear(struct mlxsw_core *mlxsw_core,
729 int mlxsw_sp1_kvdl_resources_register(struct mlxsw_core *mlxsw_core);
1228 int mlxsw_sp_trap_init(struct mlxsw_core *mlxsw_core,
1230 void mlxsw_sp_trap_fini(struct mlxsw_core *mlxsw_core,
1232 int mlxsw_sp_trap_action_set(struct mlxsw_core *mlxsw_core,
1236 int mlxsw_sp_trap_group_init(struct mlxsw_core *mlxsw_core,
[all …]
Dspectrum_trap.c1391 int mlxsw_sp_trap_init(struct mlxsw_core *mlxsw_core, in mlxsw_sp_trap_init() argument
1394 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_trap_init()
1409 err = mlxsw_core_trap_register(mlxsw_core, listener, trap_ctx); in mlxsw_sp_trap_init()
1417 void mlxsw_sp_trap_fini(struct mlxsw_core *mlxsw_core, in mlxsw_sp_trap_fini() argument
1420 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_trap_fini()
1434 mlxsw_core_trap_unregister(mlxsw_core, listener, trap_ctx); in mlxsw_sp_trap_fini()
1438 int mlxsw_sp_trap_action_set(struct mlxsw_core *mlxsw_core, in mlxsw_sp_trap_action_set() argument
1443 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_trap_action_set()
1475 err = mlxsw_core_trap_state_set(mlxsw_core, listener, enabled); in mlxsw_sp_trap_action_set()
1484 __mlxsw_sp_trap_group_init(struct mlxsw_core *mlxsw_core, in __mlxsw_sp_trap_group_init() argument
[all …]
Dminimal.c32 struct mlxsw_core *core;
99 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_info()
109 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_eeprom()
355 static int mlxsw_m_init(struct mlxsw_core *mlxsw_core, in mlxsw_m_init() argument
359 struct mlxsw_m *mlxsw_m = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_m_init()
362 mlxsw_m->core = mlxsw_core; in mlxsw_m_init()
384 static void mlxsw_m_fini(struct mlxsw_core *mlxsw_core) in mlxsw_m_fini() argument
386 struct mlxsw_m *mlxsw_m = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_m_fini()
DMakefile2 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
Dswitchib.c31 struct mlxsw_core *core;
434 static int mlxsw_sib_basic_trap_groups_set(struct mlxsw_core *mlxsw_core) in mlxsw_sib_basic_trap_groups_set() argument
445 return mlxsw_reg_write(mlxsw_core, MLXSW_REG(htgt), htgt_pl); in mlxsw_sib_basic_trap_groups_set()
448 static int mlxsw_sib_init(struct mlxsw_core *mlxsw_core, in mlxsw_sib_init() argument
452 struct mlxsw_sib *mlxsw_sib = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sib_init()
455 mlxsw_sib->core = mlxsw_core; in mlxsw_sib_init()
483 static void mlxsw_sib_fini(struct mlxsw_core *mlxsw_core) in mlxsw_sib_fini() argument
485 struct mlxsw_sib *mlxsw_sib = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sib_fini()
Dspectrum_cnt.c245 int mlxsw_sp_counter_resources_register(struct mlxsw_core *mlxsw_core) in mlxsw_sp_counter_resources_register() argument
248 struct devlink *devlink = priv_to_devlink(mlxsw_core); in mlxsw_sp_counter_resources_register()
258 if (!MLXSW_CORE_RES_VALID(mlxsw_core, COUNTER_POOL_SIZE) || in mlxsw_sp_counter_resources_register()
259 !MLXSW_CORE_RES_VALID(mlxsw_core, COUNTER_BANK_SIZE)) in mlxsw_sp_counter_resources_register()
262 pool_size = MLXSW_CORE_RES_GET(mlxsw_core, COUNTER_POOL_SIZE); in mlxsw_sp_counter_resources_register()
263 bank_size = MLXSW_CORE_RES_GET(mlxsw_core, COUNTER_BANK_SIZE); in mlxsw_sp_counter_resources_register()
Dspectrum_policer.c82 struct mlxsw_core *core = family->mlxsw_sp->core; in mlxsw_sp_policer_single_rate_family_init()
404 int mlxsw_sp_policer_resources_register(struct mlxsw_core *mlxsw_core) in mlxsw_sp_policer_resources_register() argument
407 struct devlink *devlink = priv_to_devlink(mlxsw_core); in mlxsw_sp_policer_resources_register()
411 if (!MLXSW_CORE_RES_VALID(mlxsw_core, MAX_GLOBAL_POLICERS) || in mlxsw_sp_policer_resources_register()
412 !MLXSW_CORE_RES_VALID(mlxsw_core, MAX_CPU_POLICERS)) in mlxsw_sp_policer_resources_register()
415 global_policers = MLXSW_CORE_RES_GET(mlxsw_core, MAX_GLOBAL_POLICERS); in mlxsw_sp_policer_resources_register()
416 cpu_policers = MLXSW_CORE_RES_GET(mlxsw_core, MAX_CPU_POLICERS); in mlxsw_sp_policer_resources_register()
Dspectrum_cnt.h23 int mlxsw_sp_counter_resources_register(struct mlxsw_core *mlxsw_core);
Dspectrum_buffers.c273 static void mlxsw_sp_sb_pm_occ_query_cb(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_pm_occ_query_cb() argument
1328 int mlxsw_sp_sb_pool_get(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_pool_get() argument
1332 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_sb_pool_get()
1345 int mlxsw_sp_sb_pool_set(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_pool_set() argument
1350 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_sb_pool_set()
1532 static void mlxsw_sp_sb_sr_occ_query_cb(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_sr_occ_query_cb() argument
1536 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_sb_sr_occ_query_cb()
1548 local_port < mlxsw_core_max_ports(mlxsw_core); local_port++) { in mlxsw_sp_sb_sr_occ_query_cb()
1567 local_port < mlxsw_core_max_ports(mlxsw_core); local_port++) { in mlxsw_sp_sb_sr_occ_query_cb()
1581 int mlxsw_sp_sb_occ_snapshot(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_occ_snapshot() argument
[all …]
Dspectrum_ptp.c62 struct mlxsw_core *core;
76 struct mlxsw_core *mlxsw_core = clock->core; in __mlxsw_sp1_ptp_read_frc() local
79 frc_h1 = mlxsw_core_read_frc_h(mlxsw_core); in __mlxsw_sp1_ptp_read_frc()
81 frc_l = mlxsw_core_read_frc_l(mlxsw_core); in __mlxsw_sp1_ptp_read_frc()
83 frc_h2 = mlxsw_core_read_frc_h(mlxsw_core); in __mlxsw_sp1_ptp_read_frc()
88 frc_l = mlxsw_core_read_frc_l(mlxsw_core); in __mlxsw_sp1_ptp_read_frc()
106 struct mlxsw_core *mlxsw_core = clock->core; in mlxsw_sp1_ptp_phc_adjfreq() local
111 return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mtutc), mtutc_pl); in mlxsw_sp1_ptp_phc_adjfreq()
127 struct mlxsw_core *mlxsw_core = clock->core; in mlxsw_sp1_ptp_phc_settime() local
141 err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mtpps), mtpps_pl); in mlxsw_sp1_ptp_phc_settime()
[all …]
Dspectrum1_kvdl.c386 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()
Di2c.c76 struct mlxsw_core *core;
510 mlxsw_i2c_init(void *bus_priv, struct mlxsw_core *mlxsw_core, in mlxsw_i2c_init() argument
518 mlxsw_i2c->core = mlxsw_core; in mlxsw_i2c_init()
524 err = mlxsw_cmd_query_fw(mlxsw_core, mbox); in mlxsw_i2c_init()
535 err = mlxsw_core_resources_query(mlxsw_core, mbox, res); in mlxsw_i2c_init()
Dswitchx2.c30 struct mlxsw_core *core;
1351 static int mlxsw_sx_port_type_set(struct mlxsw_core *mlxsw_core, u8 local_port, in mlxsw_sx_port_type_set() argument
1354 struct mlxsw_sx *mlxsw_sx = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sx_port_type_set()
1537 static int mlxsw_sx_basic_trap_groups_set(struct mlxsw_core *mlxsw_core) in mlxsw_sx_basic_trap_groups_set() argument
1548 return mlxsw_reg_write(mlxsw_core, MLXSW_REG(htgt), htgt_pl); in mlxsw_sx_basic_trap_groups_set()
1551 static int mlxsw_sx_init(struct mlxsw_core *mlxsw_core, in mlxsw_sx_init() argument
1555 struct mlxsw_sx *mlxsw_sx = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sx_init()
1558 mlxsw_sx->core = mlxsw_core; in mlxsw_sx_init()
1594 static void mlxsw_sx_fini(struct mlxsw_core *mlxsw_core) in mlxsw_sx_fini() argument
1596 struct mlxsw_sx *mlxsw_sx = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sx_fini()
Dpci.c108 struct mlxsw_core *core;
1411 static int mlxsw_pci_init(void *bus_priv, struct mlxsw_core *mlxsw_core, in mlxsw_pci_init() argument
1421 mlxsw_pci->core = mlxsw_core; in mlxsw_pci_init()
1437 err = mlxsw_cmd_query_fw(mlxsw_core, mbox); in mlxsw_pci_init()
1480 err = mlxsw_core_resources_query(mlxsw_core, mbox, res); in mlxsw_pci_init()
1484 if (MLXSW_CORE_RES_VALID(mlxsw_core, CQE_V2) && in mlxsw_pci_init()
1485 MLXSW_CORE_RES_GET(mlxsw_core, CQE_V2)) in mlxsw_pci_init()
1487 else if (MLXSW_CORE_RES_VALID(mlxsw_core, CQE_V1) && in mlxsw_pci_init()
1488 MLXSW_CORE_RES_GET(mlxsw_core, CQE_V1)) in mlxsw_pci_init()
1490 else if ((MLXSW_CORE_RES_VALID(mlxsw_core, CQE_V0) && in mlxsw_pci_init()
[all …]
Dcore_thermal.c105 struct mlxsw_core *core;
161 mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, in mlxsw_thermal_module_trips_update()
727 mlxsw_thermal_module_init(struct device *dev, struct mlxsw_core *core, in mlxsw_thermal_module_init()
756 mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, in mlxsw_thermal_modules_init()
848 mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, in mlxsw_thermal_gearboxes_init()
912 int mlxsw_thermal_init(struct mlxsw_core *core, in mlxsw_thermal_init()
Dcore_hwmon.c44 struct mlxsw_core *core;
752 int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, in mlxsw_hwmon_init() argument
763 mlxsw_hwmon->core = mlxsw_core; in mlxsw_hwmon_init()
DKconfig14 module will be called mlxsw_core.
Dspectrum_ethtool.c565 struct mlxsw_core *mlxsw_core = mlxsw_sp_port->mlxsw_sp->core; in mlxsw_sp_port_get_transceiver_overheat_stats() local
569 err = mlxsw_env_module_overheat_counter_get(mlxsw_core, in mlxsw_sp_port_get_transceiver_overheat_stats()