/* Check the interrupt status register for more packets in the
mean time. Process them since we have not used up our quota.*/
intr0=readl(mmio+INT0);
/*Ack receive packets */
writel(intr0&RINT0,mmio+INT0);
}while(intr0&RINT0);
/* Receive descriptor is empty now */
dev->quota-=num_rx_pkt;
*budget-=num_rx_pkt;
netif_rx_complete(dev);
/* enable receive interrupt */
writel(VAL0|RINTEN0,mmio+INTEN0);
writel(VAL2|RDMD0,mmio+CMD0);
return0;
rx_not_empty:
/* Do not call a netif_rx_complete */
dev->quota-=num_rx_pkt;
*budget-=num_rx_pkt;
return1;
}
#else
/*
This function will check the ownership of receive buffers and descriptors. It will indicate to kernel up to half the number of maximum receive buffers in the descriptor ring, in a single receive interrupt. It will also replenish the descriptors with new skbs.
*/
...
...
@@ -710,7 +865,7 @@ static int amd8111e_rx(struct net_device *dev)
intrx_index=lp->rx_idx&RX_RING_DR_MOD_MASK;
intmin_pkt_len,status;
intnum_rx_pkt=0;
intmax_rx_pkt=NUM_RX_BUFFERS/2;
intmax_rx_pkt=NUM_RX_BUFFERS;
shortpkt_len;
#if AMD8111E_VLAN_TAG_USED
shortvtag;
...
...
@@ -752,14 +907,14 @@ static int amd8111e_rx(struct net_device *dev)
if(pkt_len<min_pkt_len){
lp->rx_ring[rx_index].rx_flags&=RESET_RX_FLAGS;
lp->stats.rx_errors++;
lp->drv_rx_errors++;
gotoerr_next_pkt;
}
if(!(new_skb=dev_alloc_skb(lp->rx_buff_len))){
/* if allocation fail,
ignore that pkt and go to next one */
lp->rx_ring[rx_index].rx_flags&=RESET_RX_FLAGS;
lp->stats.rx_errors++;
lp->drv_rx_errors++;
gotoerr_next_pkt;
}
...
...
@@ -803,7 +958,7 @@ static int amd8111e_rx(struct net_device *dev)
return0;
}
#endif /* CONFIG_AMD8111E_NAPI */
/*
This function will indicate the link status to the kernel.