if_ed.c (1349) | if_ed.c (1358) |
---|---|
1/* 2 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet 3 * adapters. By David Greenman, 29-April-1993 4 * 5 * Copyright (C) 1993, David Greenman. This software may be used, modified, 6 * copied, distributed, and sold, in both source and binary form provided 7 * that the above copyright and these terms are retained. Under no 8 * circumstances is the author responsible for the proper functioning 9 * of this software, nor does the author assume any responsibility 10 * for damages incurred with its use. 11 * 12 * Currently supports the Western Digital/SMC 8003 and 8013 series, 13 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, 14 * and a variety of similar clones. 15 * 16 */ 17 18/* | 1/* 2 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet 3 * adapters. By David Greenman, 29-April-1993 4 * 5 * Copyright (C) 1993, David Greenman. This software may be used, modified, 6 * copied, distributed, and sold, in both source and binary form provided 7 * that the above copyright and these terms are retained. Under no 8 * circumstances is the author responsible for the proper functioning 9 * of this software, nor does the author assume any responsibility 10 * for damages incurred with its use. 11 * 12 * Currently supports the Western Digital/SMC 8003 and 8013 series, 13 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, 14 * and a variety of similar clones. 15 * 16 */ 17 18/* |
19 * $Id: if_ed.c,v 1.35 1994/03/02 05:50:01 davidg Exp $ | 19 * $Id: if_ed.c,v 1.36 1994/04/10 20:06:26 davidg Exp $ |
20 */ 21 22#include "ed.h" 23#if NED > 0 24/* bpfilter included here in case it is needed in future net includes */ 25#include "bpfilter.h" 26 27#include "param.h" --- 494 unchanged lines hidden (view full) --- 522 523 /* 524 * Set upper address bits and 8/16 bit access to shared memory 525 */ 526 if (isa16bit) { 527 if (sc->is790) { 528 sc->wd_laar_proto = inb(sc->asic_addr + ED_WD_LAAR); 529 outb(sc->asic_addr + ED_WD_LAAR, ED_WD_LAAR_M16EN); | 20 */ 21 22#include "ed.h" 23#if NED > 0 24/* bpfilter included here in case it is needed in future net includes */ 25#include "bpfilter.h" 26 27#include "param.h" --- 494 unchanged lines hidden (view full) --- 522 523 /* 524 * Set upper address bits and 8/16 bit access to shared memory 525 */ 526 if (isa16bit) { 527 if (sc->is790) { 528 sc->wd_laar_proto = inb(sc->asic_addr + ED_WD_LAAR); 529 outb(sc->asic_addr + ED_WD_LAAR, ED_WD_LAAR_M16EN); |
530 (void) inb(0x84); |
|
530 } else { 531 outb(sc->asic_addr + ED_WD_LAAR, (sc->wd_laar_proto = 532 ED_WD_LAAR_L16EN | ED_WD_LAAR_M16EN | 533 ((kvtop(sc->mem_start) >> 19) & ED_WD_LAAR_ADDRHI))); 534 } 535 } else { 536 if ((sc->type & ED_WD_SOFTCONFIG) || 537#ifdef TOSH_ETHER --- 13 unchanged lines hidden (view full) --- 551 for (i = 0; i < memsize; ++i) 552 if (sc->mem_start[i]) { 553 printf("ed%d: failed to clear shared memory at %x - check configuration\n", 554 isa_dev->id_unit, kvtop(sc->mem_start + i)); 555 556 /* 557 * Disable 16 bit access to shared memory 558 */ | 531 } else { 532 outb(sc->asic_addr + ED_WD_LAAR, (sc->wd_laar_proto = 533 ED_WD_LAAR_L16EN | ED_WD_LAAR_M16EN | 534 ((kvtop(sc->mem_start) >> 19) & ED_WD_LAAR_ADDRHI))); 535 } 536 } else { 537 if ((sc->type & ED_WD_SOFTCONFIG) || 538#ifdef TOSH_ETHER --- 13 unchanged lines hidden (view full) --- 552 for (i = 0; i < memsize; ++i) 553 if (sc->mem_start[i]) { 554 printf("ed%d: failed to clear shared memory at %x - check configuration\n", 555 isa_dev->id_unit, kvtop(sc->mem_start + i)); 556 557 /* 558 * Disable 16 bit access to shared memory 559 */ |
559 if (isa16bit) | 560 if (isa16bit) { |
560 outb(sc->asic_addr + ED_WD_LAAR, (sc->wd_laar_proto &= 561 ~ED_WD_LAAR_M16EN)); | 561 outb(sc->asic_addr + ED_WD_LAAR, (sc->wd_laar_proto &= 562 ~ED_WD_LAAR_M16EN)); |
563 (void) inb(0x84); 564 } |
|
562 563 return(0); 564 } 565 566 /* 567 * Disable 16bit access to shared memory - we leave it disabled so 568 * that 1) machines reboot properly when the board is set 569 * 16 bit mode and there are conflicting 8bit devices/ROMS 570 * in the same 128k address space as this boards shared 571 * memory. and 2) so that other 8 bit devices with shared 572 * memory can be used in this 128k region, too. 573 */ | 565 566 return(0); 567 } 568 569 /* 570 * Disable 16bit access to shared memory - we leave it disabled so 571 * that 1) machines reboot properly when the board is set 572 * 16 bit mode and there are conflicting 8bit devices/ROMS 573 * in the same 128k address space as this boards shared 574 * memory. and 2) so that other 8 bit devices with shared 575 * memory can be used in this 128k region, too. 576 */ |
574 if (isa16bit) | 577 if (isa16bit) { |
575 outb(sc->asic_addr + ED_WD_LAAR, (sc->wd_laar_proto &= 576 ~ED_WD_LAAR_M16EN)); | 578 outb(sc->asic_addr + ED_WD_LAAR, (sc->wd_laar_proto &= 579 ~ED_WD_LAAR_M16EN)); |
577 | 580 (void) inb(0x84); 581 } |
578 } 579 580 return (ED_WD_IO_PORTS); 581} 582 583/* 584 * Probe and vendor-specific initialization routine for 3Com 3c503 boards 585 */ --- 865 unchanged lines hidden (view full) --- 1451 * Don't update wd_laar_proto because we want to restore the 1452 * previous state (because an arp reply in the input code 1453 * may cause a call-back to ed_start) 1454 * XXX - the call-back to 'start' is a bug, IMHO. 1455 */ 1456 case ED_VENDOR_WD_SMC: { 1457 outb(sc->asic_addr + ED_WD_LAAR, 1458 (sc->wd_laar_proto | ED_WD_LAAR_M16EN)); | 582 } 583 584 return (ED_WD_IO_PORTS); 585} 586 587/* 588 * Probe and vendor-specific initialization routine for 3Com 3c503 boards 589 */ --- 865 unchanged lines hidden (view full) --- 1455 * Don't update wd_laar_proto because we want to restore the 1456 * previous state (because an arp reply in the input code 1457 * may cause a call-back to ed_start) 1458 * XXX - the call-back to 'start' is a bug, IMHO. 1459 */ 1460 case ED_VENDOR_WD_SMC: { 1461 outb(sc->asic_addr + ED_WD_LAAR, 1462 (sc->wd_laar_proto | ED_WD_LAAR_M16EN)); |
1459 if (sc->is790) 1460 outb(sc->asic_addr + ED_WD_MSR, ED_WD_MSR_MENB); | 1463 (void) inb(0x84); 1464 if (sc->is790) { 1465 outb(sc->asic_addr + ED_WD_MSR, ED_WD_MSR_MENB); 1466 (void) inb(0x84); 1467 } 1468 (void) inb(0x84); |
1461 break; 1462 } 1463 } 1464 } 1465 1466 for (len = 0; m != 0; m = m->m_next) { 1467 bcopy(mtod(m, caddr_t), buffer, m->m_len); 1468 buffer += m->m_len; --- 6 unchanged lines hidden (view full) --- 1475 if (sc->isa16bit) { 1476 switch (sc->vendor) { 1477 case ED_VENDOR_3COM: 1478 outb(sc->asic_addr + ED_3COM_GACFR, 1479 ED_3COM_GACFR_RSEL | ED_3COM_GACFR_MBS0); 1480 break; 1481 case ED_VENDOR_WD_SMC: { 1482 outb(sc->asic_addr + ED_WD_LAAR, sc->wd_laar_proto); | 1469 break; 1470 } 1471 } 1472 } 1473 1474 for (len = 0; m != 0; m = m->m_next) { 1475 bcopy(mtod(m, caddr_t), buffer, m->m_len); 1476 buffer += m->m_len; --- 6 unchanged lines hidden (view full) --- 1483 if (sc->isa16bit) { 1484 switch (sc->vendor) { 1485 case ED_VENDOR_3COM: 1486 outb(sc->asic_addr + ED_3COM_GACFR, 1487 ED_3COM_GACFR_RSEL | ED_3COM_GACFR_MBS0); 1488 break; 1489 case ED_VENDOR_WD_SMC: { 1490 outb(sc->asic_addr + ED_WD_LAAR, sc->wd_laar_proto); |
1483 if (sc->is790) 1484 outb(sc->asic_addr + ED_WD_MSR, 0x00); | 1491 (void) inb(0x84); 1492 if (sc->is790) { 1493 outb(sc->asic_addr + ED_WD_MSR, 0x00); 1494 (void) inb(0x84); 1495 } |
1485 break; 1486 } 1487 } 1488 } 1489 } else { 1490 len = ed_pio_write_mbufs(sc, m, buffer); 1491 } 1492 --- 341 unchanged lines hidden (view full) --- 1834 * on WD/SMC boards. 1835 */ 1836 if (sc->isa16bit && 1837 (sc->vendor == ED_VENDOR_WD_SMC)) { 1838 1839 outb(sc->asic_addr + ED_WD_LAAR, 1840 (sc->wd_laar_proto |= 1841 ED_WD_LAAR_M16EN)); | 1496 break; 1497 } 1498 } 1499 } 1500 } else { 1501 len = ed_pio_write_mbufs(sc, m, buffer); 1502 } 1503 --- 341 unchanged lines hidden (view full) --- 1845 * on WD/SMC boards. 1846 */ 1847 if (sc->isa16bit && 1848 (sc->vendor == ED_VENDOR_WD_SMC)) { 1849 1850 outb(sc->asic_addr + ED_WD_LAAR, 1851 (sc->wd_laar_proto |= 1852 ED_WD_LAAR_M16EN)); |
1842 if (sc->is790) 1843 outb(sc->asic_addr + ED_WD_MSR, 1844 ED_WD_MSR_MENB); | 1853 (void) inb(0x84); 1854 if (sc->is790) { 1855 outb(sc->asic_addr + ED_WD_MSR, 1856 ED_WD_MSR_MENB); 1857 (void) inb(0x84); 1858 } |
1845 } 1846 1847 ed_rint (unit); 1848 1849 /* disable 16bit access */ 1850 if (sc->isa16bit && 1851 (sc->vendor == ED_VENDOR_WD_SMC)) { 1852 1853 outb(sc->asic_addr + ED_WD_LAAR, 1854 (sc->wd_laar_proto &= 1855 ~ED_WD_LAAR_M16EN)); | 1859 } 1860 1861 ed_rint (unit); 1862 1863 /* disable 16bit access */ 1864 if (sc->isa16bit && 1865 (sc->vendor == ED_VENDOR_WD_SMC)) { 1866 1867 outb(sc->asic_addr + ED_WD_LAAR, 1868 (sc->wd_laar_proto &= 1869 ~ED_WD_LAAR_M16EN)); |
1856 if (sc->is790) 1857 outb(sc->asic_addr + ED_WD_MSR, 0x00); | 1870 (void) inb(0x84); 1871 if (sc->is790) { 1872 outb(sc->asic_addr + ED_WD_MSR, 0x00); 1873 (void) inb(0x84); 1874 } |
1858 } 1859 } 1860 } 1861 1862 /* 1863 * If it looks like the transmitter can take more data, 1864 * attempt to start output on the interface. 1865 * This is done after handling the receiver to --- 606 unchanged lines hidden --- | 1875 } 1876 } 1877 } 1878 1879 /* 1880 * If it looks like the transmitter can take more data, 1881 * attempt to start output on the interface. 1882 * This is done after handling the receiver to --- 606 unchanged lines hidden --- |