2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-26 03:09:12 +00:00

Use netdev_rx_err() to report receive errors.

This commit is contained in:
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;
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 );

View File

@ -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 );