summaryrefslogtreecommitdiffstats
path: root/src/net/aoe.c
diff options
context:
space:
mode:
authorMichael Brown2006-06-18 00:36:27 +0200
committerMichael Brown2006-06-18 00:36:27 +0200
commit3c8aafa2099c13799fdb4f42d06f1abd278b14f7 (patch)
treedda612574bf0c128cc58ff4f7231b73f019f8e2b /src/net/aoe.c
parentRemove dependency on arptable[] (which is no longer used). (diff)
downloadipxe-3c8aafa2099c13799fdb4f42d06f1abd278b14f7.tar.gz
ipxe-3c8aafa2099c13799fdb4f42d06f1abd278b14f7.tar.xz
ipxe-3c8aafa2099c13799fdb4f42d06f1abd278b14f7.zip
Simplify RX data path.
Kill off the static single net device and move to proper dynamic registration (which we need with the new device model). Break the (flawed) assumption that all network-layer protocols can use ARP; such network-layer protocols (i.e. IPv4) must now register as an ARP protocol using ARP_NET_PROTOCOL() and provide a single method for checking the existence of a local network-layer address.
Diffstat (limited to 'src/net/aoe.c')
-rw-r--r--src/net/aoe.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/net/aoe.c b/src/net/aoe.c
index 693b3605..e0954fa5 100644
--- a/src/net/aoe.c
+++ b/src/net/aoe.c
@@ -87,7 +87,6 @@ static int aoe_send_command ( struct aoe_session *aoe ) {
data_out_len );
if ( ! pkb )
return -ENOMEM;
- pkb->net_protocol = &aoe_protocol;
pkb_reserve ( pkb, ETH_HLEN );
aoehdr = pkb_put ( pkb, sizeof ( *aoehdr ) );
aoecmd = pkb_put ( pkb, sizeof ( *aoecmd ) );
@@ -117,7 +116,7 @@ static int aoe_send_command ( struct aoe_session *aoe ) {
/* Send packet */
start_timer ( &aoe->timer );
- return net_transmit ( pkb, aoe->netdev, &aoe_protocol, aoe->target );
+ return net_tx ( pkb, aoe->netdev, &aoe_protocol, aoe->target );
}
/**
@@ -209,13 +208,15 @@ static int aoe_rx_response ( struct aoe_session *aoe, struct aoehdr *aoehdr,
* Process incoming AoE packets
*
* @v pkb Packet buffer
+ * @v netdev Network device
+ * @v ll_source Link-layer source address
* @ret rc Return status code
*
*/
-static int aoe_rx ( struct pk_buff *pkb ) {
+static int aoe_rx ( struct pk_buff *pkb, struct net_device *netdev __unused,
+ const void *ll_source ) {
struct aoehdr *aoehdr = pkb->data;
unsigned int len = pkb_len ( pkb );
- struct ethhdr *ethhdr = pkb_push ( pkb, sizeof ( *ethhdr ) );
struct aoe_session *aoe;
int rc = 0;
@@ -241,8 +242,7 @@ static int aoe_rx ( struct pk_buff *pkb ) {
continue;
if ( ntohl ( aoehdr->tag ) != aoe->tag )
continue;
- memcpy ( aoe->target, ethhdr->h_source,
- sizeof ( aoe->target ) );
+ memcpy ( aoe->target, ll_source, sizeof ( aoe->target ) );
rc = aoe_rx_response ( aoe, aoehdr, len );
break;
}
@@ -256,7 +256,7 @@ static int aoe_rx ( struct pk_buff *pkb ) {
struct net_protocol aoe_protocol = {
.name = "AoE",
.net_proto = htons ( ETH_P_AOE ),
- .rx_process = aoe_rx,
+ .rx = aoe_rx,
};
NET_PROTOCOL ( aoe_protocol );