if_de.c (12293) | if_de.c (12341) |
---|---|
1/*- 2 * Copyright (c) 1994, 1995 Matt Thomas (matt@lkg.dec.com) 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 7 unchanged lines hidden (view full) --- 16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * | 1/*- 2 * Copyright (c) 1994, 1995 Matt Thomas (matt@lkg.dec.com) 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 7 unchanged lines hidden (view full) --- 16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * |
24 * $Id: if_de.c,v 1.35 1995/10/26 07:40:11 davidg Exp $ | 24 * $Id: if_de.c,v 1.36 1995/11/14 10:03:56 phk Exp $ |
25 * 26 */ 27 28/* 29 * DEC DC21040 PCI Ethernet Controller 30 * 31 * Written by Matt Thomas 32 * BPF support code stolen directly from if_ec.c --- 376 unchanged lines hidden (view full) --- 409 } 410 return (TULIP_READ_CSR(sc, csr_sia_status) & TULIP_SIASTS_LINKFAIL) != 0; 411} 412 413static void 414tulip_dc21040_media_select( 415 tulip_softc_t * const sc) 416{ | 25 * 26 */ 27 28/* 29 * DEC DC21040 PCI Ethernet Controller 30 * 31 * Written by Matt Thomas 32 * BPF support code stolen directly from if_ec.c --- 376 unchanged lines hidden (view full) --- 409 } 410 return (TULIP_READ_CSR(sc, csr_sia_status) & TULIP_SIASTS_LINKFAIL) != 0; 411} 412 413static void 414tulip_dc21040_media_select( 415 tulip_softc_t * const sc) 416{ |
417 sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_THRSHLD160; | 417 sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_THRSHLD160 418 |TULIP_CMD_BACKOFFCTR; |
418 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_RESET); 419 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 420 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 421 printf("%s%d: enabling Thinwire/AUI port\n", 422 sc->tulip_if.if_name, sc->tulip_if.if_unit); 423 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_AUI); 424 sc->tulip_flags |= TULIP_ALTPHYS; 425 } else { --- 21 unchanged lines hidden (view full) --- 447 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_10BASET); 448 return 0; 449} 450 451static void 452tulip_zx314_media_select( 453 tulip_softc_t * const sc) 454{ | 419 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_RESET); 420 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 421 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 422 printf("%s%d: enabling Thinwire/AUI port\n", 423 sc->tulip_if.if_name, sc->tulip_if.if_unit); 424 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_AUI); 425 sc->tulip_flags |= TULIP_ALTPHYS; 426 } else { --- 21 unchanged lines hidden (view full) --- 448 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_10BASET); 449 return 0; 450} 451 452static void 453tulip_zx314_media_select( 454 tulip_softc_t * const sc) 455{ |
455 sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_THRSHLD160; | 456 sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_THRSHLD160 457 |TULIP_CMD_BACKOFFCTR; |
456 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_RESET); 457 if (sc->tulip_flags & TULIP_ALTPHYS) 458 printf("%s%d: enabling 10baseT/UTP port\n", 459 sc->tulip_if.if_name, sc->tulip_if.if_unit); 460 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_10BASET); 461 sc->tulip_flags &= ~TULIP_ALTPHYS; 462 sc->tulip_media = TULIP_MEDIA_10BASET; 463} --- 27 unchanged lines hidden (view full) --- 491 DELAY(1000000); 492 return (TULIP_READ_CSR(sc, csr_gp) & TULIP_GP_EB_OK100) != 0; 493} 494 495static void 496tulip_dc21140_evalboard_media_select( 497 tulip_softc_t * const sc) 498{ | 458 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_RESET); 459 if (sc->tulip_flags & TULIP_ALTPHYS) 460 printf("%s%d: enabling 10baseT/UTP port\n", 461 sc->tulip_if.if_name, sc->tulip_if.if_unit); 462 TULIP_WRITE_CSR(sc, csr_sia_connectivity, TULIP_SIACONN_10BASET); 463 sc->tulip_flags &= ~TULIP_ALTPHYS; 464 sc->tulip_media = TULIP_MEDIA_10BASET; 465} --- 27 unchanged lines hidden (view full) --- 493 DELAY(1000000); 494 return (TULIP_READ_CSR(sc, csr_gp) & TULIP_GP_EB_OK100) != 0; 495} 496 497static void 498tulip_dc21140_evalboard_media_select( 499 tulip_softc_t * const sc) 500{ |
499 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE; | 501 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE 502 |TULIP_CMD_BACKOFFCTR; |
500 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_EB_PINS); 501 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_EB_INIT); 502 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 503 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 504 printf("%s%d: enabling 100baseTX UTP port\n", 505 sc->tulip_if.if_name, sc->tulip_if.if_unit); 506 sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT 507 |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER; --- 32 unchanged lines hidden (view full) --- 540 TULIP_READ_CSR(sc, csr_command) & ~TULIP_CMD_TXTHRSHLDCTL); 541 return 1; 542} 543 544static void 545tulip_dc21140_cogent_em100_media_select( 546 tulip_softc_t * const sc) 547{ | 503 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_EB_PINS); 504 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_EB_INIT); 505 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 506 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 507 printf("%s%d: enabling 100baseTX UTP port\n", 508 sc->tulip_if.if_name, sc->tulip_if.if_unit); 509 sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT 510 |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER; --- 32 unchanged lines hidden (view full) --- 543 TULIP_READ_CSR(sc, csr_command) & ~TULIP_CMD_TXTHRSHLDCTL); 544 return 1; 545} 546 547static void 548tulip_dc21140_cogent_em100_media_select( 549 tulip_softc_t * const sc) 550{ |
548 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE; | 551 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE 552 |TULIP_CMD_BACKOFFCTR; |
549 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_EM100_PINS); 550 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_EM100_INIT); 551 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 552 printf("%s%d: enabling 100baseTX UTP port\n", 553 sc->tulip_if.if_name, sc->tulip_if.if_unit); 554 sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT 555 |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER; 556 sc->tulip_cmdmode &= ~TULIP_CMD_TXTHRSHLDCTL; --- 24 unchanged lines hidden (view full) --- 581 582 return (TULIP_READ_CSR(sc, csr_gp) & TULIP_GP_ZX34X_OK10); 583} 584 585static void 586tulip_dc21140_znyx_zx34x_media_select( 587 tulip_softc_t * const sc) 588{ | 553 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_EM100_PINS); 554 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_EM100_INIT); 555 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 556 printf("%s%d: enabling 100baseTX UTP port\n", 557 sc->tulip_if.if_name, sc->tulip_if.if_unit); 558 sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT 559 |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER; 560 sc->tulip_cmdmode &= ~TULIP_CMD_TXTHRSHLDCTL; --- 24 unchanged lines hidden (view full) --- 585 586 return (TULIP_READ_CSR(sc, csr_gp) & TULIP_GP_ZX34X_OK10); 587} 588 589static void 590tulip_dc21140_znyx_zx34x_media_select( 591 tulip_softc_t * const sc) 592{ |
589 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE; | 593 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE 594 |TULIP_CMD_BACKOFFCTR; |
590 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_ZX34X_PINS); 591 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_ZX34X_INIT); 592 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 593 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 594 printf("%s%d: enabling 100baseTX UTP port\n", 595 sc->tulip_if.if_name, sc->tulip_if.if_unit); 596 sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT 597 |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER; --- 40 unchanged lines hidden (view full) --- 638 DELAY(1000000); 639 return (TULIP_READ_CSR(sc, csr_gp) & TULIP_GP_DE500_NOTOK_100) != 0; 640} 641 642static void 643tulip_dc21140_de500_media_select( 644 tulip_softc_t * const sc) 645{ | 595 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_ZX34X_PINS); 596 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_ZX34X_INIT); 597 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 598 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 599 printf("%s%d: enabling 100baseTX UTP port\n", 600 sc->tulip_if.if_name, sc->tulip_if.if_unit); 601 sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT 602 |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER; --- 40 unchanged lines hidden (view full) --- 643 DELAY(1000000); 644 return (TULIP_READ_CSR(sc, csr_gp) & TULIP_GP_DE500_NOTOK_100) != 0; 645} 646 647static void 648tulip_dc21140_de500_media_select( 649 tulip_softc_t * const sc) 650{ |
646 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE; | 651 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE 652 |TULIP_CMD_BACKOFFCTR; |
647 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_DE500_PINS); 648 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 649 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 650 printf("%s%d: enabling 100baseTX UTP port\n", 651 sc->tulip_if.if_name, sc->tulip_if.if_unit); 652 sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT 653 |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER; 654 sc->tulip_cmdmode &= ~TULIP_CMD_TXTHRSHLDCTL; --- 27 unchanged lines hidden (view full) --- 682 return 0; 683} 684 685static void 686tulip_dc21041_media_select( 687 tulip_softc_t * const sc) 688{ 689 sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_ENHCAPTEFFCT | 653 TULIP_WRITE_CSR(sc, csr_gp, TULIP_GP_DE500_PINS); 654 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 655 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) 656 printf("%s%d: enabling 100baseTX UTP port\n", 657 sc->tulip_if.if_name, sc->tulip_if.if_unit); 658 sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT 659 |TULIP_CMD_PCSFUNCTION|TULIP_CMD_SCRAMBLER; 660 sc->tulip_cmdmode &= ~TULIP_CMD_TXTHRSHLDCTL; --- 27 unchanged lines hidden (view full) --- 688 return 0; 689} 690 691static void 692tulip_dc21041_media_select( 693 tulip_softc_t * const sc) 694{ 695 sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_ENHCAPTEFFCT |
690 /* |TULIP_CMD_FULLDUPLEX */ |TULIP_CMD_THRSHLD160; | 696 /* |TULIP_CMD_FULLDUPLEX */ |TULIP_CMD_THRSHLD160|TULIP_CMD_BACKOFFCTR; |
691 sc->tulip_intrmask |= TULIP_STS_NORMALINTR|TULIP_STS_GPTIMEOUT 692 |TULIP_STS_ABNRMLINTR|TULIP_STS_LINKPASS|TULIP_STS_LINKFAIL; 693 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 694 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) { 695 sc->tulip_media = TULIP_MEDIA_UNKNOWN; 696 sc->tulip_flags &= ~(TULIP_TXPROBE_OK|TULIP_TXPROBE_ACTIVE); 697 sc->tulip_flags |= TULIP_ALTPHYS|TULIP_WANTRXACT; 698 sc->tulip_probe_state = TULIP_PROBE_INACTIVE; --- 1851 unchanged lines hidden --- | 697 sc->tulip_intrmask |= TULIP_STS_NORMALINTR|TULIP_STS_GPTIMEOUT 698 |TULIP_STS_ABNRMLINTR|TULIP_STS_LINKPASS|TULIP_STS_LINKFAIL; 699 if (sc->tulip_if.if_flags & IFF_ALTPHYS) { 700 if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) { 701 sc->tulip_media = TULIP_MEDIA_UNKNOWN; 702 sc->tulip_flags &= ~(TULIP_TXPROBE_OK|TULIP_TXPROBE_ACTIVE); 703 sc->tulip_flags |= TULIP_ALTPHYS|TULIP_WANTRXACT; 704 sc->tulip_probe_state = TULIP_PROBE_INACTIVE; --- 1851 unchanged lines hidden --- |