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.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{ |
417 sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_THRSHLD160 418 |TULIP_CMD_BACKOFFCTR; |
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{ |
456 sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_THRSHLD160 457 |TULIP_CMD_BACKOFFCTR; |
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{ |
501 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE 502 |TULIP_CMD_BACKOFFCTR; |
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{ |
551 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE 552 |TULIP_CMD_BACKOFFCTR; |
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{ |
593 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE 594 |TULIP_CMD_BACKOFFCTR; |
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{ |
651 sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE 652 |TULIP_CMD_BACKOFFCTR; |
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 |
696 /* |TULIP_CMD_FULLDUPLEX */ |TULIP_CMD_THRSHLD160|TULIP_CMD_BACKOFFCTR; |
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 --- |