[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.
This commit is contained in:
Michael Brown
2008-10-15 04:17:48 +01:00
parent 6b9cc25556
commit 3a505dfc35
5 changed files with 56 additions and 64 deletions

View File

@@ -79,34 +79,24 @@ struct ll_protocol {
* Add link-layer header
*
* @v iobuf I/O buffer
* @v netdev Network device
* @v net_protocol Network-layer protocol
* @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
*
* This method should prepend in the link-layer header
* (e.g. the Ethernet DIX header).
*/
int ( * push ) ( struct io_buffer *iobuf, struct net_device *netdev,
struct net_protocol *net_protocol,
const void *ll_dest );
int ( * push ) ( struct io_buffer *iobuf, const void *ll_dest,
const void *ll_source, uint16_t net_proto );
/**
* Remove link-layer header
*
* @v iobuf I/O buffer
* @v netdev Network device
* @v net_proto Network-layer protocol, in network-byte order
* @v ll_source Source link-layer address
* @ret rc Return status code
*
* This method should strip off the link-layer header
* (e.g. the Ethernet DIX header) and return the protocol and
* source link-layer address. The method must not alter the
* packet content, and may return the link-layer address as a
* pointer to data within the packet.
* @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, struct net_device *netdev,
uint16_t *net_proto, const void **ll_source );
int ( * pull ) ( struct io_buffer *iobuf, const void **ll_dest,
const void **ll_source, uint16_t *net_proto );
/**
* Transcribe link-layer address
*