Ben Widawsky | 799aeb6 | 2013-09-10 14:21:23 -0700 | [diff] [blame] | 1 | #ifndef INTEL_L3_PARITY_H_ |
| 2 | #define INTEL_L3_PARITY_H_ |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | #include <stdbool.h> |
| 6 | |
| 7 | struct l3_parity { |
| 8 | struct udev *udev; |
| 9 | struct udev_monitor *uevent_monitor; |
| 10 | int fd; |
| 11 | fd_set fdset; |
| 12 | }; |
| 13 | |
| 14 | struct l3_location { |
| 15 | uint8_t slice; |
| 16 | uint16_t row; |
| 17 | uint8_t bank; |
| 18 | uint8_t subbank; |
| 19 | }; |
| 20 | |
| 21 | #if HAVE_UDEV |
| 22 | int l3_uevent_setup(struct l3_parity *par); |
| 23 | /* Listens (blocks) for an l3 parity event. Returns the location of the error. */ |
| 24 | int l3_listen(struct l3_parity *par, bool daemon, struct l3_location *loc); |
| 25 | #define l3_uevent_teardown(par) {} |
| 26 | #else |
| 27 | #define l3_uevent_setup(par, daemon, loc) -1 |
| 28 | #define l3_listen(par) -1 |
| 29 | #endif |
| 30 | |
| 31 | #endif |