-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The PSU driver module complies with s3ip sysfs specification (#12887)
Why I did it Provide a PSU 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
- Loading branch information
1 parent
5550c5d
commit d8f41e1
Showing
2 changed files
with
1,028 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#ifndef _PSU_SYSFS_H_ | ||
#define _PSU_SYSFS_H_ | ||
|
||
struct s3ip_sysfs_psu_drivers_s { | ||
int (*get_psu_number)(void); | ||
int (*get_psu_temp_number)(unsigned int psu_index); | ||
ssize_t (*get_psu_model_name)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_serial_number)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_part_number)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_hardware_version)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_type)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_in_curr)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_in_vol)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_in_power)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_out_curr)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_out_vol)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_out_power)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_out_max_power)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_present_status)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_in_status)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_out_status)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_fan_speed)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_fan_ratio)(unsigned int psu_index, char *buf, size_t count); | ||
int (*set_psu_fan_ratio)(unsigned int psu_index, int ratio); | ||
ssize_t (*get_psu_fan_direction)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_led_status)(unsigned int psu_index, char *buf, size_t count); | ||
ssize_t (*get_psu_temp_alias)(unsigned int psu_index, unsigned int temp_index, char *buf, size_t count); | ||
ssize_t (*get_psu_temp_type)(unsigned int psu_index, unsigned int temp_index, char *buf, size_t count); | ||
ssize_t (*get_psu_temp_max)(unsigned int psu_index, unsigned int temp_index, char *buf, size_t count); | ||
int (*set_psu_temp_max)(unsigned int psu_index, unsigned int temp_index, const char *buf, size_t count); | ||
ssize_t (*get_psu_temp_min)(unsigned int psu_index, unsigned int temp_index, char *buf, size_t count); | ||
int (*set_psu_temp_min)(unsigned int psu_index, unsigned int temp_index, const char *buf, size_t count); | ||
ssize_t (*get_psu_temp_value)(unsigned int psu_index, unsigned int temp_index, char *buf, size_t count); | ||
}; | ||
|
||
extern int s3ip_sysfs_psu_drivers_register(struct s3ip_sysfs_psu_drivers_s *drv); | ||
extern void s3ip_sysfs_psu_drivers_unregister(void); | ||
#endif /*_PSU_SYSFS_H_ */ |
Oops, something went wrong.