From 30fb3b3810409a4971adf9abf00e0842f88d87d8 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 20 Aug 2008 03:21:37 +0100 Subject: [undi] Fill in ProtType correctly in PXENV_UNDI_ISR Determine the network-layer packet type and fill it in for UNDI clients. This is required by some NBPs such as emBoot's winBoot/i. This change requires refactoring the link-layer portions of the gPXE netdevice API, so that it becomes possible to strip the link-layer header without passing the packet up the network stack. --- src/include/gpxe/netdevice.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/include') diff --git a/src/include/gpxe/netdevice.h b/src/include/gpxe/netdevice.h index 1ef648e11..cdc8cbad4 100644 --- a/src/include/gpxe/netdevice.h +++ b/src/include/gpxe/netdevice.h @@ -76,7 +76,7 @@ struct ll_protocol { /** Protocol name */ const char *name; /** - * Transmit network-layer packet via network device + * Add link-layer header * * @v iobuf I/O buffer * @v netdev Network device @@ -85,24 +85,28 @@ struct ll_protocol { * @ret rc Return status code * * This method should prepend in the link-layer header - * (e.g. the Ethernet DIX header) and transmit the packet. - * This method takes ownership of the I/O buffer. + * (e.g. the Ethernet DIX header). */ - int ( * tx ) ( struct io_buffer *iobuf, struct net_device *netdev, - struct net_protocol *net_protocol, - const void *ll_dest ); + int ( * push ) ( struct io_buffer *iobuf, struct net_device *netdev, + struct net_protocol *net_protocol, + const void *ll_dest ); /** - * Handle received packet + * 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 pass the packet to - * net_rx(). This method takes ownership of the packet - * buffer. + * (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. */ - int ( * rx ) ( struct io_buffer *iobuf, struct net_device *netdev ); + int ( * pull ) ( struct io_buffer *iobuf, struct net_device *netdev, + uint16_t *net_proto, const void **ll_source ); /** * Transcribe link-layer address * -- cgit v1.2.3-55-g7522