/linux-6.1.9/drivers/net/ethernet/mellanox/mlxsw/ |
D | core.h | 29 struct mlxsw_core; 36 unsigned int mlxsw_core_max_ports(const struct mlxsw_core *mlxsw_core); 38 int mlxsw_core_max_lag(struct mlxsw_core *mlxsw_core, u16 *p_max_lag); 40 void *mlxsw_core_driver_priv(struct mlxsw_core *mlxsw_core); 42 struct mlxsw_linecards *mlxsw_core_linecards(struct mlxsw_core *mlxsw_core); 44 void mlxsw_core_linecards_set(struct mlxsw_core *mlxsw_core, 54 int mlxsw_core_fw_flash(struct mlxsw_core *mlxsw_core, 64 void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, bool reload); 90 bool mlxsw_core_skb_transmit_busy(struct mlxsw_core *mlxsw_core, 92 int mlxsw_core_skb_transmit(struct mlxsw_core *mlxsw_core, struct sk_buff *skb, [all …]
|
D | core.c | 65 struct mlxsw_core { struct 101 struct mlxsw_linecards *mlxsw_core_linecards(struct mlxsw_core *mlxsw_core) in mlxsw_core_linecards() argument 103 return mlxsw_core->linecards; in mlxsw_core_linecards() 106 void mlxsw_core_linecards_set(struct mlxsw_core *mlxsw_core, in mlxsw_core_linecards_set() argument 109 mlxsw_core->linecards = linecards; in mlxsw_core_linecards_set() 116 struct mlxsw_core *mlxsw_core = priv; in mlxsw_ports_occ_get() local 118 return atomic_read(&mlxsw_core->active_ports_count); in mlxsw_ports_occ_get() 121 static int mlxsw_core_resources_ports_register(struct mlxsw_core *mlxsw_core) in mlxsw_core_resources_ports_register() argument 123 struct devlink *devlink = priv_to_devlink(mlxsw_core); in mlxsw_core_resources_ports_register() 127 max_ports = mlxsw_core->max_ports - 1; in mlxsw_core_resources_ports_register() [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 | core_env.h | 12 int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, 17 struct mlxsw_core *mlxsw_core, u8 slot_index, 21 struct mlxsw_core *mlxsw_core, u8 slot_index, 26 mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core, 32 struct mlxsw_core *mlxsw_core, u8 slot_index, 36 mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, 42 mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index, 48 mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 slot_index, 51 void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 slot_index, 54 void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 slot_index, [all …]
|
D | core_linecards.c | 79 struct mlxsw_core *mlxsw_core = linecard->linecards->mlxsw_core; in mlxsw_linecard_type_name() local 84 err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddq), mddq_pl); in mlxsw_linecard_type_name() 93 struct mlxsw_core *mlxsw_core; member 107 struct mlxsw_core *mlxsw_core = info->mlxsw_core; in mlxsw_linecard_device_fw_component_query() local 118 err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddt), mddt_pl); in mlxsw_linecard_device_fw_component_query() 137 struct mlxsw_core *mlxsw_core = info->mlxsw_core; in mlxsw_linecard_device_fw_fsm_lock() local 148 err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mddt), mddt_pl); in mlxsw_linecard_device_fw_fsm_lock() 162 return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddt), mddt_pl); in mlxsw_linecard_device_fw_fsm_lock() 175 struct mlxsw_core *mlxsw_core = info->mlxsw_core; in mlxsw_linecard_device_fw_fsm_component_update() local 185 return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mddt), mddt_pl); in mlxsw_linecard_device_fw_fsm_component_update() [all …]
|
D | core_env.c | 31 struct mlxsw_core *core; 58 mlxsw_env_module_info *mlxsw_env_module_info_get(struct mlxsw_core *mlxsw_core, in mlxsw_env_module_info_get() argument 61 struct mlxsw_env *mlxsw_env = mlxsw_core_env(mlxsw_core); in mlxsw_env_module_info_get() 66 static int __mlxsw_env_validate_module_type(struct mlxsw_core *core, in __mlxsw_env_validate_module_type() 88 static int mlxsw_env_validate_module_type(struct mlxsw_core *core, in mlxsw_env_validate_module_type() 102 mlxsw_env_validate_cable_ident(struct mlxsw_core *core, u8 slot_index, int id, in mlxsw_env_validate_cable_ident() 145 mlxsw_env_query_module_eeprom(struct mlxsw_core *mlxsw_core, u8 slot_index, in mlxsw_env_query_module_eeprom() argument 194 err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mcia), mcia_pl); in mlxsw_env_query_module_eeprom() 210 mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core, u8 slot_index, in mlxsw_env_module_temp_thresholds_get() 292 struct mlxsw_core *mlxsw_core, u8 slot_index, in mlxsw_env_get_module_info() argument [all …]
|
D | minimal.c | 36 struct mlxsw_core *core; 121 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_info() 133 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_eeprom() 146 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_eeprom_by_page() 157 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_reset() 170 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_get_module_power_mode() 183 struct mlxsw_core *core = mlxsw_m_port->mlxsw_m->core; in mlxsw_m_set_module_power_mode() 557 mlxsw_m_ports_remove_selected(struct mlxsw_core *mlxsw_core, in mlxsw_m_ports_remove_selected() argument 561 struct mlxsw_m *mlxsw_m = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_m_ports_remove_selected() 593 mlxsw_m_got_active(struct mlxsw_core *mlxsw_core, u8 slot_index, void *priv) in mlxsw_m_got_active() argument [all …]
|
D | spectrum.c | 251 mlxsw_sp_txhdr_ptp_data_construct(struct mlxsw_core *mlxsw_core, in mlxsw_sp_txhdr_ptp_data_construct() argument 265 if (!MLXSW_CORE_RES_VALID(mlxsw_core, FID)) { in mlxsw_sp_txhdr_ptp_data_construct() 269 max_fid = MLXSW_CORE_RES_GET(mlxsw_core, FID); in mlxsw_sp_txhdr_ptp_data_construct() 300 static int mlxsw_sp_txhdr_handle(struct mlxsw_core *mlxsw_core, in mlxsw_sp_txhdr_handle() argument 305 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_txhdr_handle() 312 return mlxsw_sp->ptp_ops->txhdr_construct(mlxsw_core, in mlxsw_sp_txhdr_handle() 2093 mlxsw_sp_ports_remove_selected(struct mlxsw_core *mlxsw_core, in mlxsw_sp_ports_remove_selected() argument 2097 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_ports_remove_selected() 2098 unsigned int max_ports = mlxsw_core_max_ports(mlxsw_core); in mlxsw_sp_ports_remove_selected() 2255 static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u16 local_port, in mlxsw_sp_port_split() argument [all …]
|
D | spectrum_ptp.h | 60 int mlxsw_sp_ptp_txhdr_construct(struct mlxsw_core *mlxsw_core, 89 int mlxsw_sp2_ptp_txhdr_construct(struct mlxsw_core *mlxsw_core, 175 mlxsw_sp_ptp_txhdr_construct(struct mlxsw_core *mlxsw_core, in mlxsw_sp_ptp_txhdr_construct() argument 236 mlxsw_sp2_ptp_txhdr_construct(struct mlxsw_core *mlxsw_core, in mlxsw_sp2_ptp_txhdr_construct() argument
|
D | spectrum.h | 162 struct mlxsw_core *core; 246 int (*txhdr_construct)(struct mlxsw_core *mlxsw_core, 581 int mlxsw_sp_sb_pool_get(struct mlxsw_core *mlxsw_core, 584 int mlxsw_sp_sb_pool_set(struct mlxsw_core *mlxsw_core, 603 int mlxsw_sp_sb_occ_snapshot(struct mlxsw_core *mlxsw_core, 605 int mlxsw_sp_sb_occ_max_clear(struct mlxsw_core *mlxsw_core, 709 int mlxsw_sp_txhdr_ptp_data_construct(struct mlxsw_core *mlxsw_core, 841 int mlxsw_sp1_kvdl_resources_register(struct mlxsw_core *mlxsw_core); 1410 int mlxsw_sp_trap_init(struct mlxsw_core *mlxsw_core, 1412 void mlxsw_sp_trap_fini(struct mlxsw_core *mlxsw_core, [all …]
|
D | spectrum_ptp.c | 76 struct mlxsw_core *core; 114 struct mlxsw_core *mlxsw_core = clock->common.core; in __mlxsw_sp1_ptp_read_frc() local 117 frc_h1 = mlxsw_core_read_frc_h(mlxsw_core); in __mlxsw_sp1_ptp_read_frc() 119 frc_l = mlxsw_core_read_frc_l(mlxsw_core); in __mlxsw_sp1_ptp_read_frc() 121 frc_h2 = mlxsw_core_read_frc_h(mlxsw_core); in __mlxsw_sp1_ptp_read_frc() 126 frc_l = mlxsw_core_read_frc_l(mlxsw_core); in __mlxsw_sp1_ptp_read_frc() 144 struct mlxsw_core *mlxsw_core = clock->core; in mlxsw_sp_ptp_phc_adjfreq() local 149 return mlxsw_reg_write(mlxsw_core, MLXSW_REG(mtutc), mtutc_pl); in mlxsw_sp_ptp_phc_adjfreq() 165 struct mlxsw_core *mlxsw_core = clock->common.core; in mlxsw_sp1_ptp_phc_settime() local 179 err = mlxsw_reg_write(mlxsw_core, MLXSW_REG(mtpps), mtpps_pl); in mlxsw_sp1_ptp_phc_settime() [all …]
|
D | Makefile | 2 obj-$(CONFIG_MLXSW_CORE) += mlxsw_core.o 3 mlxsw_core-objs := core.o core_acl_flex_keys.o \ 6 mlxsw_core-$(CONFIG_MLXSW_CORE_HWMON) += core_hwmon.o 7 mlxsw_core-$(CONFIG_MLXSW_CORE_THERMAL) += core_thermal.o
|
D | spectrum_trap.c | 1543 int mlxsw_sp_trap_init(struct mlxsw_core *mlxsw_core, in mlxsw_sp_trap_init() argument 1546 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_trap_init() 1561 err = mlxsw_core_trap_register(mlxsw_core, listener, trap_ctx); in mlxsw_sp_trap_init() 1569 void mlxsw_sp_trap_fini(struct mlxsw_core *mlxsw_core, in mlxsw_sp_trap_fini() argument 1572 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_trap_fini() 1586 mlxsw_core_trap_unregister(mlxsw_core, listener, trap_ctx); in mlxsw_sp_trap_fini() 1590 int mlxsw_sp_trap_action_set(struct mlxsw_core *mlxsw_core, in mlxsw_sp_trap_action_set() argument 1595 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_trap_action_set() 1627 err = mlxsw_core_trap_state_set(mlxsw_core, listener, enabled); in mlxsw_sp_trap_action_set() 1636 __mlxsw_sp_trap_group_init(struct mlxsw_core *mlxsw_core, in __mlxsw_sp_trap_group_init() argument [all …]
|
D | spectrum_cnt.c | 242 int mlxsw_sp_counter_resources_register(struct mlxsw_core *mlxsw_core) in mlxsw_sp_counter_resources_register() argument 245 struct devlink *devlink = priv_to_devlink(mlxsw_core); in mlxsw_sp_counter_resources_register() 255 if (!MLXSW_CORE_RES_VALID(mlxsw_core, COUNTER_POOL_SIZE) || in mlxsw_sp_counter_resources_register() 256 !MLXSW_CORE_RES_VALID(mlxsw_core, COUNTER_BANK_SIZE)) in mlxsw_sp_counter_resources_register() 259 pool_size = MLXSW_CORE_RES_GET(mlxsw_core, COUNTER_POOL_SIZE); in mlxsw_sp_counter_resources_register() 260 bank_size = MLXSW_CORE_RES_GET(mlxsw_core, COUNTER_BANK_SIZE); in mlxsw_sp_counter_resources_register()
|
D | spectrum_policer.c | 82 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()
|
D | spectrum_buffers.c | 288 static void mlxsw_sp_sb_pm_occ_query_cb(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_pm_occ_query_cb() argument 1354 int mlxsw_sp_sb_pool_get(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_pool_get() argument 1358 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_sb_pool_get() 1371 int mlxsw_sp_sb_pool_set(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_pool_set() argument 1376 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_sb_pool_set() 1558 static void mlxsw_sp_sb_sr_occ_query_cb(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_sr_occ_query_cb() argument 1562 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core); in mlxsw_sp_sb_sr_occ_query_cb() 1574 local_port < mlxsw_core_max_ports(mlxsw_core); local_port++) { in mlxsw_sp_sb_sr_occ_query_cb() 1593 local_port < mlxsw_core_max_ports(mlxsw_core); local_port++) { in mlxsw_sp_sb_sr_occ_query_cb() 1607 int mlxsw_sp_sb_occ_snapshot(struct mlxsw_core *mlxsw_core, in mlxsw_sp_sb_occ_snapshot() argument [all …]
|
D | spectrum_cnt.h | 23 int mlxsw_sp_counter_resources_register(struct mlxsw_core *mlxsw_core);
|
D | spectrum1_kvdl.c | 385 int mlxsw_sp1_kvdl_resources_register(struct mlxsw_core *mlxsw_core) in mlxsw_sp1_kvdl_resources_register() argument 387 struct devlink *devlink = priv_to_devlink(mlxsw_core); in mlxsw_sp1_kvdl_resources_register() 392 kvdl_max_size = MLXSW_CORE_RES_GET(mlxsw_core, KVD_SIZE) - in mlxsw_sp1_kvdl_resources_register() 393 MLXSW_CORE_RES_GET(mlxsw_core, KVD_SINGLE_MIN_SIZE) - in mlxsw_sp1_kvdl_resources_register() 394 MLXSW_CORE_RES_GET(mlxsw_core, KVD_DOUBLE_MIN_SIZE); in mlxsw_sp1_kvdl_resources_register()
|
D | core_thermal.c | 96 struct mlxsw_core *core; 145 mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core, in mlxsw_thermal_module_trips_update() 382 mlxsw_thermal_module_temp_and_thresholds_get(struct mlxsw_core *core, in mlxsw_thermal_module_temp_and_thresholds_get() 646 mlxsw_thermal_module_init(struct device *dev, struct mlxsw_core *core, in mlxsw_thermal_module_init() 685 mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core, in mlxsw_thermal_modules_init() 783 mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core, in mlxsw_thermal_gearboxes_init() 845 mlxsw_thermal_got_active(struct mlxsw_core *mlxsw_core, u8 slot_index, in mlxsw_thermal_got_active() argument 883 mlxsw_thermal_got_inactive(struct mlxsw_core *mlxsw_core, u8 slot_index, in mlxsw_thermal_got_inactive() argument 902 int mlxsw_thermal_init(struct mlxsw_core *core, in mlxsw_thermal_init()
|
D | core_hwmon.c | 60 struct mlxsw_core *core; 787 mlxsw_hwmon_got_active(struct mlxsw_core *mlxsw_core, u8 slot_index, in mlxsw_hwmon_got_active() argument 835 mlxsw_hwmon_got_inactive(struct mlxsw_core *mlxsw_core, u8 slot_index, in mlxsw_hwmon_got_inactive() argument 855 int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core, in mlxsw_hwmon_init() argument 866 err = mlxsw_reg_query(mlxsw_core, MLXSW_REG(mgpir), mgpir_pl); in mlxsw_hwmon_init() 878 mlxsw_hwmon->core = mlxsw_core; in mlxsw_hwmon_init()
|
D | i2c.c | 89 struct mlxsw_core *core; 526 mlxsw_i2c_init(void *bus_priv, struct mlxsw_core *mlxsw_core, in mlxsw_i2c_init() argument 534 mlxsw_i2c->core = mlxsw_core; in mlxsw_i2c_init() 540 err = mlxsw_cmd_query_fw(mlxsw_core, mbox); in mlxsw_i2c_init() 551 err = mlxsw_core_resources_query(mlxsw_core, mbox, res); in mlxsw_i2c_init()
|
D | pci.c | 110 struct mlxsw_core *core; 1507 static int mlxsw_pci_init(void *bus_priv, struct mlxsw_core *mlxsw_core, in mlxsw_pci_init() argument 1517 mlxsw_pci->core = mlxsw_core; in mlxsw_pci_init() 1533 err = mlxsw_cmd_query_fw(mlxsw_core, mbox); in mlxsw_pci_init() 1594 err = mlxsw_core_resources_query(mlxsw_core, mbox, res); in mlxsw_pci_init() 1598 if (MLXSW_CORE_RES_VALID(mlxsw_core, CQE_V2) && in mlxsw_pci_init() 1599 MLXSW_CORE_RES_GET(mlxsw_core, CQE_V2)) in mlxsw_pci_init() 1601 else if (MLXSW_CORE_RES_VALID(mlxsw_core, CQE_V1) && in mlxsw_pci_init() 1602 MLXSW_CORE_RES_GET(mlxsw_core, CQE_V1)) in mlxsw_pci_init() 1604 else if ((MLXSW_CORE_RES_VALID(mlxsw_core, CQE_V0) && in mlxsw_pci_init() [all …]
|
D | Kconfig | 15 module will be called mlxsw_core.
|
D | spectrum_ethtool.c | 571 struct mlxsw_core *mlxsw_core = mlxsw_sp_port->mlxsw_sp->core; in mlxsw_sp_port_get_transceiver_overheat_stats() local 577 err = mlxsw_env_module_overheat_counter_get(mlxsw_core, slot_index, in mlxsw_sp_port_get_transceiver_overheat_stats()
|
D | spectrum_router.c | 9947 struct mlxsw_core *core = mlxsw_sp->core; in mlxsw_sp_rifs_init()
|