Browse Source

[rndis] Add rndis_rx_err()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
f3725a86e0
2 changed files with 17 additions and 0 deletions
  1. 2
    0
      src/include/ipxe/rndis.h
  2. 15
    0
      src/net/rndis.c

+ 2
- 0
src/include/ipxe/rndis.h View File

@@ -347,6 +347,8 @@ extern void rndis_tx_complete_err ( struct rndis_device *rndis,
347 347
 extern int rndis_tx_defer ( struct rndis_device *rndis,
348 348
 			    struct io_buffer *iobuf );
349 349
 extern void rndis_rx ( struct rndis_device *rndis, struct io_buffer *iobuf );
350
+extern void rndis_rx_err ( struct rndis_device *rndis, struct io_buffer *iobuf,
351
+			   int rc );
350 352
 
351 353
 extern struct rndis_device * alloc_rndis ( size_t priv_len );
352 354
 extern int register_rndis ( struct rndis_device *rndis );

+ 15
- 0
src/net/rndis.c View File

@@ -795,6 +795,21 @@ void rndis_rx ( struct rndis_device *rndis, struct io_buffer *iobuf ) {
795 795
 	netdev_rx_err ( netdev, iob_disown ( iobuf ), rc );
796 796
 }
797 797
 
798
+/**
799
+ * Discard packet from underlying transport layer
800
+ *
801
+ * @v rndis		RNDIS device
802
+ * @v iobuf		I/O buffer
803
+ * @v rc		Packet status code
804
+ */
805
+void rndis_rx_err ( struct rndis_device *rndis, struct io_buffer *iobuf,
806
+		    int rc ) {
807
+	struct net_device *netdev = rndis->netdev;
808
+
809
+	/* Record error */
810
+	netdev_rx_err ( netdev, iob_disown ( iobuf ), rc );
811
+}
812
+
798 813
 /**
799 814
  * Set receive filter
800 815
  *

Loading…
Cancel
Save