summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe
diff options
context:
space:
mode:
authorMichael Brown2009-10-23 23:14:05 +0200
committerMichael Brown2009-10-23 23:14:05 +0200
commit1b1e63d54d7697c1fd156dcf365e74c7836d4d37 (patch)
treef582b2ffbd80ebc45c97b6f0ac27a9d6f4d8ef8c /src/include/gpxe
parent[iscsi] Fix printing of non-existent strings in iBFT debug messages (diff)
downloadipxe-1b1e63d54d7697c1fd156dcf365e74c7836d4d37.tar.gz
ipxe-1b1e63d54d7697c1fd156dcf365e74c7836d4d37.tar.xz
ipxe-1b1e63d54d7697c1fd156dcf365e74c7836d4d37.zip
[netdevice] Add the concept of an "Ethernet-compatible" MAC address
The iBFT is Ethernet-centric in providing only six bytes for a MAC address. This is most probably an indirect consequence of a similar design flaw in the Windows NDIS stack. (The WinOF IPoIB stack performs all sorts of contortions in order to pretend to the NDIS layer that it is dealing with six-byte MAC addresses.) There is no sensible way in which to extend the iBFT without breaking compatibility with programs that expect to parse it. Add the notion of an "Ethernet-compatible" MAC address to our link layer abstraction, so that link layers can provide their own workarounds for this limitation.
Diffstat (limited to 'src/include/gpxe')
-rw-r--r--src/include/gpxe/ethernet.h1
-rw-r--r--src/include/gpxe/netdevice.h19
2 files changed, 14 insertions, 6 deletions
diff --git a/src/include/gpxe/ethernet.h b/src/include/gpxe/ethernet.h
index 8cf6b1be7..4dfc24d3f 100644
--- a/src/include/gpxe/ethernet.h
+++ b/src/include/gpxe/ethernet.h
@@ -15,6 +15,7 @@ extern void eth_init_addr ( const void *hw_addr, void *ll_addr );
extern const char * eth_ntoa ( const void *ll_addr );
extern int eth_mc_hash ( unsigned int af, const void *net_addr,
void *ll_addr );
+extern int eth_eth_addr ( const void *ll_addr, void *eth_addr );
extern struct net_device * alloc_etherdev ( size_t priv_size );
#endif /* _GPXE_ETHERNET_H */
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h
index fd77d893a..858d8e97d 100644
--- a/src/include/gpxe/netdevice.h
+++ b/src/include/gpxe/netdevice.h
@@ -128,8 +128,8 @@ struct ll_protocol {
/**
* Transcribe link-layer address
*
- * @v ll_addr Link-layer address
- * @ret string Human-readable transcription of address
+ * @v ll_addr Link-layer address
+ * @ret string Human-readable transcription of address
*
* This method should convert the link-layer address into a
* human-readable format.
@@ -141,13 +141,20 @@ struct ll_protocol {
/**
* Hash multicast address
*
- * @v af Address family
- * @v net_addr Network-layer address
- * @v ll_addr Link-layer address to fill in
- * @ret rc Return status code
+ * @v af Address family
+ * @v net_addr Network-layer address
+ * @v ll_addr Link-layer address to fill in
+ * @ret rc Return status code
*/
int ( * mc_hash ) ( unsigned int af, const void *net_addr,
void *ll_addr );
+ /**
+ * Generate Ethernet-compatible compressed link-layer address
+ *
+ * @v ll_addr Link-layer address
+ * @v eth_addr Ethernet-compatible address to fill in
+ */
+ int ( * eth_addr ) ( const void *ll_addr, void *eth_addr );
/** Link-layer protocol
*
* This is an ARPHRD_XXX constant, in network byte order.