summaryrefslogtreecommitdiffstats
path: root/src/include
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/include
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/include')
-rw-r--r--src/include/gpxe/netdevice.h32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h
index 3109db838..c4f4a7be5 100644
--- a/src/include/gpxe/netdevice.h
+++ b/src/include/gpxe/netdevice.h
@@ -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
*