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:
parent
539ff45fd0
commit
ed7eae6005
@ -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 );
|
||||
|
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user