]> git.ozlabs.org Git - petitboot/blob - discover/device-handler.h
discover: Implement device handler boot path
[petitboot] / discover / device-handler.h
1 #ifndef _DEVICE_HANDLER_H
2 #define _DEVICE_HANDLER_H
3
4 #include <list/list.h>
5
6 struct device_handler;
7 struct discover_server;
8 struct boot_command;
9 struct event;
10 struct device;
11
12 struct discover_context {
13         char *id;
14         char *device_path;
15         char *mount_path;
16         struct event *event;
17         struct device *device;
18         char **links;
19         int n_links;
20
21         struct list_item list;
22 };
23
24 struct device_handler *device_handler_init(struct discover_server *server);
25
26 void device_handler_destroy(struct device_handler *devices);
27
28 int device_handler_get_device_count(const struct device_handler *handler);
29 const struct device *device_handler_get_device(
30         const struct device_handler *handler, unsigned int index);
31
32 int device_handler_event(struct device_handler *handler, struct event *event);
33
34 void device_handler_boot(struct device_handler *handler,
35                 struct boot_command *cmd);
36
37 #endif /* _DEVICE_HANDLER_H */