Date: Fri, 16 May 1997 11:35:48 -0500 (CDT) From: dave adkins <adkin003@gold.tc.umn.edu> To: freebsd-current@freebsd.org Subject: if_de.c and Cogent EM100FX support Message-ID: <Pine.NEB.3.96.970516112503.1082A-100000@samthedog.tc.umn.edu>
next in thread | raw e-mail | index | archive | help
I'm including a patch of if_de.c and dc21040.h for Cogent EM100FX fiber support. The MIISYM interface does not support scrambler and it has a different value at srom[32]. I also enabled full duplex support. I'm currently running this patch in a system with an SMC9332 and an EM100FX. --cut here-- --- if_de.c Tue May 13 07:19:13 1997 +++ if_de.c Wed May 14 11:32:53 1997 @@ -1433,6 +1433,14 @@ TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode); } +static void +tulip_21140_nomii_cogent100fxonly_media_preset( + tulip_softc_t * const sc) +{ + sc->tulip_cmdmode |= TULIP_CMD_PORTSELECT + |TULIP_CMD_PCSFUNCTION; + TULIP_CSR_WRITE(sc, csr_command, sc->tulip_cmdmode); +} static int tulip_21140_evalboard_media_probe( @@ -1606,6 +1614,49 @@ static int +tulip_21140_cogent_em100fx_media_probe( + tulip_softc_t * const sc) +{ + TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EM100_PINS); + TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EM100_INIT); + /* The big difference between tx and fx is no scrambler allowed */ + TULIP_CSR_WRITE(sc, csr_command, + (TULIP_CSR_READ(sc, csr_command) | TULIP_CMD_PORTSELECT | + TULIP_CMD_PCSFUNCTION | TULIP_CMD_MUSTBEONE) & ~TULIP_CMD_SCRAMBLER ); + TULIP_CSR_WRITE(sc, csr_command, + TULIP_CSR_READ(sc, csr_command) & ~TULIP_CMD_TXTHRSHLDCTL); + return 1; +} + +static void +tulip_21140_cogent_em100fx_media_select( + tulip_softc_t * const sc) +{ + sc->tulip_cmdmode |= TULIP_CMD_STOREFWD|TULIP_CMD_MUSTBEONE + |TULIP_CMD_BACKOFFCTR | TULIP_CMD_FULLDUPLEX; + sc->tulip_flags |= TULIP_LINKUP; + TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EM100_PINS); + TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EM100_INIT); + if ((sc->tulip_flags & TULIP_ALTPHYS) == 0) + sc->tulip_flags |= TULIP_PRINTMEDIA|TULIP_ALTPHYS; + sc->tulip_cmdmode &= ~TULIP_CMD_TXTHRSHLDCTL; + sc->tulip_media = TULIP_MEDIA_100BASETX; +#ifdef BIG_PACKET + if (sc->tulip_if.if_mtu > ETHERMTU) { + TULIP_CSR_WRITE(sc, csr_watchdog, TULIP_WATCHDOG_RXDISABLE|TULIP_WATCHDOG_TXDISABLE); + } +#endif +} +static const tulip_boardsw_t tulip_21140_cogent_em100fx_boardsw = { + TULIP_21140_COGENT_EM100, + "Cogent EM100FX ", + tulip_21140_cogent_em100fx_media_probe, + tulip_21140_cogent_em100fx_media_select, + tulip_21140_nomii_cogent100fxonly_media_preset +}; + + +static int tulip_21140_znyx_zx34x_media_probe( tulip_softc_t * const sc) { @@ -3276,6 +3327,8 @@ if (sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A) { if (sc->tulip_rombuf[32] == TULIP_COGENT_EM100_ID) sc->tulip_boardsw = &tulip_21140_cogent_em100_boardsw; + else if ( sc->tulip_rombuf[32] == TULIP_COGENT_EM100FX_ID) + sc->tulip_boardsw = &tulip_21140_cogent_em100fx_boardsw; } } else if (sc->tulip_hwaddr[0] == TULIP_OUI_ZNYX_0 && sc->tulip_hwaddr[1] == TULIP_OUI_ZNYX_1 --- dc21040.h Wed May 7 07:22:36 1997 +++ dc21040.h Wed May 14 09:55:32 1997 @@ -294,6 +294,7 @@ #define TULIP_OUI_COGENT_1 0x00 #define TULIP_OUI_COGENT_2 0x92 #define TULIP_COGENT_EM100_ID 0x12 +#define TULIP_COGENT_EM100FX_ID 0x15 /* 100BaseFX ID */ /* --cut-here-- dave adkins adkin003@gold.tc.umn.edu
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96.970516112503.1082A-100000>