diff options
author | Michael Brown | 2008-03-20 22:06:03 +0100 |
---|---|---|
committer | Michael Brown | 2008-03-20 22:06:53 +0100 |
commit | acfa14423ef2c974e9d8ff3d0aa48fe0ea2fb8c7 (patch) | |
tree | 1541c01facb5ed9d291aa773f12b7a8664077206 /src/include | |
parent | [Settings] Add settings hierarchy (diff) | |
download | ipxe-acfa14423ef2c974e9d8ff3d0aa48fe0ea2fb8c7.tar.gz ipxe-acfa14423ef2c974e9d8ff3d0aa48fe0ea2fb8c7.tar.xz ipxe-acfa14423ef2c974e9d8ff3d0aa48fe0ea2fb8c7.zip |
[Settings] Add per-netdevice settings block
Add a configuration settings block for each net device. This will
provide the parent scope for settings applicable only to that network
device (e.g. non-volatile options stored on the NIC, options obtained via
DHCP, etc.).
Expose the MAC address as a setting.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gpxe/dhcp.h | 9 | ||||
-rw-r--r-- | src/include/gpxe/errfile.h | 1 | ||||
-rw-r--r-- | src/include/gpxe/netdevice.h | 6 | ||||
-rw-r--r-- | src/include/gpxe/settings.h | 2 |
4 files changed, 17 insertions, 1 deletions
diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h index 6db0e026..3da96525 100644 --- a/src/include/gpxe/dhcp.h +++ b/src/include/gpxe/dhcp.h @@ -177,6 +177,15 @@ struct job_interface; */ #define DHCP_EB_SIADDR DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 3 ) +/** MAC address + * + * This option is used internally to contain the network device + * hardware address, in order to provide a consistent approach to + * storing and processing options. It should never be present in a + * DHCP packet. + */ +#define DHCP_EB_MAC DHCP_ENCAP_OPT ( DHCP_EB_ENCAP, 4 ) + /* * Tags in the range 0x10-0x7f are reserved for feature markers * diff --git a/src/include/gpxe/errfile.h b/src/include/gpxe/errfile.h index 09ae64ec..0b3b6c42 100644 --- a/src/include/gpxe/errfile.h +++ b/src/include/gpxe/errfile.h @@ -129,6 +129,7 @@ #define ERRFILE_dns ( ERRFILE_NET | 0x00110000 ) #define ERRFILE_tftp ( ERRFILE_NET | 0x00120000 ) #define ERRFILE_infiniband ( ERRFILE_NET | 0x00130000 ) +#define ERRFILE_netdev_settings ( ERRFILE_NET | 0x00140000 ) #define ERRFILE_image ( ERRFILE_IMAGE | 0x00000000 ) #define ERRFILE_elf ( ERRFILE_IMAGE | 0x00010000 ) diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h index 5d5e05bd..6f5c06f9 100644 --- a/src/include/gpxe/netdevice.h +++ b/src/include/gpxe/netdevice.h @@ -11,6 +11,7 @@ #include <gpxe/list.h> #include <gpxe/tables.h> #include <gpxe/refcnt.h> +#include <gpxe/settings.h> struct io_buffer; struct net_device; @@ -243,6 +244,9 @@ struct net_device { /** Device statistics */ struct net_device_stats stats; + /** Configuration settings applicable to this device */ + struct settings settings; + /** Driver private data */ void *priv; }; @@ -360,6 +364,8 @@ extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev, extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev, uint16_t net_proto, const void *ll_source ); +extern struct settings_operations netdev_settings_operations; + /** * Complete network transmission * diff --git a/src/include/gpxe/settings.h b/src/include/gpxe/settings.h index d92cdb55..5333c4f2 100644 --- a/src/include/gpxe/settings.h +++ b/src/include/gpxe/settings.h @@ -17,7 +17,7 @@ struct in_addr; /** Settings block operations */ struct settings_operations { - /** Set value of setting + /** Store value of setting * * @v settings Settings block * @v tag Setting tag number |