mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 20:10:18 +03:00
[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.
This commit is contained in:
@@ -586,6 +586,7 @@ static struct ll_protocol net80211_ll_protocol __ll_protocol = {
|
||||
.init_addr = eth_init_addr,
|
||||
.ntoa = eth_ntoa,
|
||||
.mc_hash = eth_mc_hash,
|
||||
.eth_addr = eth_eth_addr,
|
||||
.ll_proto = htons ( ARPHRD_ETHER ), /* "encapsulated Ethernet" */
|
||||
.hw_addr_len = ETH_ALEN,
|
||||
.ll_addr_len = ETH_ALEN,
|
||||
|
||||
@@ -148,6 +148,17 @@ int eth_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_eth_addr ( const void *ll_addr, void *eth_addr ) {
|
||||
memcpy ( eth_addr, ll_addr, ETH_ALEN );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Ethernet protocol */
|
||||
struct ll_protocol ethernet_protocol __ll_protocol = {
|
||||
.name = "Ethernet",
|
||||
@@ -160,6 +171,7 @@ struct ll_protocol ethernet_protocol __ll_protocol = {
|
||||
.init_addr = eth_init_addr,
|
||||
.ntoa = eth_ntoa,
|
||||
.mc_hash = eth_mc_hash,
|
||||
.eth_addr = eth_eth_addr,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user