Lines Matching +full:crystal +full:- +full:26 +full:m +full:- +full:en

1 /* mac89x0.c: A Crystal Semiconductor CS89[02]0 driver for linux. */
4 written 1993-1994 by Donald Becker.
14 Mike Cruse : mcruse@cti-ltd.com
31 David Huggins-Daines <dhd@debian.org>
37 * Removed all the media-detection stuff, because these cards are
38 TP-only.
50 have to probe for them in a brain-damaged ISA-like fashion.
52 Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 11/01/2001
56 local_irq_{dis,en}able()
62 "cs89x0.c:v1.02 11/26/96 Russell Nelson <nelson@crynwr.com>\n";
71 Crystal Semiconductor data sheets.
99 static int debug = -1;
124 /* For reading/writing registers ISA-style */
128 nubus_writew(swab16(portno), dev->base_addr + ADD_PORT); in readreg_io()
129 return swab16(nubus_readw(dev->base_addr + DATA_PORT)); in readreg_io()
135 nubus_writew(swab16(portno), dev->base_addr + ADD_PORT); in writereg_io()
136 nubus_writew(swab16(value), dev->base_addr + DATA_PORT); in writereg_io()
143 return swab16(nubus_readw(dev->mem_start + portno)); in readreg()
149 nubus_writew(swab16(value), dev->mem_start + portno); in writereg()
172 int err = -ENODEV; in mac89x0_device_probe()
177 return -ENOMEM; in mac89x0_device_probe()
183 if (fres->board->slot == slot) in mac89x0_device_probe()
186 /* The pseudo-ISA bits always live at offset 0x300 (gee, in mac89x0_device_probe()
204 SET_NETDEV_DEV(dev, &pdev->dev); in mac89x0_device_probe()
209 lp->msg_enable = netif_msg_init(debug, 0); in mac89x0_device_probe()
212 dev->base_addr = ioaddr; in mac89x0_device_probe()
213 dev->mem_start = (unsigned long) in mac89x0_device_probe()
215 dev->mem_end = dev->mem_start + 0x1000; in mac89x0_device_probe()
222 lp->chip_type = rev_type &~ REVISON_BITS; in mac89x0_device_probe()
223 lp->chip_revision = ((rev_type & REVISON_BITS) >> 8) + 'A'; in mac89x0_device_probe()
227 lp->send_cmd = TX_AFTER_381; in mac89x0_device_probe()
228 if (lp->chip_type == CS8900 && lp->chip_revision >= 'F') in mac89x0_device_probe()
229 lp->send_cmd = TX_NOW; in mac89x0_device_probe()
230 if (lp->chip_type != CS8900 && lp->chip_revision >= 'C') in mac89x0_device_probe()
231 lp->send_cmd = TX_NOW; in mac89x0_device_probe()
236 lp->chip_type == CS8900 ? '0' : '2', in mac89x0_device_probe()
237 lp->chip_type == CS8920M ? "M" : "", in mac89x0_device_probe()
238 lp->chip_revision, dev->base_addr); in mac89x0_device_probe()
248 /* Big-endian (why??!) */ in mac89x0_device_probe()
256 dev->irq = SLOT2IRQ(slot); in mac89x0_device_probe()
260 pr_info("MAC %pM, IRQ %d\n", dev->dev_addr, dev->irq); in mac89x0_device_probe()
262 dev->netdev_ops = &mac89x0_netdev_ops; in mac89x0_device_probe()
271 nubus_writew(0, dev->base_addr + ADD_PORT); in mac89x0_device_probe()
282 there is non-reboot way to recover if something goes wrong.
294 if (request_irq(dev->irq, net_interrupt, 0, "cs89x0", dev)) in net_open()
295 return -EAGAIN; in net_open()
297 /* Set up the IRQ - Apparently magic */ in net_open()
298 if (lp->chip_type == CS8900) in net_open()
305 writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8)); in net_open()
311 lp->rx_mode = 0; in net_open()
314 lp->curr_rx_cfg = RX_OK_ENBL | RX_CRC_ERROR_ENBL; in net_open()
316 writereg(dev, PP_RxCFG, lp->curr_rx_cfg); in net_open()
337 skb->len, skb->data[ETH_ALEN + ETH_ALEN] << 8 | in net_send_packet()
338 skb->data[ETH_ALEN + ETH_ALEN + 1]); in net_send_packet()
347 writereg(dev, PP_TxCMD, lp->send_cmd); in net_send_packet()
348 writereg(dev, PP_TxLength, skb->len); in net_send_packet()
359 skb_copy_from_linear_data(skb, (void *)(dev->mem_start + PP_TxFrame), in net_send_packet()
360 skb->len+1); in net_send_packet()
376 ioaddr = dev->base_addr; in net_interrupt()
386 while ((status = swab16(nubus_readw(dev->base_addr + ISQ_PORT)))) { in net_interrupt()
394 dev->stats.tx_packets++; in net_interrupt()
397 dev->stats.tx_errors++; in net_interrupt()
399 dev->stats.tx_carrier_errors++; in net_interrupt()
401 dev->stats.tx_heartbeat_errors++; in net_interrupt()
403 dev->stats.tx_window_errors++; in net_interrupt()
405 dev->stats.tx_aborted_errors++; in net_interrupt()
418 lp->send_underrun++; in net_interrupt()
419 if (lp->send_underrun == 3) lp->send_cmd = TX_AFTER_381; in net_interrupt()
420 else if (lp->send_underrun == 6) lp->send_cmd = TX_AFTER_ALL; in net_interrupt()
424 dev->stats.rx_missed_errors += (status >> 6); in net_interrupt()
427 dev->stats.collisions += (status >> 6); in net_interrupt()
444 dev->stats.rx_errors++; in net_rx()
446 dev->stats.rx_length_errors++; in net_rx()
448 dev->stats.rx_length_errors++; in net_rx()
452 dev->stats.rx_crc_errors++; in net_rx()
454 dev->stats.rx_frame_errors++; in net_rx()
462 dev->stats.rx_dropped++; in net_rx()
467 skb_copy_to_linear_data(skb, (void *)(dev->mem_start + PP_RxFrame), in net_rx()
471 length, skb->data[ETH_ALEN + ETH_ALEN] << 8 | in net_rx()
472 skb->data[ETH_ALEN + ETH_ALEN + 1]); in net_rx()
474 skb->protocol=eth_type_trans(skb,dev); in net_rx()
476 dev->stats.rx_packets++; in net_rx()
477 dev->stats.rx_bytes += length; in net_rx()
492 free_irq(dev->irq, dev); in net_close()
509 dev->stats.rx_missed_errors += (readreg(dev, PP_RxMiss) >> 6); in net_get_stats()
510 dev->stats.collisions += (readreg(dev, PP_TxCol) >> 6); in net_get_stats()
513 return &dev->stats; in net_get_stats()
520 if(dev->flags&IFF_PROMISC) in set_multicast_list()
522 lp->rx_mode = RX_ALL_ACCEPT; in set_multicast_list()
523 } else if ((dev->flags & IFF_ALLMULTI) || !netdev_mc_empty(dev)) { in set_multicast_list()
524 /* The multicast-accept list is initialized to accept-all, and we in set_multicast_list()
525 rely on higher-level filtering for now. */ in set_multicast_list()
526 lp->rx_mode = RX_MULTCAST_ACCEPT; in set_multicast_list()
529 lp->rx_mode = 0; in set_multicast_list()
531 writereg(dev, PP_RxCTL, DEF_RX_ACCEPT | lp->rx_mode); in set_multicast_list()
534 writereg(dev, PP_RxCFG, lp->curr_rx_cfg | in set_multicast_list()
535 (lp->rx_mode == RX_ALL_ACCEPT? (RX_CRC_ERROR_ENBL|RX_RUNT_ENBL|RX_EXTRA_DATA_ENBL) : 0)); in set_multicast_list()
544 if (!is_valid_ether_addr(saddr->sa_data)) in set_mac_address()
545 return -EADDRNOTAVAIL; in set_mac_address()
547 eth_hw_addr_set(dev, saddr->sa_data); in set_mac_address()
548 netdev_info(dev, "Setting MAC address to %pM\n", dev->dev_addr); in set_mac_address()
552 writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8)); in set_mac_address()
564 nubus_writew(0, dev->base_addr + ADD_PORT); in mac89x0_device_remove()