75 lines · c
1/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */2/* Copyright (c) 2018 Mellanox Technologies. All rights reserved */3 4#ifndef _MLXSW_CORE_ENV_H5#define _MLXSW_CORE_ENV_H6 7#include <linux/ethtool.h>8 9struct ethtool_modinfo;10struct ethtool_eeprom;11 12int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core,13 u8 slot_index, int module, int off,14 int *temp);15 16int mlxsw_env_get_module_info(struct net_device *netdev,17 struct mlxsw_core *mlxsw_core, u8 slot_index,18 int module, struct ethtool_modinfo *modinfo);19 20int mlxsw_env_get_module_eeprom(struct net_device *netdev,21 struct mlxsw_core *mlxsw_core, u8 slot_index,22 int module, struct ethtool_eeprom *ee,23 u8 *data);24 25int26mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core,27 u8 slot_index, u8 module,28 const struct ethtool_module_eeprom *page,29 struct netlink_ext_ack *extack);30 31int32mlxsw_env_set_module_eeprom_by_page(struct mlxsw_core *mlxsw_core,33 u8 slot_index, u8 module,34 const struct ethtool_module_eeprom *page,35 struct netlink_ext_ack *extack);36 37int mlxsw_env_reset_module(struct net_device *netdev,38 struct mlxsw_core *mlxsw_core, u8 slot_index,39 u8 module, u32 *flags);40 41int42mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index,43 u8 module,44 struct ethtool_module_power_mode_params *params,45 struct netlink_ext_ack *extack);46 47int48mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index,49 u8 module,50 enum ethtool_module_power_mode_policy policy,51 struct netlink_ext_ack *extack);52 53int54mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 slot_index,55 u8 module, u64 *p_counter);56 57void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 slot_index,58 u8 module);59 60void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 slot_index,61 u8 module);62 63int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 slot_index,64 u8 module);65 66void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 slot_index,67 u8 module);68 69int mlxsw_env_init(struct mlxsw_core *core,70 const struct mlxsw_bus_info *bus_info,71 struct mlxsw_env **p_env);72void mlxsw_env_fini(struct mlxsw_env *env);73 74#endif75