From f3725a86e00cf5a4281997670c8779f83c38eeba Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 11 Feb 2015 17:26:51 +0000 Subject: [rndis] Add rndis_rx_err() Signed-off-by: Michael Brown --- src/include/ipxe/rndis.h | 2 ++ src/net/rndis.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/include/ipxe/rndis.h b/src/include/ipxe/rndis.h index b7c9c06..bc077f2 100644 --- a/src/include/ipxe/rndis.h +++ b/src/include/ipxe/rndis.h @@ -347,6 +347,8 @@ extern void rndis_tx_complete_err ( struct rndis_device *rndis, extern int rndis_tx_defer ( struct rndis_device *rndis, struct io_buffer *iobuf ); extern void rndis_rx ( struct rndis_device *rndis, struct io_buffer *iobuf ); +extern void rndis_rx_err ( struct rndis_device *rndis, struct io_buffer *iobuf, + int rc ); extern struct rndis_device * alloc_rndis ( size_t priv_len ); extern int register_rndis ( struct rndis_device *rndis ); diff --git a/src/net/rndis.c b/src/net/rndis.c index cd710a4..48447f1 100644 --- a/src/net/rndis.c +++ b/src/net/rndis.c @@ -796,6 +796,21 @@ void rndis_rx ( struct rndis_device *rndis, struct io_buffer *iobuf ) { } /** + * Discard packet from underlying transport layer + * + * @v rndis RNDIS device + * @v iobuf I/O buffer + * @v rc Packet status code + */ +void rndis_rx_err ( struct rndis_device *rndis, struct io_buffer *iobuf, + int rc ) { + struct net_device *netdev = rndis->netdev; + + /* Record error */ + netdev_rx_err ( netdev, iob_disown ( iobuf ), rc ); +} + +/** * Set receive filter * * @v rndis RNDIS device -- cgit v1.1