#ifndef IO_MODULE_SUPERCAP_H_ #define IO_MODULE_SUPERCAP_H_ #include #include #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) #include #endif #include "mts_io.h" #include "mts_io_module.h" #define SUPERCAP_CHECKS_PER_SEC 10 #define SUPERCAP_CHECK_INTERVAL (HZ / SUPERCAP_CHECKS_PER_SEC) #define SUPERCAP_TOTAL_INTERVALS 50 /* 5s */ typedef struct supercap_info { char name[32]; char label_monitor[32]; /* PID to notify */ pid_t pid; /* signal to send */ int signal; /* internal fields used in worker*/ int pwf_count; /* count of intervals in worker */ int pin_is_one; /* count of number of times pin has been set to one */ } supercap_info_t, *supercap_info_pt; extern void init_supercap_worker(void); extern void cleanup_supercap_worker(void); extern ssize_t mts_attr_show_supercap_monitor(struct device *dev, struct device_attribute *attr, char *buf); extern ssize_t mts_attr_store_supercap_monitor(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); extern struct device_attribute dev_attr_supercap_monitor; #endif /* IO_MODULE_SUPERCAP_H_ */