Lines Matching refs:dev
103 static void ei_tx_intr(struct net_device *dev);
104 static void ei_tx_err(struct net_device *dev);
105 static void ei_receive(struct net_device *dev);
106 static void ei_rx_overrun(struct net_device *dev);
109 static void NS8390_trigger_send(struct net_device *dev, unsigned int length,
111 static void do_set_multicast_list(struct net_device *dev);
112 static void __NS8390_init(struct net_device *dev, int startp);
203 static int __ei_open(struct net_device *dev) in __ei_open() argument
206 struct ei_device *ei_local = netdev_priv(dev); in __ei_open()
208 if (dev->watchdog_timeo <= 0) in __ei_open()
209 dev->watchdog_timeo = TX_TIMEOUT; in __ei_open()
217 __NS8390_init(dev, 1); in __ei_open()
220 netif_start_queue(dev); in __ei_open()
232 static int __ei_close(struct net_device *dev) in __ei_close() argument
234 struct ei_device *ei_local = netdev_priv(dev); in __ei_close()
242 __NS8390_init(dev, 0); in __ei_close()
244 netif_stop_queue(dev); in __ei_close()
256 static void __ei_tx_timeout(struct net_device *dev, unsigned int txqueue) in __ei_tx_timeout() argument
258 unsigned long e8390_base = dev->base_addr; in __ei_tx_timeout()
259 struct ei_device *ei_local = netdev_priv(dev); in __ei_tx_timeout()
260 int txsr, isr, tickssofar = jiffies - dev_trans_start(dev); in __ei_tx_timeout()
263 dev->stats.tx_errors++; in __ei_tx_timeout()
270 netdev_dbg(dev, "Tx timed out, %s TSR=%#2x, ISR=%#2x, t=%d\n", in __ei_tx_timeout()
275 if (!isr && !dev->stats.tx_packets) { in __ei_tx_timeout()
282 disable_irq_nosync_lockdep(dev->irq); in __ei_tx_timeout()
286 ei_reset_8390(dev); in __ei_tx_timeout()
287 __NS8390_init(dev, 1); in __ei_tx_timeout()
290 enable_irq_lockdep(dev->irq); in __ei_tx_timeout()
291 netif_wake_queue(dev); in __ei_tx_timeout()
303 struct net_device *dev) in __ei_start_xmit() argument
305 unsigned long e8390_base = dev->base_addr; in __ei_start_xmit()
306 struct ei_device *ei_local = netdev_priv(dev); in __ei_start_xmit()
333 disable_irq_nosync_lockdep_irqsave(dev->irq, &flags); in __ei_start_xmit()
352 netdev_dbg(dev, in __ei_start_xmit()
360 netdev_dbg(dev, in __ei_start_xmit()
364 netif_dbg(ei_local, tx_err, dev, in __ei_start_xmit()
368 netif_stop_queue(dev); in __ei_start_xmit()
371 enable_irq_lockdep_irqrestore(dev->irq, &flags); in __ei_start_xmit()
372 dev->stats.tx_errors++; in __ei_start_xmit()
382 ei_block_output(dev, send_length, data, output_page); in __ei_start_xmit()
386 NS8390_trigger_send(dev, send_length, output_page); in __ei_start_xmit()
398 netif_stop_queue(dev); in __ei_start_xmit()
400 netif_start_queue(dev); in __ei_start_xmit()
407 enable_irq_lockdep_irqrestore(dev->irq, &flags); in __ei_start_xmit()
410 dev->stats.tx_bytes += send_length; in __ei_start_xmit()
429 struct net_device *dev = dev_id; in __ei_interrupt() local
430 unsigned long e8390_base = dev->base_addr; in __ei_interrupt()
432 struct ei_device *ei_local = netdev_priv(dev); in __ei_interrupt()
445 netdev_err(dev, "Interrupted while interrupts are masked! isr=%#2x imr=%#2x\n", in __ei_interrupt()
454 netif_dbg(ei_local, intr, dev, "interrupt(isr=%#2.2x)\n", in __ei_interrupt()
460 if (!netif_running(dev)) { in __ei_interrupt()
461 netdev_warn(dev, "interrupt from stopped card\n"); in __ei_interrupt()
468 ei_rx_overrun(dev); in __ei_interrupt()
471 ei_receive(dev); in __ei_interrupt()
475 ei_tx_intr(dev); in __ei_interrupt()
477 ei_tx_err(dev); in __ei_interrupt()
480 dev->stats.rx_frame_errors += ei_inb_p(e8390_base + EN0_COUNTER0); in __ei_interrupt()
481 dev->stats.rx_crc_errors += ei_inb_p(e8390_base + EN0_COUNTER1); in __ei_interrupt()
482 dev->stats.rx_missed_errors += ei_inb_p(e8390_base + EN0_COUNTER2); in __ei_interrupt()
498 netdev_warn(dev, "Too much work at interrupt, status %#2.2x\n", in __ei_interrupt()
502 netdev_warn(dev, "unknown interrupt %#2x\n", interrupts); in __ei_interrupt()
511 static void __ei_poll(struct net_device *dev) in __ei_poll() argument
513 disable_irq(dev->irq); in __ei_poll()
514 __ei_interrupt(dev->irq, dev); in __ei_poll()
515 enable_irq(dev->irq); in __ei_poll()
533 static void ei_tx_err(struct net_device *dev) in ei_tx_err() argument
535 unsigned long e8390_base = dev->base_addr; in ei_tx_err()
537 struct ei_device *ei_local __maybe_unused = netdev_priv(dev); in ei_tx_err()
542 netdev_dbg(dev, "transmitter error (%#2x):", txsr); in ei_tx_err()
559 ei_tx_intr(dev); in ei_tx_err()
561 dev->stats.tx_errors++; in ei_tx_err()
563 dev->stats.tx_carrier_errors++; in ei_tx_err()
565 dev->stats.tx_heartbeat_errors++; in ei_tx_err()
567 dev->stats.tx_window_errors++; in ei_tx_err()
579 static void ei_tx_intr(struct net_device *dev) in ei_tx_intr() argument
581 unsigned long e8390_base = dev->base_addr; in ei_tx_intr()
582 struct ei_device *ei_local = netdev_priv(dev); in ei_tx_intr()
600 NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6); in ei_tx_intr()
601 netif_trans_update(dev); in ei_tx_intr()
615 NS8390_trigger_send(dev, ei_local->tx1, ei_local->tx_start_page); in ei_tx_intr()
616 netif_trans_update(dev); in ei_tx_intr()
630 dev->stats.collisions++; in ei_tx_intr()
632 dev->stats.tx_packets++; in ei_tx_intr()
634 dev->stats.tx_errors++; in ei_tx_intr()
636 dev->stats.tx_aborted_errors++; in ei_tx_intr()
637 dev->stats.collisions += 16; in ei_tx_intr()
640 dev->stats.tx_carrier_errors++; in ei_tx_intr()
642 dev->stats.tx_fifo_errors++; in ei_tx_intr()
644 dev->stats.tx_heartbeat_errors++; in ei_tx_intr()
646 dev->stats.tx_window_errors++; in ei_tx_intr()
648 netif_wake_queue(dev); in ei_tx_intr()
659 static void ei_receive(struct net_device *dev) in ei_receive() argument
661 unsigned long e8390_base = dev->base_addr; in ei_receive()
662 struct ei_device *ei_local = netdev_priv(dev); in ei_receive()
691 netdev_err(dev, in ei_receive()
699 ei_get_8390_hdr(dev, &rx_frame, this_frame); in ei_receive()
715 dev->stats.rx_errors++; in ei_receive()
720 netif_dbg(ei_local, rx_status, dev, in ei_receive()
724 dev->stats.rx_errors++; in ei_receive()
725 dev->stats.rx_length_errors++; in ei_receive()
729 skb = netdev_alloc_skb(dev, pkt_len + 2); in ei_receive()
731 netif_err(ei_local, rx_err, dev, in ei_receive()
734 dev->stats.rx_dropped++; in ei_receive()
739 ei_block_input(dev, pkt_len, skb, current_offset + sizeof(rx_frame)); in ei_receive()
740 skb->protocol = eth_type_trans(skb, dev); in ei_receive()
743 dev->stats.rx_packets++; in ei_receive()
744 dev->stats.rx_bytes += pkt_len; in ei_receive()
746 dev->stats.multicast++; in ei_receive()
749 netif_err(ei_local, rx_err, dev, in ei_receive()
753 dev->stats.rx_errors++; in ei_receive()
756 dev->stats.rx_fifo_errors++; in ei_receive()
762 netdev_notice(dev, "next frame inconsistency, %#2x\n", in ei_receive()
788 static void ei_rx_overrun(struct net_device *dev) in ei_rx_overrun() argument
790 unsigned long e8390_base = dev->base_addr; in ei_rx_overrun()
793 struct ei_device *ei_local __maybe_unused = netdev_priv(dev); in ei_rx_overrun()
802 netif_dbg(ei_local, rx_err, dev, "Receiver overrun\n"); in ei_rx_overrun()
803 dev->stats.rx_over_errors++; in ei_rx_overrun()
841 ei_receive(dev); in ei_rx_overrun()
856 static struct net_device_stats *__ei_get_stats(struct net_device *dev) in __ei_get_stats() argument
858 unsigned long ioaddr = dev->base_addr; in __ei_get_stats()
859 struct ei_device *ei_local = netdev_priv(dev); in __ei_get_stats()
863 if (!netif_running(dev)) in __ei_get_stats()
864 return &dev->stats; in __ei_get_stats()
868 dev->stats.rx_frame_errors += ei_inb_p(ioaddr + EN0_COUNTER0); in __ei_get_stats()
869 dev->stats.rx_crc_errors += ei_inb_p(ioaddr + EN0_COUNTER1); in __ei_get_stats()
870 dev->stats.rx_missed_errors += ei_inb_p(ioaddr + EN0_COUNTER2); in __ei_get_stats()
873 return &dev->stats; in __ei_get_stats()
881 static inline void make_mc_bits(u8 *bits, struct net_device *dev) in make_mc_bits() argument
885 netdev_for_each_mc_addr(ha, dev) { in make_mc_bits()
903 static void do_set_multicast_list(struct net_device *dev) in do_set_multicast_list() argument
905 unsigned long e8390_base = dev->base_addr; in do_set_multicast_list()
907 struct ei_device *ei_local = netdev_priv(dev); in do_set_multicast_list()
909 if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI))) { in do_set_multicast_list()
911 if (!netdev_mc_empty(dev)) in do_set_multicast_list()
912 make_mc_bits(ei_local->mcfilter, dev); in do_set_multicast_list()
929 if (netif_running(dev)) in do_set_multicast_list()
936 netdev_err(dev, "Multicast filter read/write mismap %d\n", in do_set_multicast_list()
942 if (dev->flags&IFF_PROMISC) in do_set_multicast_list()
944 else if (dev->flags & IFF_ALLMULTI || !netdev_mc_empty(dev)) in do_set_multicast_list()
956 static void __ei_set_multicast_list(struct net_device *dev) in __ei_set_multicast_list() argument
959 struct ei_device *ei_local = netdev_priv(dev); in __ei_set_multicast_list()
962 do_set_multicast_list(dev); in __ei_set_multicast_list()
974 static void ethdev_setup(struct net_device *dev) in ethdev_setup() argument
976 struct ei_device *ei_local = netdev_priv(dev); in ethdev_setup()
978 ether_setup(dev); in ethdev_setup()
1014 static void __NS8390_init(struct net_device *dev, int startp) in __NS8390_init() argument
1016 unsigned long e8390_base = dev->base_addr; in __NS8390_init()
1017 struct ei_device *ei_local = netdev_priv(dev); in __NS8390_init()
1048 ei_outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i)); in __NS8390_init()
1050 ei_inb_p(e8390_base + EN1_PHYS_SHIFT(i)) != dev->dev_addr[i]) in __NS8390_init()
1051 netdev_err(dev, in __NS8390_init()
1068 do_set_multicast_list(dev); /* (re)load the mcast table */ in __NS8390_init()
1075 static void NS8390_trigger_send(struct net_device *dev, unsigned int length, in NS8390_trigger_send() argument
1078 unsigned long e8390_base = dev->base_addr; in NS8390_trigger_send()
1079 struct ei_device *ei_local __attribute((unused)) = netdev_priv(dev); in NS8390_trigger_send()
1084 netdev_warn(dev, "trigger_send() called with the transmitter busy\n"); in NS8390_trigger_send()