pcnet32: delete non NAPI code from driver.

Delete the non-napi code from the driver and Kconfig.
Tested x86_64. Apply at next open opportunity.

Signed-off-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by Don Fry and committed by Jeff Garzik 01935d7d a86e2cbe

+4 -71
-14
drivers/net/Kconfig
··· 1273 To compile this driver as a module, choose M here. The module 1274 will be called pcnet32. 1275 1276 - config PCNET32_NAPI 1277 - bool "Use RX polling (NAPI)" 1278 - depends on PCNET32 1279 - help 1280 - NAPI is a new driver API designed to reduce CPU and interrupt load 1281 - when the driver is receiving lots of packets from the card. It is 1282 - still somewhat experimental and thus not yet enabled by default. 1283 - 1284 - If your estimated Rx load is 10kpps or more, or if the card will be 1285 - deployed on potentially unfriendly networks (e.g. in a firewall), 1286 - then say Y here. 1287 - 1288 - If in doubt, say N. 1289 - 1290 config AMD8111_ETH 1291 tristate "AMD 8111 (new PCI lance) support" 1292 depends on NET_PCI && PCI
··· 1273 To compile this driver as a module, choose M here. The module 1274 will be called pcnet32. 1275 1276 config AMD8111_ETH 1277 tristate "AMD 8111 (new PCI lance) support" 1278 depends on NET_PCI && PCI
+4 -57
drivers/net/pcnet32.c
··· 22 *************************************************************************/ 23 24 #define DRV_NAME "pcnet32" 25 - #ifdef CONFIG_PCNET32_NAPI 26 - #define DRV_VERSION "1.34-NAPI" 27 - #else 28 - #define DRV_VERSION "1.34" 29 - #endif 30 - #define DRV_RELDATE "14.Aug.2007" 31 #define PFX DRV_NAME ": " 32 33 static const char *const version = ··· 441 442 static void pcnet32_netif_stop(struct net_device *dev) 443 { 444 - #ifdef CONFIG_PCNET32_NAPI 445 struct pcnet32_private *lp = netdev_priv(dev); 446 - #endif 447 dev->trans_start = jiffies; 448 - #ifdef CONFIG_PCNET32_NAPI 449 napi_disable(&lp->napi); 450 - #endif 451 netif_tx_disable(dev); 452 } 453 454 static void pcnet32_netif_start(struct net_device *dev) 455 { 456 - #ifdef CONFIG_PCNET32_NAPI 457 struct pcnet32_private *lp = netdev_priv(dev); 458 ulong ioaddr = dev->base_addr; 459 u16 val; 460 - #endif 461 netif_wake_queue(dev); 462 - #ifdef CONFIG_PCNET32_NAPI 463 val = lp->a.read_csr(ioaddr, CSR3); 464 val &= 0x00ff; 465 lp->a.write_csr(ioaddr, CSR3, val); 466 napi_enable(&lp->napi); 467 - #endif 468 } 469 470 /* ··· 901 rc = 1; /* default to fail */ 902 903 if (netif_running(dev)) 904 - #ifdef CONFIG_PCNET32_NAPI 905 pcnet32_netif_stop(dev); 906 - #else 907 - pcnet32_close(dev); 908 - #endif 909 910 spin_lock_irqsave(&lp->lock, flags); 911 lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */ ··· 1032 x = a->read_bcr(ioaddr, 32); /* reset internal loopback */ 1033 a->write_bcr(ioaddr, 32, (x & ~0x0002)); 1034 1035 - #ifdef CONFIG_PCNET32_NAPI 1036 if (netif_running(dev)) { 1037 pcnet32_netif_start(dev); 1038 pcnet32_restart(dev, CSR0_NORMAL); ··· 1040 lp->a.write_bcr(ioaddr, 20, 4); /* return to 16bit mode */ 1041 } 1042 spin_unlock_irqrestore(&lp->lock, flags); 1043 - #else 1044 - if (netif_running(dev)) { 1045 - spin_unlock_irqrestore(&lp->lock, flags); 1046 - pcnet32_open(dev); 1047 - } else { 1048 - pcnet32_purge_rx_ring(dev); 1049 - lp->a.write_bcr(ioaddr, 20, 4); /* return to 16bit mode */ 1050 - spin_unlock_irqrestore(&lp->lock, flags); 1051 - } 1052 - #endif 1053 1054 return (rc); 1055 } /* end pcnet32_loopback_test */ ··· 1245 } 1246 dev->stats.rx_bytes += skb->len; 1247 skb->protocol = eth_type_trans(skb, dev); 1248 - #ifdef CONFIG_PCNET32_NAPI 1249 netif_receive_skb(skb); 1250 - #else 1251 - netif_rx(skb); 1252 - #endif 1253 dev->last_rx = jiffies; 1254 dev->stats.rx_packets++; 1255 return; ··· 1374 return must_restart; 1375 } 1376 1377 - #ifdef CONFIG_PCNET32_NAPI 1378 static int pcnet32_poll(struct napi_struct *napi, int budget) 1379 { 1380 struct pcnet32_private *lp = container_of(napi, struct pcnet32_private, napi); ··· 1412 } 1413 return work_done; 1414 } 1415 - #endif 1416 1417 #define PCNET32_REGS_PER_PHY 32 1418 #define PCNET32_MAX_PHYS 32 ··· 1833 /* napi.weight is used in both the napi and non-napi cases */ 1834 lp->napi.weight = lp->rx_ring_size / 2; 1835 1836 - #ifdef CONFIG_PCNET32_NAPI 1837 netif_napi_add(dev, &lp->napi, pcnet32_poll, lp->rx_ring_size / 2); 1838 - #endif 1839 1840 if (fdx && !(lp->options & PCNET32_PORT_ASEL) && 1841 ((cards_found >= MAX_UNITS) || full_duplex[cards_found])) ··· 2264 goto err_free_ring; 2265 } 2266 2267 - #ifdef CONFIG_PCNET32_NAPI 2268 napi_enable(&lp->napi); 2269 - #endif 2270 2271 /* Re-initialize the PCNET32, and start it when done. */ 2272 lp->a.write_csr(ioaddr, 1, (lp->init_dma_addr & 0xffff)); ··· 2588 dev->name, csr0); 2589 /* unlike for the lance, there is no restart needed */ 2590 } 2591 - #ifdef CONFIG_PCNET32_NAPI 2592 if (netif_rx_schedule_prep(dev, &lp->napi)) { 2593 u16 val; 2594 /* set interrupt masks */ ··· 2598 __netif_rx_schedule(dev, &lp->napi); 2599 break; 2600 } 2601 - #else 2602 - pcnet32_rx(dev, lp->napi.weight); 2603 - if (pcnet32_tx(dev)) { 2604 - /* reset the chip to clear the error condition, then restart */ 2605 - lp->a.reset(ioaddr); 2606 - lp->a.write_csr(ioaddr, CSR4, 0x0915); /* auto tx pad */ 2607 - pcnet32_restart(dev, CSR0_START); 2608 - netif_wake_queue(dev); 2609 - } 2610 - #endif 2611 csr0 = lp->a.read_csr(ioaddr, CSR0); 2612 } 2613 - 2614 - #ifndef CONFIG_PCNET32_NAPI 2615 - /* Set interrupt enable. */ 2616 - lp->a.write_csr(ioaddr, CSR0, CSR0_INTEN); 2617 - #endif 2618 2619 if (netif_msg_intr(lp)) 2620 printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n", ··· 2619 del_timer_sync(&lp->watchdog_timer); 2620 2621 netif_stop_queue(dev); 2622 - #ifdef CONFIG_PCNET32_NAPI 2623 napi_disable(&lp->napi); 2624 - #endif 2625 2626 spin_lock_irqsave(&lp->lock, flags); 2627
··· 22 *************************************************************************/ 23 24 #define DRV_NAME "pcnet32" 25 + #define DRV_VERSION "1.35" 26 + #define DRV_RELDATE "21.Apr.2008" 27 #define PFX DRV_NAME ": " 28 29 static const char *const version = ··· 445 446 static void pcnet32_netif_stop(struct net_device *dev) 447 { 448 struct pcnet32_private *lp = netdev_priv(dev); 449 + 450 dev->trans_start = jiffies; 451 napi_disable(&lp->napi); 452 netif_tx_disable(dev); 453 } 454 455 static void pcnet32_netif_start(struct net_device *dev) 456 { 457 struct pcnet32_private *lp = netdev_priv(dev); 458 ulong ioaddr = dev->base_addr; 459 u16 val; 460 + 461 netif_wake_queue(dev); 462 val = lp->a.read_csr(ioaddr, CSR3); 463 val &= 0x00ff; 464 lp->a.write_csr(ioaddr, CSR3, val); 465 napi_enable(&lp->napi); 466 } 467 468 /* ··· 911 rc = 1; /* default to fail */ 912 913 if (netif_running(dev)) 914 pcnet32_netif_stop(dev); 915 916 spin_lock_irqsave(&lp->lock, flags); 917 lp->a.write_csr(ioaddr, CSR0, CSR0_STOP); /* stop the chip */ ··· 1046 x = a->read_bcr(ioaddr, 32); /* reset internal loopback */ 1047 a->write_bcr(ioaddr, 32, (x & ~0x0002)); 1048 1049 if (netif_running(dev)) { 1050 pcnet32_netif_start(dev); 1051 pcnet32_restart(dev, CSR0_NORMAL); ··· 1055 lp->a.write_bcr(ioaddr, 20, 4); /* return to 16bit mode */ 1056 } 1057 spin_unlock_irqrestore(&lp->lock, flags); 1058 1059 return (rc); 1060 } /* end pcnet32_loopback_test */ ··· 1270 } 1271 dev->stats.rx_bytes += skb->len; 1272 skb->protocol = eth_type_trans(skb, dev); 1273 netif_receive_skb(skb); 1274 dev->last_rx = jiffies; 1275 dev->stats.rx_packets++; 1276 return; ··· 1403 return must_restart; 1404 } 1405 1406 static int pcnet32_poll(struct napi_struct *napi, int budget) 1407 { 1408 struct pcnet32_private *lp = container_of(napi, struct pcnet32_private, napi); ··· 1442 } 1443 return work_done; 1444 } 1445 1446 #define PCNET32_REGS_PER_PHY 32 1447 #define PCNET32_MAX_PHYS 32 ··· 1864 /* napi.weight is used in both the napi and non-napi cases */ 1865 lp->napi.weight = lp->rx_ring_size / 2; 1866 1867 netif_napi_add(dev, &lp->napi, pcnet32_poll, lp->rx_ring_size / 2); 1868 1869 if (fdx && !(lp->options & PCNET32_PORT_ASEL) && 1870 ((cards_found >= MAX_UNITS) || full_duplex[cards_found])) ··· 2297 goto err_free_ring; 2298 } 2299 2300 napi_enable(&lp->napi); 2301 2302 /* Re-initialize the PCNET32, and start it when done. */ 2303 lp->a.write_csr(ioaddr, 1, (lp->init_dma_addr & 0xffff)); ··· 2623 dev->name, csr0); 2624 /* unlike for the lance, there is no restart needed */ 2625 } 2626 if (netif_rx_schedule_prep(dev, &lp->napi)) { 2627 u16 val; 2628 /* set interrupt masks */ ··· 2634 __netif_rx_schedule(dev, &lp->napi); 2635 break; 2636 } 2637 csr0 = lp->a.read_csr(ioaddr, CSR0); 2638 } 2639 2640 if (netif_msg_intr(lp)) 2641 printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n", ··· 2670 del_timer_sync(&lp->watchdog_timer); 2671 2672 netif_stop_queue(dev); 2673 napi_disable(&lp->napi); 2674 2675 spin_lock_irqsave(&lp->lock, flags); 2676