74 #include <linux/module.h>
85 #include <linux/kernel.h>
86 #include <linux/types.h>
87 #include <linux/fcntl.h>
91 #include <linux/string.h>
92 #include <linux/nubus.h>
93 #include <linux/errno.h>
95 #include <linux/netdevice.h>
99 #include <linux/bitops.h>
137 #define tx_done(dev) 1
168 .ndo_open = net_open,
169 .ndo_stop = net_close,
170 .ndo_start_xmit = net_send_packet,
171 .ndo_get_stats = net_get_stats,
172 .ndo_set_rx_mode = set_multicast_list,
173 .ndo_set_mac_address = set_mac_address,
183 static int once_is_enough;
185 static unsigned version_printed;
187 unsigned rev_type = 0;
188 unsigned long ioaddr;
195 dev = alloc_etherdev(
sizeof(
struct net_local));
216 ioaddr = (
unsigned long)
217 nubus_slot_addr(slot) | (((slot&0xf) << 20) +
DEFAULTIOBASE);
237 lp = netdev_priv(dev);
242 nubus_slot_addr(slot) | (((slot&0xf) << 20) + MMIOBASE);
273 printk(
"\nmac89x0: No EEPROM, giving up now.\n");
307 int reset_start_time;
370 netif_start_queue(dev);
381 printk(
"%s: sent %d byte packet of type %x\n",
390 netif_stop_queue(dev);
423 printk (
"net_interrupt(): irq %d for unknown device.\n", irq);
428 lp = netdev_priv(dev);
445 dev->
stats.tx_packets++;
446 netif_wake_queue(dev);
447 if ((status &
TX_OK) == 0)
448 dev->
stats.tx_errors++;
450 dev->
stats.tx_carrier_errors++;
452 dev->
stats.tx_heartbeat_errors++;
454 dev->
stats.tx_window_errors++;
456 dev->
stats.tx_aborted_errors++;
465 netif_wake_queue(dev);
475 dev->
stats.rx_missed_errors += (status >> 6);
478 dev->
stats.collisions += (status >> 6);
493 if ((status &
RX_OK) == 0) {
494 dev->
stats.rx_errors++;
496 dev->
stats.rx_length_errors++;
498 dev->
stats.rx_length_errors++;
500 !(status & (RX_EXTRA_DATA|RX_RUNT)))
502 dev->
stats.rx_crc_errors++;
504 dev->
stats.rx_frame_errors++;
512 printk(
"%s: Memory squeeze, dropping packet.\n", dev->
name);
513 dev->
stats.rx_dropped++;
528 dev->
stats.rx_packets++;
542 netif_stop_queue(dev);
568 static void set_multicast_list(
struct net_device *dev)
596 if (!is_valid_ether_addr(saddr->
sa_data))
623 if (IS_ERR(dev_cs89x0)) {
625 return PTR_ERR(dev_cs89x0);