From ed7eae6005fa2cf7bf6a7650cf42762f4d1f8754 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 5 Jul 2007 17:23:03 +0100 Subject: [PATCH] Use netdev_rx_err() to report receive errors. --- src/drivers/net/pnic.c | 5 +++-- src/drivers/net/rtl8139.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/drivers/net/pnic.c b/src/drivers/net/pnic.c index f614a073..38b4af6d 100644 --- a/src/drivers/net/pnic.c +++ b/src/drivers/net/pnic.c @@ -128,13 +128,14 @@ static void pnic_poll ( struct net_device *netdev, unsigned int rx_quota ) { break; iobuf = alloc_iob ( ETH_FRAME_LEN ); if ( ! iobuf ) { - printf ( "could not allocate buffer\n" ); + DBG ( "could not allocate buffer\n" ); + netdev_rx_err ( netdev, NULL, -ENOMEM ); break; } if ( pnic_command ( pnic, PNIC_CMD_RECV, NULL, 0, iobuf->data, ETH_FRAME_LEN, &length ) != PNIC_STATUS_OK ) { - free_iob ( iobuf ); + netdev_rx_err ( netdev, iobuf, -EIO ); break; } iob_put ( iobuf, length ); diff --git a/src/drivers/net/rtl8139.c b/src/drivers/net/rtl8139.c index 90a7182b..54bda07f 100644 --- a/src/drivers/net/rtl8139.c +++ b/src/drivers/net/rtl8139.c @@ -444,6 +444,7 @@ static void rtl_poll ( struct net_device *netdev, unsigned int rx_quota ) { rx_iob = alloc_iob ( rx_len ); if ( ! rx_iob ) { + netdev_rx_err ( netdev, NULL, -ENOMEM ); /* Leave packet for next call to poll() */ break; } @@ -464,6 +465,7 @@ static void rtl_poll ( struct net_device *netdev, unsigned int rx_quota ) { } else { DBG ( "RX bad packet (status %#04x len %d)\n", rx_status, rx_len ); + netdev_rx_err ( netdev, NULL, -EINVAL ); } rtl->rx.offset = ( ( ( rtl->rx.offset + 4 + rx_len + 3 ) & ~3 ) % RX_BUF_LEN );