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.
37 /* Enable the automatic media selection code -- usually set. */
40 /* Allow the use of fragment bus master transfers instead of only
41 programmed-I/O for Vortex cards. Full-bus-master transfers are always
83 /* Put out somewhat more debugging messages. (0 - no msg, 1 minimal msgs). */
85 /* Some values here only for performance evaluation and path-coverage
118 II. Board-specific settings
126 PCI cards, with the bus master interface extensively modified to work with
129 The card is capable of full-bus-master transfers with separate
134 receive buffer. This scheme allocates full-sized skbuffs as receive
136 chosen to trade-off the memory wasted by passing the full-sized skbuff to
138 correctly-sized skbuff.
142 The driver runs as two independent, single-threaded flows of control. One
143 is the send-packet routine, which enforces single-threaded use by the netif
153 project names. I use these names to eliminate confusion -- 3Com product
176 32-bit 'Dwords' rather than octets. */
207 On the Corkscrew this window is always mapped at offsets 0x10-0x1f. */
259 enum Window7 { /* Window 7: Bus Master control. */
263 /* Boomerang-style bus master control registers. Note ISA aliases! */
297 /* The Rx and Tx rings are here to keep them quad-word-aligned. */
300 /* The addresses of transmit- and receive-in-place skbuffs. */
305 struct sk_buff *tx_skb; /* Packet being eaten by bus master ctrl. */
308 int options; /* User-settable misc. driver options. */
311 media_override:3, /* Passed-in media type. */
313 full_duplex:1, autoselect:1, bus_master:1, /* Vortex can only do a fragment bus-m. */
331 mask:8, /* The transceiver-present bit in Wn3_Config. */
381 init_module() -- modules / tc59x_init() -- built-in
385 Different versions exist for modules and built-in.
386 corkscrew_probe1() Fill in the device structure -- this is separated
387 so that the modules code can put it in dev->init.
389 /* This driver uses 'options' to pass the media type, full-duplex flag, etc. */
391 static int options[MAX_UNITS] = { -1, -1, -1, -1, -1, -1, -1, -1, };
394 static int debug = -1;
400 MODULE_PARM_DESC(debug, "3c515 debug level (0-6)");
401 MODULE_PARM_DESC(options, "3c515: Bits 0-2: media type, bit 3: full duplex, bit 4: bus mastering");
402 MODULE_PARM_DESC(rx_copybreak, "3c515 copy breakpoint for copy-only-tiny-frames");
414 while (corkscrew_scan(-1)) in corkscrew_init_module()
416 return found ? 0 : -ENODEV; in corkscrew_init_module()
426 return ERR_PTR(-ENODEV); in tc515_probe()
446 for (timer = 4; timer >= 0; timer--) { in check_device()
461 list_del_init(&vp->list); in cleanup_card()
462 if (dev->dma) in cleanup_card()
463 free_dma(dev->dma); in cleanup_card()
464 outw(TotalReset, dev->base_addr + EL3_CMD); in cleanup_card()
465 release_region(dev->base_addr, CORKSCREW_TOTAL_SIZE); in cleanup_card()
466 if (vp->dev) in cleanup_card()
467 pnp_device_detach(to_pnp_dev(vp->dev)); in cleanup_card()
483 return ERR_PTR(-ENOMEM); in corkscrew_scan()
486 sprintf(dev->name, "eth%d", unit); in corkscrew_scan()
524 SET_NETDEV_DEV(dev, &idev->dev); in corkscrew_scan()
535 /* Check all locations on the ISA bus -- evil! */ in corkscrew_scan()
576 vp->dev = &idev->dev; in corkscrew_setup()
584 dev->base_addr = ioaddr; in corkscrew_setup()
585 dev->irq = irq; in corkscrew_setup()
586 dev->dma = inw(ioaddr + 0x2000) & 7; in corkscrew_setup()
587 vp->product_name = "3c515"; in corkscrew_setup()
588 vp->options = dev->mem_start; in corkscrew_setup()
589 vp->our_dev = dev; in corkscrew_setup()
591 if (!vp->options) { in corkscrew_setup()
593 vp->options = -1; in corkscrew_setup()
595 vp->options = options[card_number]; in corkscrew_setup()
598 if (vp->options >= 0) { in corkscrew_setup()
599 vp->media_override = vp->options & 7; in corkscrew_setup()
600 if (vp->media_override == 2) in corkscrew_setup()
601 vp->media_override = 0; in corkscrew_setup()
602 vp->full_duplex = (vp->options & 8) ? 1 : 0; in corkscrew_setup()
603 vp->bus_master = (vp->options & 16) ? 1 : 0; in corkscrew_setup()
605 vp->media_override = 7; in corkscrew_setup()
606 vp->full_duplex = 0; in corkscrew_setup()
607 vp->bus_master = 0; in corkscrew_setup()
610 list_add(&vp->list, &root_corkscrew_dev); in corkscrew_setup()
613 pr_info("%s: 3Com %s at %#3x,", dev->name, vp->product_name, ioaddr); in corkscrew_setup()
615 spin_lock_init(&vp->lock); in corkscrew_setup()
617 timer_setup(&vp->timer, corkscrew_timer, 0); in corkscrew_setup()
625 for (timer = 4; timer >= 0; timer--) { in corkscrew_setup()
639 pr_cont(" %pM", dev->dev_addr); in corkscrew_setup()
641 if (request_dma(dev->dma, "3c515")) { in corkscrew_setup()
642 pr_cont(", DMA %d allocation failed", dev->dma); in corkscrew_setup()
643 dev->dma = 0; in corkscrew_setup()
645 pr_cont(", DMA %d", dev->dma); in corkscrew_setup()
647 pr_cont(", IRQ %d\n", dev->irq); in corkscrew_setup()
649 if (corkscrew_debug && (dev->irq <= 0 || dev->irq > 15)) in corkscrew_setup()
658 vp->available_media = inw(ioaddr + Wn3_Options); in corkscrew_setup()
663 pr_info(" %dK %s-wide RAM %s Rx:Tx split, %s%s interface.\n", in corkscrew_setup()
669 vp->default_media = (config & Xcvr) >> Xcvr_shift; in corkscrew_setup()
670 vp->autoselect = config & Autoselect ? 1 : 0; in corkscrew_setup()
671 dev->if_port = vp->default_media; in corkscrew_setup()
673 if (vp->media_override != 7) { in corkscrew_setup()
675 vp->media_override, in corkscrew_setup()
676 media_tbl[vp->media_override].name); in corkscrew_setup()
677 dev->if_port = vp->media_override; in corkscrew_setup()
680 vp->capabilities = eeprom[16]; in corkscrew_setup()
681 vp->full_bus_master_tx = (vp->capabilities & 0x20) ? 1 : 0; in corkscrew_setup()
683 /* vp->full_bus_master_rx = 0; */ in corkscrew_setup()
684 vp->full_bus_master_rx = (vp->capabilities & 0x20) ? 1 : 0; in corkscrew_setup()
686 /* The 3c51x-specific entries in the device structure. */ in corkscrew_setup()
687 dev->netdev_ops = &netdev_ops; in corkscrew_setup()
688 dev->watchdog_timeo = (400 * HZ) / 1000; in corkscrew_setup()
689 dev->ethtool_ops = &netdev_ethtool_ops; in corkscrew_setup()
697 int ioaddr = dev->base_addr; in corkscrew_open()
705 if (vp->full_duplex) in corkscrew_open()
706 outb(0x20, ioaddr + Wn3_MAC_Ctrl); /* Set the full-duplex bit. */ in corkscrew_open()
709 if (vp->media_override != 7) { in corkscrew_open()
712 dev->name, vp->media_override, in corkscrew_open()
713 media_tbl[vp->media_override].name); in corkscrew_open()
714 dev->if_port = vp->media_override; in corkscrew_open()
715 } else if (vp->autoselect) { in corkscrew_open()
717 dev->if_port = 4; in corkscrew_open()
718 while (!(vp->available_media & media_tbl[dev->if_port].mask)) in corkscrew_open()
719 dev->if_port = media_tbl[dev->if_port].next; in corkscrew_open()
723 dev->name, media_tbl[dev->if_port].name); in corkscrew_open()
726 dev->if_port = vp->default_media; in corkscrew_open()
728 config = (config & ~Xcvr) | (dev->if_port << Xcvr_shift); in corkscrew_open()
733 dev->name, config); in corkscrew_open()
737 for (i = 20; i >= 0; i--) in corkscrew_open()
743 for (i = 20; i >= 0; i--) in corkscrew_open()
749 /* Use the now-standard shared IRQ implementation. */ in corkscrew_open()
750 if (vp->capabilities == 0x11c7) { in corkscrew_open()
752 if (dev->irq == 0 || in corkscrew_open()
753 dev->dma == 0 || in corkscrew_open()
754 request_irq(dev->irq, corkscrew_interrupt, 0, in corkscrew_open()
755 vp->product_name, dev)) in corkscrew_open()
756 return -EAGAIN; in corkscrew_open()
757 enable_dma(dev->dma); in corkscrew_open()
758 set_dma_mode(dev->dma, DMA_MODE_CASCADE); in corkscrew_open()
759 } else if (request_irq(dev->irq, corkscrew_interrupt, IRQF_SHARED, in corkscrew_open()
760 vp->product_name, dev)) { in corkscrew_open()
761 return -EAGAIN; in corkscrew_open()
765 mod_timer(&vp->timer, jiffies + media_tbl[dev->if_port].wait); in corkscrew_open()
770 dev->name, dev->irq, inw(ioaddr + Wn4_Media)); in corkscrew_open()
776 outb(dev->dev_addr[i], ioaddr + i); in corkscrew_open()
780 if (dev->if_port == 3) in corkscrew_open()
785 media_tbl[dev->if_port].media_bits, ioaddr + Wn4_Media); in corkscrew_open()
787 /* Switch to the stats window, and clear all stats by reading. */ in corkscrew_open()
803 if (vp->full_bus_master_rx) { /* Boomerang bus master. */ in corkscrew_open()
804 vp->cur_rx = vp->dirty_rx = 0; in corkscrew_open()
806 pr_debug("%s: Filling in the Rx ring.\n", dev->name); in corkscrew_open()
809 if (i < (RX_RING_SIZE - 1)) in corkscrew_open()
810 vp->rx_ring[i].next = in corkscrew_open()
811 isa_virt_to_bus(&vp->rx_ring[i + 1]); in corkscrew_open()
813 vp->rx_ring[i].next = 0; in corkscrew_open()
814 vp->rx_ring[i].status = 0; /* Clear complete bit. */ in corkscrew_open()
815 vp->rx_ring[i].length = PKT_BUF_SZ | 0x80000000; in corkscrew_open()
817 vp->rx_skbuff[i] = skb; in corkscrew_open()
821 vp->rx_ring[i].addr = isa_virt_to_bus(skb->data); in corkscrew_open()
824 vp->rx_ring[i - 1].next = in corkscrew_open()
825 isa_virt_to_bus(&vp->rx_ring[0]); /* Wrap the ring. */ in corkscrew_open()
826 outl(isa_virt_to_bus(&vp->rx_ring[0]), ioaddr + UpListPtr); in corkscrew_open()
828 if (vp->full_bus_master_tx) { /* Boomerang bus master Tx. */ in corkscrew_open()
829 vp->cur_tx = vp->dirty_tx = 0; in corkscrew_open()
833 vp->tx_skbuff[i] = NULL; in corkscrew_open()
836 /* Set receiver mode: presumably accept b-case and phys addr only. */ in corkscrew_open()
846 (vp->full_bus_master_tx ? DownComplete : TxAvailable) | in corkscrew_open()
847 (vp->full_bus_master_rx ? UpComplete : RxComplete) | in corkscrew_open()
848 (vp->bus_master ? DMADone : 0), ioaddr + EL3_CMD); in corkscrew_open()
853 | (vp->bus_master ? DMADone : 0) | UpComplete | DownComplete, in corkscrew_open()
863 struct net_device *dev = vp->our_dev; in corkscrew_timer()
864 int ioaddr = dev->base_addr; in corkscrew_timer()
870 dev->name, media_tbl[dev->if_port].name); in corkscrew_timer()
872 spin_lock_irqsave(&vp->lock, flags); in corkscrew_timer()
879 switch (dev->if_port) { in corkscrew_timer()
887 dev->name, in corkscrew_timer()
888 media_tbl[dev->if_port].name, in corkscrew_timer()
892 dev->name, in corkscrew_timer()
893 media_tbl[dev->if_port].name, in corkscrew_timer()
900 dev->name, in corkscrew_timer()
901 media_tbl[dev->if_port].name, in corkscrew_timer()
909 dev->if_port = in corkscrew_timer()
910 media_tbl[dev->if_port].next; in corkscrew_timer()
912 while (!(vp->available_media & media_tbl[dev->if_port].mask)); in corkscrew_timer()
914 if (dev->if_port == 8) { /* Go back to default. */ in corkscrew_timer()
915 dev->if_port = vp->default_media; in corkscrew_timer()
918 dev->name, in corkscrew_timer()
919 media_tbl[dev->if_port].name); in corkscrew_timer()
923 dev->name, in corkscrew_timer()
924 media_tbl[dev->if_port].name); in corkscrew_timer()
925 vp->timer.expires = jiffies + media_tbl[dev->if_port].wait; in corkscrew_timer()
926 add_timer(&vp->timer); in corkscrew_timer()
929 media_tbl[dev->if_port].media_bits, in corkscrew_timer()
934 config = (config & ~Xcvr) | (dev->if_port << Xcvr_shift); in corkscrew_timer()
937 outw(dev->if_port == 3 ? StartCoax : StopCoax, in corkscrew_timer()
943 spin_unlock_irqrestore(&vp->lock, flags); in corkscrew_timer()
946 dev->name, media_tbl[dev->if_port].name); in corkscrew_timer()
955 int ioaddr = dev->base_addr; in corkscrew_timeout()
958 dev->name, inb(ioaddr + TxStatus), in corkscrew_timeout()
962 pr_warn("%s: Transmitter encountered 16 collisions -- network cable problem?\n", in corkscrew_timeout()
963 dev->name); in corkscrew_timeout()
965 pr_debug(" Flags; bus-master %d, full %d; dirty %d current %d.\n", in corkscrew_timeout()
966 vp->full_bus_master_tx, vp->tx_full, vp->dirty_tx, in corkscrew_timeout()
967 vp->cur_tx); in corkscrew_timeout()
969 &vp->tx_ring[0]); in corkscrew_timeout()
972 &vp->tx_ring[i], in corkscrew_timeout()
973 vp->tx_ring[i].length, vp->tx_ring[i].status); in corkscrew_timeout()
978 for (i = 20; i >= 0; i--) in corkscrew_timeout()
983 dev->stats.tx_errors++; in corkscrew_timeout()
984 dev->stats.tx_dropped++; in corkscrew_timeout()
992 int ioaddr = dev->base_addr; in corkscrew_start_xmit()
994 /* Block a timer-based transmit from overlapping. */ in corkscrew_start_xmit()
998 if (vp->full_bus_master_tx) { /* BOOMERANG bus-master */ in corkscrew_start_xmit()
1000 int entry = vp->cur_tx % TX_RING_SIZE; in corkscrew_start_xmit()
1005 if (vp->tx_full) /* No room to transmit with */ in corkscrew_start_xmit()
1007 if (vp->cur_tx != 0) in corkscrew_start_xmit()
1008 prev_entry = &vp->tx_ring[(vp->cur_tx - 1) % TX_RING_SIZE]; in corkscrew_start_xmit()
1013 dev->name, vp->cur_tx); in corkscrew_start_xmit()
1014 /* vp->tx_full = 1; */ in corkscrew_start_xmit()
1015 vp->tx_skbuff[entry] = skb; in corkscrew_start_xmit()
1016 vp->tx_ring[entry].next = 0; in corkscrew_start_xmit()
1017 vp->tx_ring[entry].addr = isa_virt_to_bus(skb->data); in corkscrew_start_xmit()
1018 vp->tx_ring[entry].length = skb->len | 0x80000000; in corkscrew_start_xmit()
1019 vp->tx_ring[entry].status = skb->len | 0x80000000; in corkscrew_start_xmit()
1021 spin_lock_irqsave(&vp->lock, flags); in corkscrew_start_xmit()
1024 for (i = 20; i >= 0; i--) in corkscrew_start_xmit()
1028 prev_entry->next = isa_virt_to_bus(&vp->tx_ring[entry]); in corkscrew_start_xmit()
1030 outl(isa_virt_to_bus(&vp->tx_ring[entry]), in corkscrew_start_xmit()
1035 spin_unlock_irqrestore(&vp->lock, flags); in corkscrew_start_xmit()
1037 vp->cur_tx++; in corkscrew_start_xmit()
1038 if (vp->cur_tx - vp->dirty_tx > TX_RING_SIZE - 1) in corkscrew_start_xmit()
1039 vp->tx_full = 1; in corkscrew_start_xmit()
1042 prev_entry->status &= ~0x80000000; in corkscrew_start_xmit()
1048 outl(skb->len, ioaddr + TX_FIFO); in corkscrew_start_xmit()
1049 dev->stats.tx_bytes += skb->len; in corkscrew_start_xmit()
1051 if (vp->bus_master) { in corkscrew_start_xmit()
1052 /* Set the bus-master controller to transfer the packet. */ in corkscrew_start_xmit()
1053 outl(isa_virt_to_bus(skb->data), ioaddr + Wn7_MasterAddr); in corkscrew_start_xmit()
1054 outw((skb->len + 3) & ~3, ioaddr + Wn7_MasterLen); in corkscrew_start_xmit()
1055 vp->tx_skb = skb; in corkscrew_start_xmit()
1060 outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); in corkscrew_start_xmit()
1065 /* Interrupt us when the FIFO has room for max-sized packet. */ in corkscrew_start_xmit()
1071 outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2); in corkscrew_start_xmit()
1076 /* Interrupt us when the FIFO has room for max-sized packet. */ in corkscrew_start_xmit()
1078 #endif /* bus master */ in corkscrew_start_xmit()
1086 while (--i > 0 && (tx_status = inb(ioaddr + TxStatus)) > 0) { in corkscrew_start_xmit()
1087 if (tx_status & 0x3C) { /* A Tx-disabling error occurred. */ in corkscrew_start_xmit()
1090 dev->name, tx_status); in corkscrew_start_xmit()
1092 dev->stats.tx_fifo_errors++; in corkscrew_start_xmit()
1094 dev->stats.tx_aborted_errors++; in corkscrew_start_xmit()
1098 for (j = 20; j >= 0; j--) in corkscrew_start_xmit()
1115 /* Use the now-standard shared IRQ implementation. */ in corkscrew_interrupt()
1122 ioaddr = dev->base_addr; in corkscrew_interrupt()
1125 spin_lock(&lp->lock); in corkscrew_interrupt()
1131 dev->name, status, latency); in corkscrew_interrupt()
1134 /* Some interrupt controllers store a bogus interrupt from boot-time. in corkscrew_interrupt()
1139 dev->name, status, netif_running(dev)); in corkscrew_interrupt()
1140 free_irq(dev->irq, dev); in corkscrew_interrupt()
1141 dev->irq = -1; in corkscrew_interrupt()
1148 dev->name, status); in corkscrew_interrupt()
1155 /* There's room in the FIFO for a full-sized packet. */ in corkscrew_interrupt()
1160 unsigned int dirty_tx = lp->dirty_tx; in corkscrew_interrupt()
1162 while (lp->cur_tx - dirty_tx > 0) { in corkscrew_interrupt()
1164 if (inl(ioaddr + DownListPtr) == isa_virt_to_bus(&lp->tx_ring[entry])) in corkscrew_interrupt()
1166 if (lp->tx_skbuff[entry]) { in corkscrew_interrupt()
1167 dev_consume_skb_irq(lp->tx_skbuff[entry]); in corkscrew_interrupt()
1168 lp->tx_skbuff[entry] = NULL; in corkscrew_interrupt()
1172 lp->dirty_tx = dirty_tx; in corkscrew_interrupt()
1174 if (lp->tx_full && (lp->cur_tx - dirty_tx <= TX_RING_SIZE - 1)) { in corkscrew_interrupt()
1175 lp->tx_full = 0; in corkscrew_interrupt()
1182 dev_consume_skb_irq(lp->tx_skb); /* Release the transferred buffer */ in corkscrew_interrupt()
1199 pr_debug("%s: Updating stats.\n", dev->name); in corkscrew_interrupt()
1205 pr_notice("%s: Updating stats failed, disabling stats as an interrupt source.\n", in corkscrew_interrupt()
1206 dev->name); in corkscrew_interrupt()
1227 outw(RxEnable, ioaddr + EL3_CMD); /* Re-enable the receiver. */ in corkscrew_interrupt()
1233 if (--i < 0) { in corkscrew_interrupt()
1235 dev->name, status, SetStatusEnb | ((~status) & 0x7FE)); in corkscrew_interrupt()
1246 spin_unlock(&lp->lock); in corkscrew_interrupt()
1249 pr_debug("%s: exiting interrupt, status %4.4x.\n", dev->name, status); in corkscrew_interrupt()
1255 int ioaddr = dev->base_addr; in corkscrew_rx()
1263 if (rx_status & 0x4000) { /* Error, update stats. */ in corkscrew_rx()
1268 dev->stats.rx_errors++; in corkscrew_rx()
1270 dev->stats.rx_over_errors++; in corkscrew_rx()
1272 dev->stats.rx_length_errors++; in corkscrew_rx()
1274 dev->stats.rx_frame_errors++; in corkscrew_rx()
1276 dev->stats.rx_crc_errors++; in corkscrew_rx()
1278 dev->stats.rx_length_errors++; in corkscrew_rx()
1295 skb->protocol = eth_type_trans(skb, dev); in corkscrew_rx()
1297 dev->stats.rx_packets++; in corkscrew_rx()
1298 dev->stats.rx_bytes += pkt_len; in corkscrew_rx()
1300 for (i = 200; i >= 0; i--) in corkscrew_rx()
1305 pr_debug("%s: Couldn't allocate a sk_buff of size %d.\n", dev->name, pkt_len); in corkscrew_rx()
1308 dev->stats.rx_dropped++; in corkscrew_rx()
1310 for (i = 200; i >= 0; i--) in corkscrew_rx()
1320 int entry = vp->cur_rx % RX_RING_SIZE; in boomerang_rx()
1321 int ioaddr = dev->base_addr; in boomerang_rx()
1327 while ((rx_status = vp->rx_ring[entry].status) & RxDComplete) { in boomerang_rx()
1328 if (rx_status & RxDError) { /* Error, update stats. */ in boomerang_rx()
1333 dev->stats.rx_errors++; in boomerang_rx()
1335 dev->stats.rx_over_errors++; in boomerang_rx()
1337 dev->stats.rx_length_errors++; in boomerang_rx()
1339 dev->stats.rx_frame_errors++; in boomerang_rx()
1341 dev->stats.rx_crc_errors++; in boomerang_rx()
1343 dev->stats.rx_length_errors++; in boomerang_rx()
1349 dev->stats.rx_bytes += pkt_len; in boomerang_rx()
1361 isa_bus_to_virt(vp->rx_ring[entry].addr), in boomerang_rx()
1367 skb = vp->rx_skbuff[entry]; in boomerang_rx()
1368 vp->rx_skbuff[entry] = NULL; in boomerang_rx()
1371 if (isa_bus_to_virt(vp->rx_ring[entry].addr) != temp) in boomerang_rx()
1372 pr_warn("%s: Warning -- the skbuff addresses do not match in boomerang_rx: %p vs. %p / %p\n", in boomerang_rx()
1373 dev->name, in boomerang_rx()
1374 isa_bus_to_virt(vp->rx_ring[entry].addr), in boomerang_rx()
1375 skb->head, temp); in boomerang_rx()
1378 skb->protocol = eth_type_trans(skb, dev); in boomerang_rx()
1380 dev->stats.rx_packets++; in boomerang_rx()
1382 entry = (++vp->cur_rx) % RX_RING_SIZE; in boomerang_rx()
1385 for (; vp->cur_rx - vp->dirty_rx > 0; vp->dirty_rx++) { in boomerang_rx()
1387 entry = vp->dirty_rx % RX_RING_SIZE; in boomerang_rx()
1388 if (vp->rx_skbuff[entry] == NULL) { in boomerang_rx()
1393 vp->rx_ring[entry].addr = isa_virt_to_bus(skb->data); in boomerang_rx()
1394 vp->rx_skbuff[entry] = skb; in boomerang_rx()
1396 vp->rx_ring[entry].status = 0; /* Clear complete bit. */ in boomerang_rx()
1404 int ioaddr = dev->base_addr; in corkscrew_close()
1411 dev->name, inw(ioaddr + EL3_STATUS), in corkscrew_close()
1413 pr_debug("%s: corkscrew close stats: rx_nocopy %d rx_copy %d tx_queued %d.\n", in corkscrew_close()
1414 dev->name, rx_nocopy, rx_copy, queued_packet); in corkscrew_close()
1417 del_timer_sync(&vp->timer); in corkscrew_close()
1419 /* Turn off statistics ASAP. We update lp->stats below. */ in corkscrew_close()
1426 if (dev->if_port == XCVR_10base2) in corkscrew_close()
1430 free_irq(dev->irq, dev); in corkscrew_close()
1435 if (vp->full_bus_master_rx) { /* Free Boomerang bus master Rx buffers. */ in corkscrew_close()
1438 if (vp->rx_skbuff[i]) { in corkscrew_close()
1439 dev_kfree_skb(vp->rx_skbuff[i]); in corkscrew_close()
1440 vp->rx_skbuff[i] = NULL; in corkscrew_close()
1443 if (vp->full_bus_master_tx) { /* Free Boomerang bus master Tx buffers. */ in corkscrew_close()
1446 if (vp->tx_skbuff[i]) { in corkscrew_close()
1447 dev_kfree_skb(vp->tx_skbuff[i]); in corkscrew_close()
1448 vp->tx_skbuff[i] = NULL; in corkscrew_close()
1461 spin_lock_irqsave(&vp->lock, flags); in corkscrew_get_stats()
1462 update_stats(dev->base_addr, dev); in corkscrew_get_stats()
1463 spin_unlock_irqrestore(&vp->lock, flags); in corkscrew_get_stats()
1465 return &dev->stats; in corkscrew_get_stats()
1477 /* Unlike the 3c5x9 we need not turn off stats updates while reading. */ in update_stats()
1478 /* Switch to the stats window, and read everything. */ in update_stats()
1480 dev->stats.tx_carrier_errors += inb(ioaddr + 0); in update_stats()
1481 dev->stats.tx_heartbeat_errors += inb(ioaddr + 1); in update_stats()
1483 dev->stats.collisions += inb(ioaddr + 3); in update_stats()
1484 dev->stats.tx_window_errors += inb(ioaddr + 4); in update_stats()
1485 dev->stats.rx_fifo_errors += inb(ioaddr + 5); in update_stats()
1486 dev->stats.tx_packets += inb(ioaddr + 6); in update_stats()
1487 dev->stats.tx_packets += (inb(ioaddr + 9) & 0x30) << 4; in update_stats()
1510 int ioaddr = dev->base_addr; in set_rx_mode()
1513 if (dev->flags & IFF_PROMISC) { in set_rx_mode()
1516 dev->name); in set_rx_mode()
1518 } else if (!netdev_mc_empty(dev) || dev->flags & IFF_ALLMULTI) { in set_rx_mode()
1529 strscpy(info->driver, DRV_NAME, sizeof(info->driver)); in netdev_get_drvinfo()
1530 snprintf(info->bus_info, sizeof(info->bus_info), "ISA 0x%lx", in netdev_get_drvinfo()
1531 dev->base_addr); in netdev_get_drvinfo()
1560 dev = vp->our_dev; in cleanup_module()