[netdevice] Pass both link-layer addresses in net_tx() and net_rx()

FCoE requires the use of fabric-provided MAC addresses, which breaks
the assumption that the net device's MAC address is implicitly the
source address for net_tx() and the (unicast) destination address for
net_rx().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2010-10-07 16:03:16 +01:00
parent d57d49942a
commit 88dd921e24
13 changed files with 60 additions and 31 deletions

View File

@@ -90,7 +90,8 @@ struct eapol_handler
*
* @v iob I/O buffer containing packet payload
* @v netdev Network device from which packet was received
* @v ll_source Source link-layer address from which packet was received
* @V ll_dest Destination link-layer address
* @v ll_source Source link-layer address
* @ret rc Return status code
*
* The I/O buffer will have the EAPOL header pulled off it, so
@@ -99,7 +100,7 @@ struct eapol_handler
* This function takes ownership of the I/O buffer passed to it.
*/
int ( * rx ) ( struct io_buffer *iob, struct net_device *netdev,
const void *ll_source );
const void *ll_dest, const void *ll_source );
};
#define EAPOL_HANDLERS __table ( struct eapol_handler, "eapol_handlers" )

View File

@@ -57,12 +57,13 @@ struct net_protocol {
*
* @v iobuf I/O buffer
* @v netdev Network device
* @v ll_dest Link-layer destination address
* @v ll_source Link-layer source address
*
* This method takes ownership of the I/O buffer.
*/
int ( * rx ) ( struct io_buffer *iobuf, struct net_device *netdev,
const void *ll_source );
const void *ll_dest, const void *ll_source );
/**
* Transcribe network-layer address
*
@@ -534,9 +535,11 @@ extern struct net_device * find_netdev_by_location ( unsigned int bus_type,
unsigned int location );
extern struct net_device * last_opened_netdev ( void );
extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
struct net_protocol *net_protocol, const void *ll_dest );
struct net_protocol *net_protocol, const void *ll_dest,
const void *ll_source );
extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
uint16_t net_proto, const void *ll_source );
uint16_t net_proto, const void *ll_dest,
const void *ll_source );
/**
* Complete network transmission