diff options
author | Michael Brown | 2009-08-11 21:19:53 +0200 |
---|---|---|
committer | Michael Brown | 2009-08-12 01:19:14 +0200 |
commit | 37a0aab4ff2c86f4d109d4cd479535be97d07a94 (patch) | |
tree | 5a2f06a22cf2c647b36d254fc1699072c3c88392 /src/include/gpxe/netdevice.h | |
parent | [doc] Expand scope of doxygen-generated documentation (diff) | |
download | ipxe-37a0aab4ff2c86f4d109d4cd479535be97d07a94.tar.gz ipxe-37a0aab4ff2c86f4d109d4cd479535be97d07a94.tar.xz ipxe-37a0aab4ff2c86f4d109d4cd479535be97d07a94.zip |
[netdevice] Separate out the concept of hardware and link-layer addresses
The hardware address is an intrinsic property of the hardware, while
the link-layer address can be changed at runtime. This separation is
exposed via APIs such as PXE and EFI, but is currently elided by gPXE.
Expose the hardware and link-layer addresses as separate properties
within a net device. Drivers should now fill in hw_addr, which will
be used to initialise ll_addr at the time of calling
register_netdev().
Diffstat (limited to 'src/include/gpxe/netdevice.h')
-rw-r--r-- | src/include/gpxe/netdevice.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h index 0f191dd6..5ac2f629 100644 --- a/src/include/gpxe/netdevice.h +++ b/src/include/gpxe/netdevice.h @@ -254,9 +254,16 @@ struct net_device { /** Link-layer protocol */ struct ll_protocol *ll_protocol; + /** Hardware address + * + * This is an address which is an intrinsic property of the + * hardware, e.g. an address held in EEPROM. + */ + uint8_t hw_addr[MAX_LL_ADDR_LEN]; /** Link-layer address * - * For Ethernet, this is the MAC address. + * This is the current link-layer address assigned to the + * device. It can be changed at runtime. */ uint8_t ll_addr[MAX_LL_ADDR_LEN]; /** Link-layer broadcast address */ @@ -337,12 +344,12 @@ static inline void netdev_nullify ( struct net_device *netdev ) { } /** - * Get printable network device hardware address + * Get printable network device link-layer address * * @v netdev Network device - * @ret name Hardware address + * @ret name Link-layer address */ -static inline const char * netdev_hwaddr ( struct net_device *netdev ) { +static inline const char * netdev_addr ( struct net_device *netdev ) { return netdev->ll_protocol->ntoa ( netdev->ll_addr ); } |