}
/* Add link-layer header */
- if ( ( rc = ll_protocol->push ( iobuf, ll_dest,
+ if ( ( rc = ll_protocol->push ( pxe_netdev, iobuf, ll_dest,
pxe_netdev->ll_addr,
net_protocol->net_proto ))!=0){
free_iob ( iobuf );
/* Strip link-layer header */
ll_protocol = pxe_netdev->ll_protocol;
- if ( ( rc = ll_protocol->pull ( iobuf, &ll_dest, &ll_source,
- &net_proto ) ) != 0 ) {
+ if ( ( rc = ll_protocol->pull ( pxe_netdev, iobuf, &ll_dest,
+ &ll_source, &net_proto )) !=0){
/* Assume unknown net_proto and no ll_source */
net_proto = 0;
ll_source = NULL;
/**
* Add IPoIB 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
*/
-static int ipoib_push ( struct io_buffer *iobuf, const void *ll_dest,
+static int ipoib_push ( struct net_device *netdev __unused,
+ struct io_buffer *iobuf, const void *ll_dest,
const void *ll_source __unused, uint16_t net_proto ) {
struct ipoib_hdr *ipoib_hdr =
iob_push ( iobuf, sizeof ( *ipoib_hdr ) );
/**
* Remove IPoIB 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
*/
-static int ipoib_pull ( struct io_buffer *iobuf, const void **ll_dest,
+static int ipoib_pull ( struct net_device *netdev __unused,
+ struct io_buffer *iobuf, const void **ll_dest,
const void **ll_source, uint16_t *net_proto ) {
struct ipoib_hdr *ipoib_hdr = iobuf->data;
struct ipoib_peer *dest;
/**
* 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
*
/* Create link-layer header, if specified */
if ( ll_header_len ) {
iob_pull ( iobuf, ll_header_len );
- if ( ( rc = ll_protocol->push ( iobuf, ll_dest, ll_src,
+ if ( ( rc = ll_protocol->push ( snpdev->netdev,
+ iobuf, ll_dest, ll_src,
htons ( *net_proto ) )) != 0 ){
DBGC ( snpdev, "SNPDEV %p TX could not construct "
"header: %s\n", snpdev, strerror ( rc ) );
*len = iob_len ( iobuf );
/* Attempt to decode link-layer header */
- if ( ( rc = ll_protocol->pull ( iobuf, &iob_ll_dest, &iob_ll_src,
- &iob_net_proto ) ) != 0 ) {
+ if ( ( rc = ll_protocol->pull ( snpdev->netdev, iobuf, &iob_ll_dest,
+ &iob_ll_src, &iob_net_proto ) ) != 0 ){
DBGC ( snpdev, "SNPDEV %p could not parse header: %s\n",
snpdev, strerror ( rc ) );
efirc = RC_TO_EFIRC ( rc );
/**
* Add Ethernet 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
*/
-static int eth_push ( struct io_buffer *iobuf, const void *ll_dest,
+static int eth_push ( struct net_device *netdev __unused,
+ struct io_buffer *iobuf, const void *ll_dest,
const void *ll_source, uint16_t net_proto ) {
struct ethhdr *ethhdr = iob_push ( iobuf, sizeof ( *ethhdr ) );
/**
* Remove Ethernet 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
*/
-static int eth_pull ( struct io_buffer *iobuf, const void **ll_dest,
+static int eth_pull ( struct net_device *netdev __unused,
+ struct io_buffer *iobuf, const void **ll_dest,
const void **ll_source, uint16_t *net_proto ) {
struct ethhdr *ethhdr = iobuf->data;
netdev_poll ( netdev );
/* Add link-layer header */
- if ( ( rc = ll_protocol->push ( iobuf, ll_dest, netdev->ll_addr,
+ if ( ( rc = ll_protocol->push ( netdev, iobuf, ll_dest, netdev->ll_addr,
net_protocol->net_proto ) ) != 0 ) {
free_iob ( iobuf );
return rc;
/* Remove link-layer header */
ll_protocol = netdev->ll_protocol;
- if ( ( rc = ll_protocol->pull ( iobuf, &ll_dest,
- &ll_source,
+ if ( ( rc = ll_protocol->pull ( netdev, iobuf,
+ &ll_dest, &ll_source,
&net_proto ) ) != 0 ) {
free_iob ( iobuf );
continue;