From bd06734362bb727b09b943688d9b69aa0a84590d Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Mon, 11 Mar 2013 13:43:48 +0800 Subject: protocol: Separate device add from boot-option add messages We want to cater for situations where boot options may be discovered some time after we get notificiation about devices. For instance, discovering boot options from DHCP configuration parameters. In this case, we'll need to notify UIs of boot options appear some time after the device (and/or other boot options on the same device) has appeared. This change adds a new protocol message type, PB_PROTOCOL_ACTION_BOOT_OPTION_ADD. We also rename PB_PROTOCOL_ACTION_ADD to make it clear that it is just for devices. The discover server is updated to send boot option add events at device discover time, but we are now able to decouple this later. We also update the clients to handle the boot option add events separately. Signed-off-by: Jeremy Kerr --- discover/discover-server.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'discover/discover-server.h') diff --git a/discover/discover-server.h b/discover/discover-server.h index 6650bba..e47cf5f 100644 --- a/discover/discover-server.h +++ b/discover/discover-server.h @@ -5,6 +5,7 @@ struct discover_server; struct device_handler; +struct boot_option; struct device; struct discover_server *discover_server_init(struct waitset *waitset); @@ -14,8 +15,10 @@ void discover_server_destroy(struct discover_server *server); void discover_server_set_device_source(struct discover_server *server, struct device_handler *handler); -void discover_server_notify_add(struct discover_server *server, +void discover_server_notify_device_add(struct discover_server *server, struct device *device); -void discover_server_notify_remove(struct discover_server *server, +void discover_server_notify_boot_option_add(struct discover_server *server, + struct boot_option *option); +void discover_server_notify_device_remove(struct discover_server *server, struct device *device); #endif /* _DISCOVER_SERVER_H */ -- cgit v1.2.1