Use netdev_rx_err() to report receive errors.

pull/1/head
Michael Brown 2007-07-05 17:23:03 +01:00
parent 539ff45fd0
commit ed7eae6005
2 changed files with 5 additions and 2 deletions

View File

@ -128,13 +128,14 @@ static void pnic_poll ( struct net_device *netdev, unsigned int rx_quota ) {
break; break;
iobuf = alloc_iob ( ETH_FRAME_LEN ); iobuf = alloc_iob ( ETH_FRAME_LEN );
if ( ! iobuf ) { if ( ! iobuf ) {
printf ( "could not allocate buffer\n" ); DBG ( "could not allocate buffer\n" );
netdev_rx_err ( netdev, NULL, -ENOMEM );
break; break;
} }
if ( pnic_command ( pnic, PNIC_CMD_RECV, NULL, 0, if ( pnic_command ( pnic, PNIC_CMD_RECV, NULL, 0,
iobuf->data, ETH_FRAME_LEN, &length ) iobuf->data, ETH_FRAME_LEN, &length )
!= PNIC_STATUS_OK ) { != PNIC_STATUS_OK ) {
free_iob ( iobuf ); netdev_rx_err ( netdev, iobuf, -EIO );
break; break;
} }
iob_put ( iobuf, length ); iob_put ( iobuf, length );

View File

@ -444,6 +444,7 @@ static void rtl_poll ( struct net_device *netdev, unsigned int rx_quota ) {
rx_iob = alloc_iob ( rx_len ); rx_iob = alloc_iob ( rx_len );
if ( ! rx_iob ) { if ( ! rx_iob ) {
netdev_rx_err ( netdev, NULL, -ENOMEM );
/* Leave packet for next call to poll() */ /* Leave packet for next call to poll() */
break; break;
} }
@ -464,6 +465,7 @@ static void rtl_poll ( struct net_device *netdev, unsigned int rx_quota ) {
} else { } else {
DBG ( "RX bad packet (status %#04x len %d)\n", DBG ( "RX bad packet (status %#04x len %d)\n",
rx_status, rx_len ); rx_status, rx_len );
netdev_rx_err ( netdev, NULL, -EINVAL );
} }
rtl->rx.offset = ( ( ( rtl->rx.offset + 4 + rx_len + 3 ) & ~3 ) rtl->rx.offset = ( ( ( rtl->rx.offset + 4 + rx_len + 3 ) & ~3 )
% RX_BUF_LEN ); % RX_BUF_LEN );