Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
0002 /* Copyright (c) 2018 Mellanox Technologies. All rights reserved */
0003 
0004 #ifndef _MLXSW_CORE_ENV_H
0005 #define _MLXSW_CORE_ENV_H
0006 
0007 #include <linux/ethtool.h>
0008 
0009 struct ethtool_modinfo;
0010 struct ethtool_eeprom;
0011 
0012 int mlxsw_env_module_temp_thresholds_get(struct mlxsw_core *core,
0013                      u8 slot_index, int module, int off,
0014                      int *temp);
0015 
0016 int mlxsw_env_get_module_info(struct net_device *netdev,
0017                   struct mlxsw_core *mlxsw_core, u8 slot_index,
0018                   int module, struct ethtool_modinfo *modinfo);
0019 
0020 int mlxsw_env_get_module_eeprom(struct net_device *netdev,
0021                 struct mlxsw_core *mlxsw_core, u8 slot_index,
0022                 int module, struct ethtool_eeprom *ee,
0023                 u8 *data);
0024 
0025 int
0026 mlxsw_env_get_module_eeprom_by_page(struct mlxsw_core *mlxsw_core,
0027                     u8 slot_index, u8 module,
0028                     const struct ethtool_module_eeprom *page,
0029                     struct netlink_ext_ack *extack);
0030 
0031 int mlxsw_env_reset_module(struct net_device *netdev,
0032                struct mlxsw_core *mlxsw_core, u8 slot_index,
0033                u8 module, u32 *flags);
0034 
0035 int
0036 mlxsw_env_get_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index,
0037                 u8 module,
0038                 struct ethtool_module_power_mode_params *params,
0039                 struct netlink_ext_ack *extack);
0040 
0041 int
0042 mlxsw_env_set_module_power_mode(struct mlxsw_core *mlxsw_core, u8 slot_index,
0043                 u8 module,
0044                 enum ethtool_module_power_mode_policy policy,
0045                 struct netlink_ext_ack *extack);
0046 
0047 int
0048 mlxsw_env_module_overheat_counter_get(struct mlxsw_core *mlxsw_core, u8 slot_index,
0049                       u8 module, u64 *p_counter);
0050 
0051 void mlxsw_env_module_port_map(struct mlxsw_core *mlxsw_core, u8 slot_index,
0052                    u8 module);
0053 
0054 void mlxsw_env_module_port_unmap(struct mlxsw_core *mlxsw_core, u8 slot_index,
0055                  u8 module);
0056 
0057 int mlxsw_env_module_port_up(struct mlxsw_core *mlxsw_core, u8 slot_index,
0058                  u8 module);
0059 
0060 void mlxsw_env_module_port_down(struct mlxsw_core *mlxsw_core, u8 slot_index,
0061                 u8 module);
0062 
0063 int mlxsw_env_init(struct mlxsw_core *core,
0064            const struct mlxsw_bus_info *bus_info,
0065            struct mlxsw_env **p_env);
0066 void mlxsw_env_fini(struct mlxsw_env *env);
0067 
0068 #endif