diff options
Diffstat (limited to 'src/include/gpxe')
| -rw-r--r-- | src/include/gpxe/netdevice.h | 4 | ||||
| -rw-r--r-- | src/include/gpxe/settings.h | 30 |
2 files changed, 30 insertions, 4 deletions
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h index 4abada7aa..d8cb84d08 100644 --- a/src/include/gpxe/netdevice.h +++ b/src/include/gpxe/netdevice.h @@ -245,7 +245,7 @@ struct net_device { struct net_device_stats stats; /** Configuration settings applicable to this device */ - struct settings settings; + struct simple_settings settings; /** Driver private data */ void *priv; @@ -349,7 +349,7 @@ netdev_priv ( struct net_device *netdev ) { */ static inline __attribute__ (( always_inline )) struct settings * netdev_settings ( struct net_device *netdev ) { - return &netdev->settings; + return &netdev->settings.settings; } extern int netdev_tx ( struct net_device *netdev, struct io_buffer *iobuf ); diff --git a/src/include/gpxe/settings.h b/src/include/gpxe/settings.h index f20c412be..643bd05b0 100644 --- a/src/include/gpxe/settings.h +++ b/src/include/gpxe/settings.h @@ -11,6 +11,7 @@ #include <gpxe/tables.h> #include <gpxe/list.h> #include <gpxe/refcnt.h> +#include <gpxe/dhcpopts.h> struct settings; struct in_addr; @@ -138,12 +139,23 @@ struct settings_applicator { #define __settings_applicator \ __table ( struct settings_applicator, settings_applicators, 01 ) +/** + * A simple settings block + * + */ +struct simple_settings { + /** Settings block */ + struct settings settings; + /** DHCP options */ + struct dhcp_options dhcpopts; +}; + +extern struct settings_operations simple_settings_operations; + extern int simple_settings_store ( struct settings *settings, unsigned int tag, const void *data, size_t len ); extern int simple_settings_fetch ( struct settings *settings, unsigned int tag, void *data, size_t len ); -extern struct settings_operations simple_settings_operations; - extern int register_settings ( struct settings *settings, struct settings *parent ); extern void unregister_settings ( struct settings *settings ); @@ -206,6 +218,20 @@ static inline void settings_init ( struct settings *settings, } /** + * Initialise a settings block + * + * @v simple Simple settings block + * @v refcnt Containing object reference counter, or NULL + * @v name Settings block name + */ +static inline void simple_settings_init ( struct simple_settings *simple, + struct refcnt *refcnt, + const char *name ) { + settings_init ( &simple->settings, &simple_settings_operations, + refcnt, name ); +} + +/** * Delete setting * * @v settings Settings block |
