4b1f098a00e91abe7d63852037b0493e5d1135a9
[monky] / src / linux.h
1 #ifndef _LINUX_H
2 #define _LINUX_H
3
4 #include "common.h"
5
6 const char *get_disk_protect_queue(const char *);
7
8 struct i8k_struct {
9         char *version;
10         char *bios;
11         char *serial;
12         char *cpu_temp;
13         char *left_fan_status;
14         char *right_fan_status;
15         char *left_fan_rpm;
16         char *right_fan_rpm;
17         char *ac_status;
18         char *buttons_status;
19 };
20
21 struct i8k_struct i8k;
22
23 int interface_up(const char *dev);
24 char *get_ioscheduler(char *);
25 int get_laptop_mode(void);
26 void update_gateway_info(void);
27
28 enum { PB_BATT_STATUS, PB_BATT_PERCENT, PB_BATT_TIME };
29 void get_powerbook_batt_info(char *, size_t, int);
30
31 int open_sysfs_sensor(const char *dir, const char *dev, const char *type, int n,
32         int *divisor, char *devtype);
33
34 #define open_i2c_sensor(dev, type, n, divisor, devtype) \
35         open_sysfs_sensor("/sys/bus/i2c/devices/", dev, type, n, divisor, devtype)
36 #define open_platform_sensor(dev, type, n, divisor, devtype) \
37         open_sysfs_sensor("/sys/bus/platform/devices/", dev, type, n, divisor, devtype)
38 #define open_hwmon_sensor(dev, type, n, divisor, devtype) \
39         open_sysfs_sensor("/sys/class/hwmon/", dev, type, n, divisor, devtype)
40
41 double get_sysfs_info(int *fd, int arg, char *devtype, char *type);
42
43 #endif /* _LINUX_H */