1 #ifndef _DEVICE_HANDLER_H
2 #define _DEVICE_HANDLER_H
7 struct discover_device;
8 struct discover_server;
14 struct discover_device {
15 struct device *device;
26 struct list boot_options;
29 struct discover_boot_option {
30 struct discover_device *device;
31 struct boot_option *option;
32 struct list_item list;
34 struct resource *boot_image;
35 struct resource *initrd;
36 struct resource *icon;
40 struct discover_context {
42 struct discover_device *device;
43 struct list boot_options;
46 struct device_handler *device_handler_init(struct discover_server *server,
49 void device_handler_destroy(struct device_handler *devices);
51 int device_handler_get_device_count(const struct device_handler *handler);
52 const struct discover_device *device_handler_get_device(
53 const struct device_handler *handler, unsigned int index);
55 struct device *discover_context_device(struct discover_context *ctx);
56 struct discover_boot_option *discover_boot_option_create(
57 struct discover_context *ctx,
58 struct discover_device *dev);
59 void discover_context_add_boot_option(struct discover_context *ctx,
60 struct discover_boot_option *opt);
62 int device_handler_event(struct device_handler *handler, struct event *event);
64 struct discover_device *device_lookup_by_name(struct device_handler *handler,
66 struct discover_device *device_lookup_by_path(struct device_handler *handler,
68 struct discover_device *device_lookup_by_uuid(struct device_handler *handler,
70 struct discover_device *device_lookup_by_label(struct device_handler *handler,
72 struct discover_device *device_lookup_by_id(struct device_handler *handler,
75 void device_handler_boot(struct device_handler *handler,
76 struct boot_command *cmd);
78 #endif /* _DEVICE_HANDLER_H */