sonic-buildimage/platform/s3ip-sysfs/s3ip_sysfs_frame/include/fan_sysfs.h
tianshangfei 422196a72a
The FAN driver framework module complies with s3ip sysfs specification (#12888)
Why I did it
Provide a Fan driver framework that complies with s3ip sysfs specification

How I did it
1、 The framework module provides register and unregister interface and implementation.
2、 The framework will help you create the sysfs node

How to verify it
A demo driver base on this framework will display the sysfs node wich conform to the s3ip sysfs specification
2022-12-14 22:29:24 +08:00

27 lines
1.7 KiB
C
Executable File

#ifndef _FAN_SYSFS_H_
#define _FAN_SYSFS_H_
struct s3ip_sysfs_fan_drivers_s {
int (*get_fan_number)(void);
int (*get_fan_motor_number)(unsigned int fan_index);
ssize_t (*get_fan_model_name)(unsigned int fan_index, char *buf, size_t count);
ssize_t (*get_fan_serial_number)(unsigned int fan_index, char *buf, size_t count);
ssize_t (*get_fan_part_number)(unsigned int fan_index, char *buf, size_t count);
ssize_t (*get_fan_hardware_version)(unsigned int fan_index, char *buf, size_t count);
ssize_t (*get_fan_status)(unsigned int fan_index, char *buf, size_t count);
ssize_t (*get_fan_led_status)(unsigned int fan_index, char *buf, size_t count);
int (*set_fan_led_status)(unsigned int fan_index, int status);
ssize_t (*get_fan_direction)(unsigned int fan_index, char *buf, size_t count);
ssize_t (*get_fan_motor_speed)(unsigned int fan_index, unsigned int motor_index, char *buf, size_t count);
ssize_t (*get_fan_motor_speed_tolerance)(unsigned int fan_index, unsigned int motor_index, char *buf, size_t count);
ssize_t (*get_fan_motor_speed_target)(unsigned int fan_index, unsigned int motor_index, char *buf, size_t count);
ssize_t (*get_fan_motor_speed_max)(unsigned int fan_index, unsigned int motor_index, char *buf, size_t count);
ssize_t (*get_fan_motor_speed_min)(unsigned int fan_index, unsigned int motor_index, char *buf, size_t count);
ssize_t (*get_fan_ratio)(unsigned int fan_index, char *buf, size_t count);
int (*set_fan_ratio)(unsigned int fan_index, int ratio);
};
extern int s3ip_sysfs_fan_drivers_register(struct s3ip_sysfs_fan_drivers_s *drv);
extern void s3ip_sysfs_fan_drivers_unregister(void);
#endif /*_FAN_SYSFS_H_ */