Lines Matching +full:master +full:- +full:stats
2 Written 1997-1998 by Donald Becker.
15 2000/2/2- Added support for kernel-level ISAPnP
19 2001/11/17 - Added ethtool support (jgarzik)
21 2002/10/28 - Locking updates for 2.5 (alan@lxorguk.ukuu.org.uk)
30 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
40 /* Enable the automatic media selection code -- usually set. */
43 /* Allow the use of fragment bus master transfers instead of only
44 programmed-I/O for Vortex cards. Full-bus-master transfers are always
86 /* Put out somewhat more debugging messages. (0 - no msg, 1 minimal msgs). */
88 /* Some values here only for performance evaluation and path-coverage
121 II. Board-specific settings
129 PCI cards, with the bus master interface extensively modified to work with
132 The card is capable of full-bus-master transfers with separate
137 receive buffer. This scheme allocates full-sized skbuffs as receive
139 chosen to trade-off the memory wasted by passing the full-sized skbuff to
141 correctly-sized skbuff.
145 The driver runs as two independent, single-threaded flows of control. One
146 is the send-packet routine, which enforces single-threaded use by the netif
156 project names. I use these names to eliminate confusion -- 3Com product
179 32-bit 'Dwords' rather than octets. */
210 On the Corkscrew this window is always mapped at offsets 0x10-0x1f. */
262 enum Window7 { /* Window 7: Bus Master control. */
266 /* Boomerang-style bus master control registers. Note ISA aliases! */
300 /* The Rx and Tx rings are here to keep them quad-word-aligned. */
303 /* The addresses of transmit- and receive-in-place skbuffs. */
308 struct sk_buff *tx_skb; /* Packet being eaten by bus master ctrl. */
311 int options; /* User-settable misc. driver options. */
314 media_override:3, /* Passed-in media type. */
316 full_duplex:1, autoselect:1, bus_master:1, /* Vortex can only do a fragment bus-m. */
334 mask:8, /* The transceiver-present bit in Wn3_Config. */
384 init_module() -- modules / tc59x_init() -- built-in
388 Different versions exist for modules and built-in.
389 corkscrew_probe1() Fill in the device structure -- this is separated
390 so that the modules code can put it in dev->init.
392 /* This driver uses 'options' to pass the media type, full-duplex flag, etc. */
394 static int options[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1, };
397 static int debug = -1;
403 MODULE_PARM_DESC(debug, "3c515 debug level (0-6)");
404 MODULE_PARM_DESC(options, "3c515: Bits 0-2: media type, bit 3: full duplex, bit 4: bus mastering");
405 MODULE_PARM_DESC(rx_copybreak, "3c515 copy breakpoint for copy-only-tiny-frames");
417 while (corkscrew_scan(-1)) in corkscrew_init_module()
419 return found ? 0 : -ENODEV; in corkscrew_init_module()
429 return ERR_PTR(-ENODEV); in tc515_probe()
449 for (timer = 4; timer >= 0; timer--) { in check_device()
464 list_del_init(&vp->list); in cleanup_card()
465 if (dev->dma) in cleanup_card()
466 free_dma(dev->dma); in cleanup_card()
467 outw(TotalReset, dev->base_addr + EL3_CMD); in cleanup_card()
468 release_region(dev->base_addr, CORKSCREW_TOTAL_SIZE); in cleanup_card()
469 if (vp->dev) in cleanup_card()
470 pnp_device_detach(to_pnp_dev(vp->dev)); in cleanup_card()
486 return ERR_PTR(-ENOMEM); in corkscrew_scan()
489 sprintf(dev->name, "eth%d", unit); in corkscrew_scan()
527 SET_NETDEV_DEV(dev, &idev->dev); in corkscrew_scan()
538 /* Check all locations on the ISA bus -- evil! */ in corkscrew_scan()
579 vp->dev = &idev->dev; in corkscrew_setup()
587 dev->base_addr = ioaddr; in corkscrew_setup()
588 dev->irq = irq; in corkscrew_setup()
589 dev->dma = inw(ioaddr + 0x2000) & 7; in corkscrew_setup()
590 vp->product_name = "3c515"; in corkscrew_setup()
591 vp->options = dev->mem_start; in corkscrew_setup()
592 vp->our_dev = dev; in corkscrew_setup()
594 if (!vp->options) { in corkscrew_setup()
596 vp->options = -1; in corkscrew_setup()
598 vp->options = options[card_number]; in corkscrew_setup()
601 if (vp->options >= 0) { in corkscrew_setup()
602 vp->media_override = vp->options & 7; in corkscrew_setup()
603 if (vp->media_override == 2) in corkscrew_setup()
604 vp->media_override = 0; in corkscrew_setup()
605 vp->full_duplex = (vp->options & 8) ? 1 : 0; in corkscrew_setup()
606 vp->bus_master = (vp->options & 16) ? 1 : 0; in corkscrew_setup()
608 vp->media_override = 7; in corkscrew_setup()
609 vp->full_duplex = 0; in corkscrew_setup()
610 vp->bus_master = 0; in corkscrew_setup()
613 list_add(&vp->list, &root_corkscrew_dev); in corkscrew_setup()
616 pr_info("%s: 3Com %s at %#3x,", dev->name, vp->product_name, ioaddr); in corkscrew_setup()
618 spin_lock_init(&vp->lock); in corkscrew_setup()
620 timer_setup(&vp->timer, corkscrew_timer, 0); in corkscrew_setup()
628 for (timer = 4; timer >= 0; timer--) { in corkscrew_setup()
642 pr_cont(" %pM", dev->dev_addr); in corkscrew_setup()
644 if (request_dma(dev->dma, "3c515")) { in corkscrew_setup()
645 pr_cont(", DMA %d allocation failed", dev->dma); in corkscrew_setup()
646 dev->dma = 0; in corkscrew_setup()
648 pr_cont(", DMA %d", dev->dma); in corkscrew_setup()
650 pr_cont(", IRQ %d\n", dev->irq); in corkscrew_setup()
652 if (corkscrew_debug && (dev->irq <= 0 || dev->irq > 15)) in corkscrew_setup()
661 vp->available_media = inw(ioaddr + Wn3_Options); in corkscrew_setup()
666 pr_info(" %dK %s-wide RAM %s Rx:Tx split, %s%s interface.\n", in corkscrew_setup()
672 vp->default_media = (config & Xcvr) >> Xcvr_shift; in corkscrew_setup()
673 vp->autoselect = config & Autoselect ? 1 : 0; in corkscrew_setup()
674 dev->if_port = vp->default_media; in corkscrew_setup()
676 if (vp->media_override != 7) { in corkscrew_setup()
678 vp->media_override, in corkscrew_setup()
679 media_tbl[vp->media_override].name); in corkscrew_setup()
680 dev->if_port = vp->media_override; in corkscrew_setup()
683 vp->capabilities = eeprom[16]; in corkscrew_setup()
684 vp->full_bus_master_tx = (vp->capabilities & 0x20) ? 1 : 0; in corkscrew_setup()
686 /* vp->full_bus_master_rx = 0; */ in corkscrew_setup()
687 vp->full_bus_master_rx = (vp->capabilities & 0x20) ? 1 : 0; in corkscrew_setup()
689 /* The 3c51x-specific entries in the device structure. */ in corkscrew_setup()
690 dev->netdev_ops = &netdev_ops; in corkscrew_setup()
691 dev->watchdog_timeo = (400 * HZ) / 1000; in corkscrew_setup()
692 dev->ethtool_ops = &netdev_ethtool_ops; in corkscrew_setup()
700 int ioaddr = dev->base_addr; in corkscrew_open()
708 if (vp->full_duplex) in corkscrew_open()
709 outb(0x20, ioaddr + Wn3_MAC_Ctrl); /* Set the full-duplex bit. */ in corkscrew_open()
712 if (vp->media_override != 7) { in corkscrew_open()
715 dev->name, vp->media_override, in corkscrew_open()
716 media_tbl[vp->media_override].name); in corkscrew_open()
717 dev->if_port = vp->media_override; in corkscrew_open()
718 } else if (vp->autoselect) { in corkscrew_open()
720 dev->if_port = 4; in corkscrew_open()
721 while (!(vp->available_media & media_tbl[dev->if_port].mask)) in corkscrew_open()
722 dev->if_port = media_tbl[dev->if_port].next; in corkscrew_open()
726 dev->name, media_tbl[dev->if_port].name); in corkscrew_open()
729 dev->if_port = vp->default_media; in corkscrew_open()
731 config = (config & ~Xcvr) | (dev->if_port << Xcvr_shift); in corkscrew_open()
736 dev->name, config); in corkscrew_open()
740 for (i = 20; i >= 0; i--) in corkscrew_open()
746 for (i = 20; i >= 0; i--) in corkscrew_open()
752 /* Use the now-standard shared IRQ implementation. */ in corkscrew_open()
753 if (vp->capabilities == 0x11c7) { in corkscrew_open()
755 if (dev->irq == 0 || in corkscrew_open()
756 dev->dma == 0 || in corkscrew_open()
757 request_irq(dev->irq, corkscrew_interrupt, 0, in corkscrew_open()
758 vp->product_name, dev)) in corkscrew_open()
759 return -EAGAIN; in corkscrew_open()
760 enable_dma(dev->dma); in corkscrew_open()
761 set_dma_mode(dev->dma, DMA_MODE_CASCADE); in corkscrew_open()
762 } else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED, in corkscrew_open()
763 vp->product_name, dev)) { in corkscrew_open()
764 return -EAGAIN; in corkscrew_open()
768 mod_timer(&vp->timer, jiffies + media_tbl[dev->if_port].wait); in corkscrew_open()
773 dev->name, dev->irq, inw(ioaddr + Wn4_Media)); in corkscrew_open()
779 outb(dev->dev_addr[i], ioaddr + i); in corkscrew_open()
783 if (dev->if_port == 3) in corkscrew_open()
788 media_tbl[dev->if_port].media_bits, ioaddr + Wn4_Media); in corkscrew_open()
790 /* Switch to the stats window, and clear all stats by reading. */ in corkscrew_open()
806 if (vp->full_bus_master_rx) { /* Boomerang bus master. */ in corkscrew_open()
807 vp->cur_rx = vp->dirty_rx = 0; in corkscrew_open()
809 pr_debug("%s: Filling in the Rx ring.\n", dev->name); in corkscrew_open()
812 if (i < (RX_RING_SIZE - 1)) in corkscrew_open()
813 vp->rx_ring[i].next = in corkscrew_open()
814 isa_virt_to_bus(&vp->rx_ring[i + 1]); in corkscrew_open()
816 vp->rx_ring[i].next = 0; in corkscrew_open()
817 vp->rx_ring[i].status = 0; /* Clear complete bit. */ in corkscrew_open()
818 vp->rx_ring[i].length = PKT_BUF_SZ | 0x80000000; in corkscrew_open()
820 vp->rx_skbuff[i] = skb; in corkscrew_open()
824 vp->rx_ring[i].addr = isa_virt_to_bus(skb->data); in corkscrew_open()
827 vp->rx_ring[i - 1].next = in corkscrew_open()
828 isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */ in corkscrew_open()
829 outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr); in corkscrew_open()
831 if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */ in corkscrew_open()
832 vp->cur_tx = vp->dirty_tx = 0; in corkscrew_open()
836 vp->tx_skbuff[i] = NULL; in corkscrew_open()
839 /* Set receiver mode: presumably accept b-case and phys addr only. */ in corkscrew_open()
849 (vp->full_bus_master_tx ? DownComplete : TxAvailable) | in corkscrew_open()
850 (vp->full_bus_master_rx ? UpComplete : RxComplete) | in corkscrew_open()
851 (vp->bus_master ? DMADone : 0), ioaddr + EL3_CMD); in corkscrew_open()
856 | (vp->bus_master ? DMADone : 0) | UpComplete | DownComplete, in corkscrew_open()
866 struct net_device *dev = vp->our_dev; in corkscrew_timer()
867 int ioaddr = dev->base_addr; in corkscrew_timer()
873 dev->name, media_tbl[dev->if_port].name); in corkscrew_timer()
875 spin_lock_irqsave(&vp->lock, flags); in corkscrew_timer()
882 switch (dev->if_port) { in corkscrew_timer()
890 dev->name, in corkscrew_timer()
891 media_tbl[dev->if_port].name, in corkscrew_timer()
895 dev->name, in corkscrew_timer()
896 media_tbl[dev->if_port].name, in corkscrew_timer()
903 dev->name, in corkscrew_timer()
904 media_tbl[dev->if_port].name, in corkscrew_timer()
912 dev->if_port = in corkscrew_timer()
913 media_tbl[dev->if_port].next; in corkscrew_timer()
915 while (!(vp->available_media & media_tbl[dev->if_port].mask)); in corkscrew_timer()
917 if (dev->if_port == 8) { /* Go back to default. */ in corkscrew_timer()
918 dev->if_port = vp->default_media; in corkscrew_timer()
921 dev->name, in corkscrew_timer()
922 media_tbl[dev->if_port].name); in corkscrew_timer()
926 dev->name, in corkscrew_timer()
927 media_tbl[dev->if_port].name); in corkscrew_timer()
928 vp->timer.expires = jiffies + media_tbl[dev->if_port].wait; in corkscrew_timer()
929 add_timer(&vp->timer); in corkscrew_timer()
932 media_tbl[dev->if_port].media_bits, in corkscrew_timer()
937 config = (config & ~Xcvr) | (dev->if_port << Xcvr_shift); in corkscrew_timer()
940 outw(dev->if_port == 3 ? StartCoax : StopCoax, in corkscrew_timer()
946 spin_unlock_irqrestore(&vp->lock, flags); in corkscrew_timer()
949 dev->name, media_tbl[dev->if_port].name); in corkscrew_timer()
958 int ioaddr = dev->base_addr; in corkscrew_timeout()
961 dev->name, inb(ioaddr + TxStatus), in corkscrew_timeout()
965 pr_warn("%s: Transmitter encountered 16 collisions -- network cable problem?\n", in corkscrew_timeout()
966 dev->name); in corkscrew_timeout()
968 pr_debug(" Flags; bus-master %d, full %d; dirty %d current %d.\n", in corkscrew_timeout()
969 vp->full_bus_master_tx, vp->tx_full, vp->dirty_tx, in corkscrew_timeout()
970 vp->cur_tx); in corkscrew_timeout()
972 &vp->tx_ring[0]); in corkscrew_timeout()
975 &vp->tx_ring[i], in corkscrew_timeout()
976 vp->tx_ring[i].length, vp->tx_ring[i].status); in corkscrew_timeout()
981 for (i = 20; i >= 0; i--) in corkscrew_timeout()
986 dev->stats.tx_errors++; in corkscrew_timeout()
987 dev->stats.tx_dropped++; in corkscrew_timeout()
995 int ioaddr = dev->base_addr; in corkscrew_start_xmit()
997 /* Block a timer-based transmit from overlapping. */ in corkscrew_start_xmit()
1001 if (vp->full_bus_master_tx) { /* BOOMERANG bus-master */ in corkscrew_start_xmit()
1003 int entry = vp->cur_tx % TX_RING_SIZE; in corkscrew_start_xmit()
1008 if (vp->tx_full) /* No room to transmit with */ in corkscrew_start_xmit()
1010 if (vp->cur_tx != 0) in corkscrew_start_xmit()
1011 prev_entry = &vp->tx_ring[(vp->cur_tx - 1) % TX_RING_SIZE]; in corkscrew_start_xmit()
1016 dev->name, vp->cur_tx); in corkscrew_start_xmit()
1017 /* vp->tx_full = 1; */ in corkscrew_start_xmit()
1018 vp->tx_skbuff[entry] = skb; in corkscrew_start_xmit()
1019 vp->tx_ring[entry].next = 0; in corkscrew_start_xmit()
1020 vp->tx_ring[entry].addr = isa_virt_to_bus(skb->data); in corkscrew_start_xmit()
1021 vp->tx_ring[entry].length = skb->len | 0x80000000; in corkscrew_start_xmit()
1022 vp->tx_ring[entry].status = skb->len | 0x80000000; in corkscrew_start_xmit()
1024 spin_lock_irqsave(&vp->lock, flags); in corkscrew_start_xmit()
1027 for (i = 20; i >= 0; i--) in corkscrew_start_xmit()
1031 prev_entry->next = isa_virt_to_bus(&vp->tx_ring[entry]); in corkscrew_start_xmit()
1033 outl(isa_virt_to_bus(&vp->tx_ring[entry]), in corkscrew_start_xmit()
1038 spin_unlock_irqrestore(&vp->lock, flags); in corkscrew_start_xmit()
1040 vp->cur_tx++; in corkscrew_start_xmit()
1041 if (vp->cur_tx - vp->dirty_tx > TX_RING_SIZE - 1) in corkscrew_start_xmit()
1042 vp->tx_full = 1; in corkscrew_start_xmit()
1045 prev_entry->status &= ~0x80000000; in corkscrew_start_xmit()
1051 outl(skb->len, ioaddr + TX_FIFO); in corkscrew_start_xmit()
1052 dev->stats.tx_bytes += skb->len; in corkscrew_start_xmit()
1054 if (vp->bus_master) { in corkscrew_start_xmit()
1055 /* Set the bus-master controller to transfer the packet. */ in corkscrew_start_xmit()
1056 outl(isa_virt_to_bus(skb->data), ioaddr + Wn7_MasterAddr); in corkscrew_start_xmit()
1057 outw((skb->len + 3) & ~3, ioaddr + Wn7_MasterLen); in corkscrew_start_xmit()
1058 vp->tx_skb = skb; in corkscrew_start_xmit()
1063 outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); in corkscrew_start_xmit()
1068 /* Interrupt us when the FIFO has room for max-sized packet. */ in corkscrew_start_xmit()
1074 outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); in corkscrew_start_xmit()
1079 /* Interrupt us when the FIFO has room for max-sized packet. */ in corkscrew_start_xmit()
1081 #endif /* bus master */ in corkscrew_start_xmit()
1089 while (--i > 0 && (tx_status = inb(ioaddr + TxStatus)) > 0) { in corkscrew_start_xmit()
1090 if (tx_status & 0x3C) { /* A Tx-disabling error occurred. */ in corkscrew_start_xmit()
1093 dev->name, tx_status); in corkscrew_start_xmit()
1095 dev->stats.tx_fifo_errors++; in corkscrew_start_xmit()
1097 dev->stats.tx_aborted_errors++; in corkscrew_start_xmit()
1101 for (j = 20; j >= 0; j--) in corkscrew_start_xmit()
1118 /* Use the now-standard shared IRQ implementation. */ in corkscrew_interrupt()
1125 ioaddr = dev->base_addr; in corkscrew_interrupt()
1128 spin_lock(&lp->lock); in corkscrew_interrupt()
1134 dev->name, status, latency); in corkscrew_interrupt()
1137 /* Some interrupt controllers store a bogus interrupt from boot-time. in corkscrew_interrupt()
1142 dev->name, status, netif_running(dev)); in corkscrew_interrupt()
1143 free_irq(dev->irq, dev); in corkscrew_interrupt()
1144 dev->irq = -1; in corkscrew_interrupt()
1151 dev->name, status); in corkscrew_interrupt()
1158 /* There's room in the FIFO for a full-sized packet. */ in corkscrew_interrupt()
1163 unsigned int dirty_tx = lp->dirty_tx; in corkscrew_interrupt()
1165 while (lp->cur_tx - dirty_tx > 0) { in corkscrew_interrupt()
1167 if (inl(ioaddr + DownListPtr) == isa_virt_to_bus(&lp->tx_ring[entry])) in corkscrew_interrupt()
1169 if (lp->tx_skbuff[entry]) { in corkscrew_interrupt()
1170 dev_consume_skb_irq(lp->tx_skbuff[entry]); in corkscrew_interrupt()
1171 lp->tx_skbuff[entry] = NULL; in corkscrew_interrupt()
1175 lp->dirty_tx = dirty_tx; in corkscrew_interrupt()
1177 if (lp->tx_full && (lp->cur_tx - dirty_tx <= TX_RING_SIZE - 1)) { in corkscrew_interrupt()
1178 lp->tx_full = 0; in corkscrew_interrupt()
1185 dev_consume_skb_irq(lp->tx_skb); /* Release the transferred buffer */ in corkscrew_interrupt()
1202 pr_debug("%s: Updating stats.\n", dev->name); in corkscrew_interrupt()
1208 pr_notice("%s: Updating stats failed, disabling stats as an interrupt source.\n", in corkscrew_interrupt()
1209 dev->name); in corkscrew_interrupt()
1230 outw(RxEnable, ioaddr + EL3_CMD); /* Re-enable the receiver. */ in corkscrew_interrupt()
1236 if (--i < 0) { in corkscrew_interrupt()
1238 dev->name, status, SetStatusEnb | ((~status) & 0x7FE)); in corkscrew_interrupt()
1249 spin_unlock(&lp->lock); in corkscrew_interrupt()
1252 pr_debug("%s: exiting interrupt, status %4.4x.\n", dev->name, status); in corkscrew_interrupt()
1258 int ioaddr = dev->base_addr; in corkscrew_rx()
1266 if (rx_status & 0x4000) { /* Error, update stats. */ in corkscrew_rx()
1271 dev->stats.rx_errors++; in corkscrew_rx()
1273 dev->stats.rx_over_errors++; in corkscrew_rx()
1275 dev->stats.rx_length_errors++; in corkscrew_rx()
1277 dev->stats.rx_frame_errors++; in corkscrew_rx()
1279 dev->stats.rx_crc_errors++; in corkscrew_rx()
1281 dev->stats.rx_length_errors++; in corkscrew_rx()
1298 skb->protocol = eth_type_trans(skb, dev); in corkscrew_rx()
1300 dev->stats.rx_packets++; in corkscrew_rx()
1301 dev->stats.rx_bytes += pkt_len; in corkscrew_rx()
1303 for (i = 200; i >= 0; i--) in corkscrew_rx()
1308 pr_debug("%s: Couldn't allocate a sk_buff of size %d.\n", dev->name, pkt_len); in corkscrew_rx()
1311 dev->stats.rx_dropped++; in corkscrew_rx()
1313 for (i = 200; i >= 0; i--) in corkscrew_rx()
1323 int entry = vp->cur_rx % RX_RING_SIZE; in boomerang_rx()
1324 int ioaddr = dev->base_addr; in boomerang_rx()
1330 while ((rx_status = vp->rx_ring[entry].status) & RxDComplete) { in boomerang_rx()
1331 if (rx_status & RxDError) { /* Error, update stats. */ in boomerang_rx()
1336 dev->stats.rx_errors++; in boomerang_rx()
1338 dev->stats.rx_over_errors++; in boomerang_rx()
1340 dev->stats.rx_length_errors++; in boomerang_rx()
1342 dev->stats.rx_frame_errors++; in boomerang_rx()
1344 dev->stats.rx_crc_errors++; in boomerang_rx()
1346 dev->stats.rx_length_errors++; in boomerang_rx()
1352 dev->stats.rx_bytes += pkt_len; in boomerang_rx()
1364 isa_bus_to_virt(vp->rx_ring[entry].addr), in boomerang_rx()
1370 skb = vp->rx_skbuff[entry]; in boomerang_rx()
1371 vp->rx_skbuff[entry] = NULL; in boomerang_rx()
1374 if (isa_bus_to_virt(vp->rx_ring[entry].addr) != temp) in boomerang_rx()
1375 pr_warn("%s: Warning -- the skbuff addresses do not match in boomerang_rx: %p vs. %p / %p\n", in boomerang_rx()
1376 dev->name, in boomerang_rx()
1377 isa_bus_to_virt(vp->rx_ring[entry].addr), in boomerang_rx()
1378 skb->head, temp); in boomerang_rx()
1381 skb->protocol = eth_type_trans(skb, dev); in boomerang_rx()
1383 dev->stats.rx_packets++; in boomerang_rx()
1385 entry = (++vp->cur_rx) % RX_RING_SIZE; in boomerang_rx()
1388 for (; vp->cur_rx - vp->dirty_rx > 0; vp->dirty_rx++) { in boomerang_rx()
1390 entry = vp->dirty_rx % RX_RING_SIZE; in boomerang_rx()
1391 if (vp->rx_skbuff[entry] == NULL) { in boomerang_rx()
1396 vp->rx_ring[entry].addr = isa_virt_to_bus(skb->data); in boomerang_rx()
1397 vp->rx_skbuff[entry] = skb; in boomerang_rx()
1399 vp->rx_ring[entry].status = 0; /* Clear complete bit. */ in boomerang_rx()
1407 int ioaddr = dev->base_addr; in corkscrew_close()
1414 dev->name, inw(ioaddr + EL3_STATUS), in corkscrew_close()
1416 pr_debug("%s: corkscrew close stats: rx_nocopy %d rx_copy %d tx_queued %d.\n", in corkscrew_close()
1417 dev->name, rx_nocopy, rx_copy, queued_packet); in corkscrew_close()
1420 del_timer_sync(&vp->timer); in corkscrew_close()
1422 /* Turn off statistics ASAP. We update lp->stats below. */ in corkscrew_close()
1429 if (dev->if_port == XCVR_10base2) in corkscrew_close()
1433 free_irq(dev->irq, dev); in corkscrew_close()
1438 if (vp->full_bus_master_rx) { /* Free Boomerang bus master Rx buffers. */ in corkscrew_close()
1441 if (vp->rx_skbuff[i]) { in corkscrew_close()
1442 dev_kfree_skb(vp->rx_skbuff[i]); in corkscrew_close()
1443 vp->rx_skbuff[i] = NULL; in corkscrew_close()
1446 if (vp->full_bus_master_tx) { /* Free Boomerang bus master Tx buffers. */ in corkscrew_close()
1449 if (vp->tx_skbuff[i]) { in corkscrew_close()
1450 dev_kfree_skb(vp->tx_skbuff[i]); in corkscrew_close()
1451 vp->tx_skbuff[i] = NULL; in corkscrew_close()
1464 spin_lock_irqsave(&vp->lock, flags); in corkscrew_get_stats()
1465 update_stats(dev->base_addr, dev); in corkscrew_get_stats()
1466 spin_unlock_irqrestore(&vp->lock, flags); in corkscrew_get_stats()
1468 return &dev->stats; in corkscrew_get_stats()
1480 /* Unlike the 3c5x9 we need not turn off stats updates while reading. */ in update_stats()
1481 /* Switch to the stats window, and read everything. */ in update_stats()
1483 dev->stats.tx_carrier_errors += inb(ioaddr + 0); in update_stats()
1484 dev->stats.tx_heartbeat_errors += inb(ioaddr + 1); in update_stats()
1486 dev->stats.collisions += inb(ioaddr + 3); in update_stats()
1487 dev->stats.tx_window_errors += inb(ioaddr + 4); in update_stats()
1488 dev->stats.rx_fifo_errors += inb(ioaddr + 5); in update_stats()
1489 dev->stats.tx_packets += inb(ioaddr + 6); in update_stats()
1490 dev->stats.tx_packets += (inb(ioaddr + 9) & 0x30) << 4; in update_stats()
1513 int ioaddr = dev->base_addr; in set_rx_mode()
1516 if (dev->flags & IFF_PROMISC) { in set_rx_mode()
1519 dev->name); in set_rx_mode()
1521 } else if (!netdev_mc_empty(dev) || dev->flags & IFF_ALLMULTI) { in set_rx_mode()
1532 strscpy(info->driver, DRV_NAME, sizeof(info->driver)); in netdev_get_drvinfo()
1533 snprintf(info->bus_info, sizeof(info->bus_info), "ISA 0x%lx", in netdev_get_drvinfo()
1534 dev->base_addr); in netdev_get_drvinfo()
1563 dev = vp->our_dev; in cleanup_module()