sonic-buildimage/platform/s3ip-sysfs/s3ip_sysfs_frame/include/cpld_sysfs.h
tianshangfei a2885b31ed
The CPLD and FPGA driver framework module complies with s3ip sysfs specification (#12891)
Why I did it
Provide CPLD and FPGA 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-16 22:05:53 +08:00

17 lines
863 B
C

#ifndef _CPLD_SYSFS_H_
#define _CPLD_SYSFS_H_
struct s3ip_sysfs_cpld_drivers_s {
int (*get_main_board_cpld_number)(void);
ssize_t (*get_main_board_cpld_alias)(unsigned int cpld_index, char *buf, size_t count);
ssize_t (*get_main_board_cpld_type)(unsigned int cpld_index, char *buf, size_t count);
ssize_t (*get_main_board_cpld_firmware_version)(unsigned int cpld_index, char *buf, size_t count);
ssize_t (*get_main_board_cpld_board_version)(unsigned int cpld_index, char *buf, size_t count);
ssize_t (*get_main_board_cpld_test_reg)(unsigned int cpld_index, char *buf, size_t count);
int (*set_main_board_cpld_test_reg)(unsigned int cpld_index, unsigned int value);
};
extern int s3ip_sysfs_cpld_drivers_register(struct s3ip_sysfs_cpld_drivers_s *drv);
extern void s3ip_sysfs_cpld_drivers_unregister(void);
#endif /*_CPLD_SYSFS_H_ */