From 37a0aab4ff2c86f4d109d4cd479535be97d07a94 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 11 Aug 2009 20:19:53 +0100 Subject: [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(). --- src/include/gpxe/netdevice.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/include') diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h index 0f191dd68..5ac2f629f 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 ); } -- cgit v1.2.3-55-g7522