summaryrefslogtreecommitdiffstats
path: root/src/interface/pxe
diff options
context:
space:
mode:
authorMichael Brown2008-10-15 05:17:48 +0200
committerMichael Brown2008-10-16 06:13:40 +0200
commit3a505dfc350cc9c720c170660f0c779ec32a4bfd (patch)
tree15616d0540523e1f43f22ca67f4e0bba46923359 /src/interface/pxe
parent[netdevice] Split multicast hashing out into an mc_hash method (diff)
downloadipxe-3a505dfc350cc9c720c170660f0c779ec32a4bfd.tar.gz
ipxe-3a505dfc350cc9c720c170660f0c779ec32a4bfd.tar.xz
ipxe-3a505dfc350cc9c720c170660f0c779ec32a4bfd.zip
[netdevice] Change link-layer push() and pull() methods to take raw types
EFI requires us to be able to specify the source address for individual transmitted packets, and to be able to extract the destination address on received packets. Take advantage of this to rationalise the push() and pull() methods so that push() takes a (dest,source,proto) tuple and pull() returns a (dest,source,proto) tuple.
Diffstat (limited to 'src/interface/pxe')
-rw-r--r--src/interface/pxe/pxe_undi.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/interface/pxe/pxe_undi.c b/src/interface/pxe/pxe_undi.c
index 5d06f2d8f..f32106296 100644
--- a/src/interface/pxe/pxe_undi.c
+++ b/src/interface/pxe/pxe_undi.c
@@ -199,9 +199,10 @@ PXENV_EXIT_t pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT
struct DataBlk *datablk;
struct io_buffer *iobuf;
struct net_protocol *net_protocol;
+ struct ll_protocol *ll_protocol = pxe_netdev->ll_protocol;
char destaddr[MAX_LL_ADDR_LEN];
const void *ll_dest;
- size_t ll_hlen = pxe_netdev->ll_protocol->ll_header_len;
+ size_t ll_hlen = ll_protocol->ll_header_len;
size_t len;
unsigned int i;
int rc;
@@ -259,17 +260,17 @@ PXENV_EXIT_t pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT
copy_from_real ( destaddr,
undi_transmit->DestAddr.segment,
undi_transmit->DestAddr.offset,
- pxe_netdev->ll_protocol->ll_addr_len );
+ ll_protocol->ll_addr_len );
ll_dest = destaddr;
} else {
DBG ( " BCAST" );
- ll_dest = pxe_netdev->ll_protocol->ll_broadcast;
+ ll_dest = ll_protocol->ll_broadcast;
}
/* Add link-layer header */
- if ( ( rc = pxe_netdev->ll_protocol->push ( iobuf, pxe_netdev,
- net_protocol,
- ll_dest )) != 0 ){
+ if ( ( rc = ll_protocol->push ( iobuf, ll_dest,
+ pxe_netdev->ll_addr,
+ net_protocol->net_proto ))!=0){
free_iob ( iobuf );
undi_transmit->Status = PXENV_STATUS ( rc );
return PXENV_EXIT_FAILURE;
@@ -545,6 +546,7 @@ PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
struct io_buffer *iobuf;
size_t len;
struct ll_protocol *ll_protocol;
+ const void *ll_dest;
const void *ll_source;
uint16_t net_proto;
size_t ll_hlen;
@@ -625,9 +627,8 @@ PXENV_EXIT_t pxenv_undi_isr ( struct s_PXENV_UNDI_ISR *undi_isr ) {
/* Strip link-layer header */
ll_protocol = pxe_netdev->ll_protocol;
- if ( ( rc = ll_protocol->pull ( iobuf, pxe_netdev,
- &net_proto,
- &ll_source ) ) != 0 ) {
+ if ( ( rc = ll_protocol->pull ( iobuf, &ll_dest, &ll_source,
+ &net_proto ) ) != 0 ) {
/* Assume unknown net_proto and no ll_source */
net_proto = 0;
ll_source = NULL;