Compile-tested only.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-config VIA_RHINE_NAPI
- bool "Use Rx Polling (NAPI)"
- depends on VIA_RHINE
- help
- NAPI is a new driver API designed to reduce CPU and interrupt load
- when the driver is receiving lots of packets from the card.
-
- If your estimated Rx load is 10kpps or more, or if the card will be
- deployed on potentially unfriendly networks (e.g. in a firewall),
- then say Y here.
-
config LAN_SAA9730
bool "Philips SAA9730 Ethernet support"
depends on NET_PCI && PCI && MIPS_ATLAS
config LAN_SAA9730
bool "Philips SAA9730 Ethernet support"
depends on NET_PCI && PCI && MIPS_ATLAS
There are no ill effects from too-large receive rings. */
#define TX_RING_SIZE 16
#define TX_QUEUE_LEN 10 /* Limit ring entries actually used. */
There are no ill effects from too-large receive rings. */
#define TX_RING_SIZE 16
#define TX_QUEUE_LEN 10 /* Limit ring entries actually used. */
-#ifdef CONFIG_VIA_RHINE_NAPI
-#else
-#define RX_RING_SIZE 16
-#endif
-
/* Operational parameters that usually are not changed. */
/* Operational parameters that usually are not changed. */
-#ifdef CONFIG_VIA_RHINE_NAPI
static int rhine_napipoll(struct napi_struct *napi, int budget)
{
struct rhine_private *rp = container_of(napi, struct rhine_private, napi);
static int rhine_napipoll(struct napi_struct *napi, int budget)
{
struct rhine_private *rp = container_of(napi, struct rhine_private, napi);
static void __devinit rhine_hw_init(struct net_device *dev, long pioaddr)
{
static void __devinit rhine_hw_init(struct net_device *dev, long pioaddr)
{
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = rhine_poll;
#endif
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = rhine_poll;
#endif
-#ifdef CONFIG_VIA_RHINE_NAPI
netif_napi_add(dev, &rp->napi, rhine_napipoll, 64);
netif_napi_add(dev, &rp->napi, rhine_napipoll, 64);
if (rp->quirks & rqRhineI)
dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
if (rp->quirks & rqRhineI)
dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
-#ifdef CONFIG_VIA_RHINE_NAPI
/* Enable interrupts by setting the interrupt mask. */
iowrite16(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow |
/* Enable interrupts by setting the interrupt mask. */
iowrite16(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow |
/* protect against concurrent rx interrupts */
disable_irq(rp->pdev->irq);
/* protect against concurrent rx interrupts */
disable_irq(rp->pdev->irq);
-#ifdef CONFIG_VIA_RHINE_NAPI
if (intr_status & (IntrRxDone | IntrRxErr | IntrRxDropped |
IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf)) {
if (intr_status & (IntrRxDone | IntrRxErr | IntrRxDropped |
IntrRxWakeUp | IntrRxEmpty | IntrRxNoBuf)) {
-#ifdef CONFIG_VIA_RHINE_NAPI
iowrite16(IntrTxAborted |
IntrTxDone | IntrTxError | IntrTxUnderrun |
IntrPCIErr | IntrStatsMax | IntrLinkChange,
ioaddr + IntrEnable);
netif_rx_schedule(dev, &rp->napi);
iowrite16(IntrTxAborted |
IntrTxDone | IntrTxError | IntrTxUnderrun |
IntrPCIErr | IntrStatsMax | IntrLinkChange,
ioaddr + IntrEnable);
netif_rx_schedule(dev, &rp->napi);
-#else
- rhine_rx(dev, RX_RING_SIZE);
-#endif
}
if (intr_status & (IntrTxErrSummary | IntrTxDone)) {
}
if (intr_status & (IntrTxErrSummary | IntrTxDone)) {
PCI_DMA_FROMDEVICE);
}
skb->protocol = eth_type_trans(skb, dev);
PCI_DMA_FROMDEVICE);
}
skb->protocol = eth_type_trans(skb, dev);
-#ifdef CONFIG_VIA_RHINE_NAPI
-#else
- netif_rx(skb);
-#endif
dev->last_rx = jiffies;
rp->stats.rx_bytes += pkt_len;
rp->stats.rx_packets++;
dev->last_rx = jiffies;
rp->stats.rx_bytes += pkt_len;
rp->stats.rx_packets++;
spin_lock_irq(&rp->lock);
netif_stop_queue(dev);
spin_lock_irq(&rp->lock);
netif_stop_queue(dev);
-#ifdef CONFIG_VIA_RHINE_NAPI
if (debug > 1)
printk(KERN_DEBUG "%s: Shutting down ethercard, "
if (debug > 1)
printk(KERN_DEBUG "%s: Shutting down ethercard, "
if (!netif_running(dev))
return 0;
if (!netif_running(dev))
return 0;
-#ifdef CONFIG_VIA_RHINE_NAPI
netif_device_detach(dev);
pci_save_state(pdev);
netif_device_detach(dev);
pci_save_state(pdev);