blob: 65697c4f15a798435d608a476353f2bf847bb5b4 [file] [log] [blame]
Ben Widawsky799aeb62013-09-10 14:21:23 -07001#ifndef INTEL_L3_PARITY_H_
2#define INTEL_L3_PARITY_H_
3
4#include <stdint.h>
5#include <stdbool.h>
6
7struct l3_parity {
8 struct udev *udev;
9 struct udev_monitor *uevent_monitor;
10 int fd;
11 fd_set fdset;
12};
13
14struct l3_location {
15 uint8_t slice;
16 uint16_t row;
17 uint8_t bank;
18 uint8_t subbank;
19};
20
21#if HAVE_UDEV
22int l3_uevent_setup(struct l3_parity *par);
23/* Listens (blocks) for an l3 parity event. Returns the location of the error. */
24int 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