[netdevice] Add netdev argument to link-layer push and pull handlers

In order to construct outgoing link-layer frames or parse incoming
ones properly, some protocols (such as 802.11) need more state than is
available in the existing variables passed to the link-layer protocol
handlers. To remedy this, add struct net_device *netdev as the first
argument to each of these functions, so that more information can be
fetched from the link layer-private part of the network device.

Updated all three call sites (netdevice.c, efi_snp.c, pxe_undi.c) and
both implementations (ethernet.c, ipoib.c) of ll_protocol to use the
new argument.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
This commit is contained in:
Joshua Oreman
2009-06-15 11:37:43 -07:00
committed by Michael Brown
parent 743ebc2f4b
commit eb3ca2a36f
6 changed files with 30 additions and 17 deletions

View File

@@ -88,25 +88,29 @@ struct ll_protocol {
/**
* Add link-layer header
*
* @v netdev Network device
* @v iobuf I/O buffer
* @v ll_dest Link-layer destination address
* @v ll_source Source link-layer address
* @v net_proto Network-layer protocol, in network-byte order
* @ret rc Return status code
*/
int ( * push ) ( struct io_buffer *iobuf, const void *ll_dest,
const void *ll_source, uint16_t net_proto );
int ( * push ) ( struct net_device *netdev, struct io_buffer *iobuf,
const void *ll_dest, const void *ll_source,
uint16_t net_proto );
/**
* Remove link-layer header
*
* @v netdev Network device
* @v iobuf I/O buffer
* @ret ll_dest Link-layer destination address
* @ret ll_source Source link-layer address
* @ret net_proto Network-layer protocol, in network-byte order
* @ret rc Return status code
*/
int ( * pull ) ( struct io_buffer *iobuf, const void **ll_dest,
const void **ll_source, uint16_t *net_proto );
int ( * pull ) ( struct net_device *netdev, struct io_buffer *iobuf,
const void **ll_dest, const void **ll_source,
uint16_t *net_proto );
/**
* Transcribe link-layer address
*