summaryrefslogtreecommitdiffstats
path: root/src/net/ethernet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ethernet.c')
-rw-r--r--src/net/ethernet.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/net/ethernet.c b/src/net/ethernet.c
index 5e2793f9..dfeba7cd 100644
--- a/src/net/ethernet.c
+++ b/src/net/ethernet.c
@@ -97,6 +97,16 @@ static int eth_pull ( struct net_device *netdev __unused,
}
/**
+ * Initialise Ethernet address
+ *
+ * @v hw_addr Hardware address
+ * @v ll_addr Link-layer address
+ */
+void eth_init_addr ( const void *hw_addr, void *ll_addr ) {
+ memcpy ( ll_addr, hw_addr, ETH_ALEN );
+}
+
+/**
* Transcribe Ethernet address
*
* @v ll_addr Link-layer address
@@ -143,10 +153,12 @@ static int eth_mc_hash ( unsigned int af, const void *net_addr,
struct ll_protocol ethernet_protocol __ll_protocol = {
.name = "Ethernet",
.ll_proto = htons ( ARPHRD_ETHER ),
+ .hw_addr_len = ETH_ALEN,
.ll_addr_len = ETH_ALEN,
.ll_header_len = ETH_HLEN,
.push = eth_push,
.pull = eth_pull,
+ .init_addr = eth_init_addr,
.ntoa = eth_ntoa,
.mc_hash = eth_mc_hash,
};