linux/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c

// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/device.h>
#include <linux/sysfs.h>
#include <linux/hwmon.h>
#include <linux/err.h>
#include <linux/sfp.h>

#include "core.h"
#include "core_env.h"

#define MLXSW_HWMON_SENSORS_MAX_COUNT
#define MLXSW_HWMON_MODULES_MAX_COUNT
#define MLXSW_HWMON_GEARBOXES_MAX_COUNT

#define MLXSW_HWMON_ATTR_PER_SENSOR
#define MLXSW_HWMON_ATTR_PER_MODULE
#define MLXSW_HWMON_ATTR_PER_GEARBOX
#define MLXSW_HWMON_DEV_NAME_LEN_MAX

#define MLXSW_HWMON_ATTR_COUNT

struct mlxsw_hwmon_attr {};

static int mlxsw_hwmon_get_attr_index(int index, int count)
{}

struct mlxsw_hwmon_dev {};

struct mlxsw_hwmon {};

static ssize_t mlxsw_hwmon_temp_show(struct device *dev,
				     struct device_attribute *attr,
				     char *buf)
{}

static ssize_t mlxsw_hwmon_temp_max_show(struct device *dev,
					 struct device_attribute *attr,
					 char *buf)
{}

static ssize_t mlxsw_hwmon_temp_rst_store(struct device *dev,
					  struct device_attribute *attr,
					  const char *buf, size_t len)
{}

static ssize_t mlxsw_hwmon_fan_rpm_show(struct device *dev,
					struct device_attribute *attr,
					char *buf)
{}

static ssize_t mlxsw_hwmon_fan_fault_show(struct device *dev,
					  struct device_attribute *attr,
					  char *buf)
{}

static ssize_t mlxsw_hwmon_pwm_show(struct device *dev,
				    struct device_attribute *attr,
				    char *buf)
{}

static ssize_t mlxsw_hwmon_pwm_store(struct device *dev,
				     struct device_attribute *attr,
				     const char *buf, size_t len)
{}

static int mlxsw_hwmon_module_temp_get(struct device *dev,
				       struct device_attribute *attr,
				       int *p_temp)
{}

static ssize_t mlxsw_hwmon_module_temp_show(struct device *dev,
					    struct device_attribute *attr,
					    char *buf)
{}

static ssize_t mlxsw_hwmon_module_temp_fault_show(struct device *dev,
						  struct device_attribute *attr,
						  char *buf)
{}

static int mlxsw_hwmon_module_temp_critical_get(struct device *dev,
						struct device_attribute *attr,
						int *p_temp)
{}

static ssize_t
mlxsw_hwmon_module_temp_critical_show(struct device *dev,
				      struct device_attribute *attr, char *buf)
{}

static int mlxsw_hwmon_module_temp_emergency_get(struct device *dev,
						 struct device_attribute *attr,
						 int *p_temp)
{}

static ssize_t
mlxsw_hwmon_module_temp_emergency_show(struct device *dev,
				       struct device_attribute *attr,
				       char *buf)
{}

static ssize_t
mlxsw_hwmon_module_temp_label_show(struct device *dev,
				   struct device_attribute *attr,
				   char *buf)
{}

static ssize_t
mlxsw_hwmon_gbox_temp_label_show(struct device *dev,
				 struct device_attribute *attr,
				 char *buf)
{}

static ssize_t mlxsw_hwmon_temp_critical_alarm_show(struct device *dev,
						    struct device_attribute *attr,
						    char *buf)
{}

static ssize_t mlxsw_hwmon_temp_emergency_alarm_show(struct device *dev,
						     struct device_attribute *attr,
						     char *buf)
{}

enum mlxsw_hwmon_attr_type {};

static void mlxsw_hwmon_attr_add(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev,
				 enum mlxsw_hwmon_attr_type attr_type,
				 unsigned int type_index, unsigned int num)
{}

static int mlxsw_hwmon_temp_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev)
{}

static int mlxsw_hwmon_fans_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev)
{}

static int mlxsw_hwmon_module_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev)
{}

static int mlxsw_hwmon_gearbox_init(struct mlxsw_hwmon_dev *mlxsw_hwmon_dev)
{}

static void
mlxsw_hwmon_got_active(struct mlxsw_core *mlxsw_core, u8 slot_index,
		       void *priv)
{}

static void
mlxsw_hwmon_got_inactive(struct mlxsw_core *mlxsw_core, u8 slot_index,
			 void *priv)
{}

static struct mlxsw_linecards_event_ops mlxsw_hwmon_event_ops =;

int mlxsw_hwmon_init(struct mlxsw_core *mlxsw_core,
		     const struct mlxsw_bus_info *mlxsw_bus_info,
		     struct mlxsw_hwmon **p_hwmon)
{}

void mlxsw_hwmon_fini(struct mlxsw_hwmon *mlxsw_hwmon)
{}