From 83861845246adc20e7985e1e4f77c0566180fd18 Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 2 Sep 1999 23:25:28 +0000 Subject: [PATCH] Deal with some more Winbond differences, after a more-thorough-than-before reading of its manual. --- sys/dev/ic/tulip.c | 231 ++++++++++++++++++++++++++++++------------ sys/dev/ic/tulipreg.h | 54 +++++++--- sys/dev/ic/tulipvar.h | 8 +- 3 files changed, 218 insertions(+), 75 deletions(-) diff --git a/sys/dev/ic/tulip.c b/sys/dev/ic/tulip.c index eeb229dc3c8a..607d1f7329e9 100644 --- a/sys/dev/ic/tulip.c +++ b/sys/dev/ic/tulip.c @@ -1,4 +1,4 @@ -/* $NetBSD: tulip.c,v 1.4 1999/09/01 20:56:15 thorpej Exp $ */ +/* $NetBSD: tulip.c,v 1.5 1999/09/02 23:25:28 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -117,6 +117,23 @@ const struct tulip_txthresh_tab tlp_10_100_txthresh_tab[] = { #define TXTH_160 3 #define TXTH_SF 4 +/* + * The Winbond 89C840F does transmit threshold control totally + * differently. It simply has a 7-bit field which indicates + * the threshold: + * + * txth = ((OPMODE & OPMODE_WINB_TTH) >> OPMODE_WINB_TTH_SHIFT) * 16; + * + * However, we just do Store-and-Forward mode on these chips, since + * the DMA engines seem to be flaky. + */ +const struct tulip_txthresh_tab tlp_winb_txthresh_tab[] = { + { 0, "store and forward mode" }, + { 0, NULL }, +}; + +#define TXTH_WINB_SF 0 + void tlp_start __P((struct ifnet *)); void tlp_watchdog __P((struct ifnet *)); int tlp_ioctl __P((struct ifnet *, u_long, caddr_t)); @@ -139,6 +156,7 @@ void tlp_txintr __P((struct tulip_softc *)); void tlp_mii_tick __P((void *)); void tlp_mii_statchg __P((struct device *)); +void tlp_winb_mii_statchg __P((struct device *)); void tlp_mii_getmedia __P((struct tulip_softc *, struct ifmediareq *)); int tlp_mii_setmedia __P((struct tulip_softc *)); @@ -156,9 +174,10 @@ u_int32_t tlp_crc32 __P((const u_int8_t *, size_t)); (TULIP_MCHASHSIZE - 1)) #ifdef TLP_DEBUG -#define DPRINTF(x) printf x +#define DPRINTF(sc, x) if ((sc)->sc_ethercom.ec_if.if_flags & IFF_DEBUG) \ + printf x #else -#define DPRINTF(x) /* nothing */ +#define DPRINTF(sc, x) /* nothing */ #endif /* @@ -208,6 +227,19 @@ tlp_attach(sc, name, enaddr) break; } + /* + * Set up the media status change function. + */ + switch (sc->sc_chip) { + case TULIP_CHIP_WB89C840F: + sc->sc_statchg = tlp_winb_mii_statchg; + break; + + default: + sc->sc_statchg = tlp_mii_statchg; + break; + } + /* * Set up various chip-specific quirks. */ @@ -394,7 +426,7 @@ tlp_start(ifp) bus_dmamap_t dmamap; int error, firsttx, nexttx, lasttx, ofree, seg; - DPRINTF(("%s: tlp_start: sc_flags 0x%08x, if_flags 0x%08x\n", + DPRINTF(sc, ("%s: tlp_start: sc_flags 0x%08x, if_flags 0x%08x\n", sc->sc_dev.dv_xname, sc->sc_flags, ifp->if_flags)); /* @@ -415,7 +447,7 @@ tlp_start(ifp) ofree = sc->sc_txfree; firsttx = sc->sc_txnext; - DPRINTF(("%s: tlp_start: txfree %d, txnext %d\n", + DPRINTF(sc, ("%s: tlp_start: txfree %d, txnext %d\n", sc->sc_dev.dv_xname, ofree, firsttx)); /* @@ -529,19 +561,21 @@ tlp_start(ifp) sc->sc_txdescs[lasttx].td_ctl |= TDCTL_Tx_LS; #ifdef TLP_DEBUG - printf(" txsoft %p trainsmit chain:\n", txs); - for (seg = sc->sc_txnext;; seg = TULIP_NEXTTX(seg)) { - printf(" descriptor %d:\n", seg); - printf(" td_status: 0x%08x\n", - sc->sc_txdescs[seg].td_status); - printf(" td_ctl: 0x%08x\n", - sc->sc_txdescs[seg].td_ctl); - printf(" td_bufaddr1: 0x%08x\n", - sc->sc_txdescs[seg].td_bufaddr1); - printf(" td_bufaddr2: 0x%08x\n", - sc->sc_txdescs[seg].td_bufaddr2); - if (seg == lasttx) - break; + if (ifp->if_flags & IFF_DEBUG) { + printf(" txsoft %p trainsmit chain:\n", txs); + for (seg = sc->sc_txnext;; seg = TULIP_NEXTTX(seg)) { + printf(" descriptor %d:\n", seg); + printf(" td_status: 0x%08x\n", + sc->sc_txdescs[seg].td_status); + printf(" td_ctl: 0x%08x\n", + sc->sc_txdescs[seg].td_ctl); + printf(" td_bufaddr1: 0x%08x\n", + sc->sc_txdescs[seg].td_bufaddr1); + printf(" td_bufaddr2: 0x%08x\n", + sc->sc_txdescs[seg].td_bufaddr2); + if (seg == lasttx) + break; + } } #endif @@ -582,7 +616,7 @@ tlp_start(ifp) } if (sc->sc_txfree != ofree) { - DPRINTF(("%s: packets enqueued, IC on %d, OWN on %d\n", + DPRINTF(sc, ("%s: packets enqueued, IC on %d, OWN on %d\n", sc->sc_dev.dv_xname, lasttx, firsttx)); /* * Cause a transmit interrupt to happen on the @@ -781,10 +815,10 @@ tlp_intr(arg) { struct tulip_softc *sc = arg; struct ifnet *ifp = &sc->sc_ethercom.ec_if; - u_int32_t status; + u_int32_t status, rxstatus, txstatus; int handled = 0, txthresh; - DPRINTF(("%s: tlp_intr\n", sc->sc_dev.dv_xname)); + DPRINTF(sc, ("%s: tlp_intr\n", sc->sc_dev.dv_xname)); for (;;) { status = TULIP_READ(sc, CSR_STATUS); @@ -796,15 +830,18 @@ tlp_intr(arg) handled = 1; - if (status & (STATUS_RI|STATUS_RU|STATUS_RWT)) { + rxstatus = status & sc->sc_rxint_mask; + txstatus = status & sc->sc_txint_mask; + + if (rxstatus) { /* Grab new any new packets. */ tlp_rxintr(sc); - if (status & STATUS_RWT) + if (rxstatus & STATUS_RWT) printf("%s: receive watchdog timeout\n", sc->sc_dev.dv_xname); - if (status & STATUS_RU) { + if (rxstatus & STATUS_RU) { printf("%s: receive ring overrun\n", sc->sc_dev.dv_xname); /* Get the receive process going again. */ @@ -817,15 +854,15 @@ tlp_intr(arg) } } - if (status & (STATUS_TI|STATUS_UNF|STATUS_TJT)) { + if (txstatus) { /* Sweep up transmit descriptors. */ tlp_txintr(sc); - if (status & STATUS_TJT) + if (txstatus & STATUS_TJT) printf("%s: transmit jabber timeout\n", sc->sc_dev.dv_xname); - if (status & STATUS_UNF) { + if (txstatus & STATUS_UNF) { /* * Increase our transmit threshold if * another is available. @@ -1099,7 +1136,7 @@ tlp_txintr(sc) struct tulip_txsoft *txs; u_int32_t txstat; - DPRINTF(("%s: tlp_txintr: sc_flags 0x%08x\n", + DPRINTF(sc, ("%s: tlp_txintr: sc_flags 0x%08x\n", sc->sc_dev.dv_xname, sc->sc_flags)); ifp->if_flags &= ~IFF_OACTIVE; @@ -1123,21 +1160,23 @@ tlp_txintr(sc) BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); #ifdef TLP_DEBUG - { int i; - printf(" txsoft %p trainsmit chain:\n", txs); - for (i = txs->txs_firstdesc;; i = TULIP_NEXTTX(i)) { - printf(" descriptor %d:\n", i); - printf(" td_status: 0x%08x\n", - sc->sc_txdescs[i].td_status); - printf(" td_ctl: 0x%08x\n", - sc->sc_txdescs[i].td_ctl); - printf(" td_bufaddr1: 0x%08x\n", - sc->sc_txdescs[i].td_bufaddr1); - printf(" td_bufaddr2: 0x%08x\n", - sc->sc_txdescs[i].td_bufaddr2); - if (i == txs->txs_lastdesc) - break; - }} + if (ifp->if_flags & IFF_DEBUG) { + int i; + printf(" txsoft %p trainsmit chain:\n", txs); + for (i = txs->txs_firstdesc;; i = TULIP_NEXTTX(i)) { + printf(" descriptor %d:\n", i); + printf(" td_status: 0x%08x\n", + sc->sc_txdescs[i].td_status); + printf(" td_ctl: 0x%08x\n", + sc->sc_txdescs[i].td_ctl); + printf(" td_bufaddr1: 0x%08x\n", + sc->sc_txdescs[i].td_bufaddr1); + printf(" td_bufaddr2: 0x%08x\n", + sc->sc_txdescs[i].td_bufaddr2); + if (i == txs->txs_lastdesc) + break; + } + } #endif txstat = sc->sc_txdescs[txs->txs_firstdesc].td_status; @@ -1301,17 +1340,23 @@ tlp_init(sc) } if (sc->sc_flags & TULIPF_HAS_MII) { - /* Enable the MII port. */ - sc->sc_opmode |= OPMODE_PS; - switch (sc->sc_chip) { case TULIP_CHIP_82C168: case TULIP_CHIP_82C169: + /* Enable the MII port. */ + sc->sc_opmode |= OPMODE_PS; + TULIP_WRITE(sc, CSR_PNIC_ENDEC, PNIC_ENDEC_JABBERDIS); break; - default: + case TULIP_CHIP_WB89C840F: /* Nothing. */ + break; + + default: + /* Enable the MII port. */ + sc->sc_opmode |= OPMODE_PS; + break; } } @@ -1387,10 +1432,30 @@ tlp_init(sc) */ /* normal interrupts */ sc->sc_inten = STATUS_TI | STATUS_TU | STATUS_RI | STATUS_NIS; + /* abnormal interrupts */ sc->sc_inten |= STATUS_TPS | STATUS_TJT | STATUS_UNF | STATUS_RU | STATUS_RPS | STATUS_RWT | STATUS_SE | STATUS_AIS; + sc->sc_rxint_mask = STATUS_RI|STATUS_RU|STATUS_RWT; + sc->sc_txint_mask = STATUS_TI|STATUS_UNF|STATUS_TJT; + + switch (sc->sc_chip) { + case TULIP_CHIP_WB89C840F: + /* + * Clear bits that we don't want that happen to + * overlap or don't exist. + */ + sc->sc_inten &= ~(STATUS_WINB_REI|STATUS_RWT); + break; + + default: + /* Nothing. */ + } + + sc->sc_rxint_mask &= sc->sc_inten; + sc->sc_txint_mask &= sc->sc_inten; + TULIP_WRITE(sc, CSR_INTEN, sc->sc_inten); TULIP_WRITE(sc, CSR_STATUS, 0xffffffff); @@ -1408,7 +1473,7 @@ tlp_init(sc) /* XXX Do this with stream writes? */ for (i = 0; i < ETHER_ADDR_LEN; i++) { bus_space_write_1(sc->sc_st, sc->sc_sh, - (CSR_WINB_NODE0 >> sc->sc_regshift) + i, + (CSR_WINB_CPA0 >> sc->sc_regshift) + i, LLADDR(ifp->if_sadl)[i]); } break; @@ -1754,7 +1819,7 @@ tlp_filter_setup(sc) u_int32_t hash; int cnt; - DPRINTF(("%s: tlp_filter_setup: sc_flags 0x%08x\n", + DPRINTF(sc, ("%s: tlp_filter_setup: sc_flags 0x%08x\n", sc->sc_dev.dv_xname, sc->sc_flags)); memcpy(enaddr, LLADDR(ifp->if_sadl), ETHER_ADDR_LEN); @@ -1766,7 +1831,7 @@ tlp_filter_setup(sc) if (SIMPLEQ_FIRST(&sc->sc_txdirtyq) != NULL || (sc->sc_flags & TULIPF_DOING_SETUP) != 0) { sc->sc_flags |= TULIPF_WANT_SETUP; - DPRINTF(("%s: tlp_filter_setup: deferring\n", + DPRINTF(sc, ("%s: tlp_filter_setup: deferring\n", sc->sc_dev.dv_xname)); return; } @@ -1964,7 +2029,7 @@ tlp_filter_setup(sc) /* Set up a watchdog timer in case the chip flakes out. */ ifp->if_timer = 5; - DPRINTF(("%s: tlp_filter_setup: returning\n", sc->sc_dev.dv_xname)); + DPRINTF(sc, ("%s: tlp_filter_setup: returning\n", sc->sc_dev.dv_xname)); } /* @@ -1982,13 +2047,19 @@ tlp_winb_filter_setup(sc) struct ether_multistep step; u_int32_t hash, mchash[2]; - DPRINTF(("%s: tlp_winb_filter_setup: sc_flags 0x%08x\n", + DPRINTF(sc, ("%s: tlp_winb_filter_setup: sc_flags 0x%08x\n", sc->sc_dev.dv_xname, sc->sc_flags)); - sc->sc_opmode &= ~(OPMODE_PR|OPMODE_PM); + sc->sc_opmode &= ~(OPMODE_WINB_APP|OPMODE_WINB_AMP|OPMODE_WINB_ABP); + + if (ifp->if_flags & IFF_MULTICAST) + sc->sc_opmode |= OPMODE_WINB_AMP; + + if (ifp->if_flags & IFF_BROADCAST) + sc->sc_opmode |= OPMODE_WINB_ABP; if (ifp->if_flags & IFF_PROMISC) { - sc->sc_opmode |= OPMODE_PR; + sc->sc_opmode |= OPMODE_WINB_APP; goto allmulti; } @@ -2025,13 +2096,10 @@ tlp_winb_filter_setup(sc) mchash[0] = mchash[1] = 0xffffffff; setit: - if (ifp->if_flags & IFF_ALLMULTI) - sc->sc_opmode |= OPMODE_PM; - - TULIP_WRITE(sc, CSR_WINB_MAR0, mchash[0]); - TULIP_WRITE(sc, CSR_WINB_MAR1, mchash[1]); + TULIP_WRITE(sc, CSR_WINB_CMA0, mchash[0]); + TULIP_WRITE(sc, CSR_WINB_CMA1, mchash[1]); TULIP_WRITE(sc, CSR_OPMODE, sc->sc_opmode); - DPRINTF(("%s: tlp_winb_filter_setup: returning\n", + DPRINTF(sc, ("%s: tlp_winb_filter_setup: returning\n", sc->sc_dev.dv_xname)); } @@ -2192,6 +2260,45 @@ tlp_mii_statchg(self) /* XXX Update ifp->if_baudrate */ } +/* + * tlp_winb_mii_statchg: [mii interface function] + * + * Callback from PHY when media changes. This version is + * for the Winbond 89C840F, which has different OPMODE bits. + */ +void +tlp_winb_mii_statchg(self) + struct device *self; +{ + struct tulip_softc *sc = (struct tulip_softc *)self; + + /* Idle the transmit and receive processes. */ + tlp_idle(sc, OPMODE_ST|OPMODE_SR); + + /* + * XXX What about Heartbeat Disable? Is it magically frobbed + * XXX by the PHY? I hope so... + */ + + if (IFM_SUBTYPE(sc->sc_mii.mii_media_active) == IFM_100_TX) + sc->sc_opmode |= OPMODE_WINB_FES; + else + sc->sc_opmode &= ~OPMODE_WINB_FES; + + if (sc->sc_mii.mii_media_active & IFM_FDX) + sc->sc_opmode |= OPMODE_FD; + else + sc->sc_opmode &= ~OPMODE_FD; + + /* + * Write new OPMODE bits. This also restarts the transmit + * and receive processes. + */ + TULIP_WRITE(sc, CSR_OPMODE, sc->sc_opmode); + + /* XXX Update ifp->if_baudrate */ +} + /* * tlp_mii_getmedia: * @@ -2428,7 +2535,7 @@ tlp_sio_mii_tmsw_init(sc) sc->sc_mii.mii_ifp = ifp; sc->sc_mii.mii_readreg = tlp_sio_mii_readreg; sc->sc_mii.mii_writereg = tlp_sio_mii_writereg; - sc->sc_mii.mii_statchg = tlp_mii_statchg; + sc->sc_mii.mii_statchg = sc->sc_statchg; ifmedia_init(&sc->sc_mii.mii_media, 0, tlp_mediachange, tlp_mediastatus); mii_phy_probe(&sc->sc_dev, &sc->sc_mii, 0xffffffff); @@ -2461,7 +2568,7 @@ tlp_pnic_tmsw_init(sc) sc->sc_mii.mii_ifp = ifp; sc->sc_mii.mii_readreg = tlp_pnic_mii_readreg; sc->sc_mii.mii_writereg = tlp_pnic_mii_writereg; - sc->sc_mii.mii_statchg = tlp_mii_statchg; + sc->sc_mii.mii_statchg = sc->sc_statchg; ifmedia_init(&sc->sc_mii.mii_media, 0, tlp_mediachange, tlp_mediastatus); mii_phy_probe(&sc->sc_dev, &sc->sc_mii, 0xffffffff); diff --git a/sys/dev/ic/tulipreg.h b/sys/dev/ic/tulipreg.h index ebf8cc8d6154..704c744142ba 100644 --- a/sys/dev/ic/tulipreg.h +++ b/sys/dev/ic/tulipreg.h @@ -1,4 +1,4 @@ -/* $NetBSD: tulipreg.h,v 1.1 1999/09/01 00:32:41 thorpej Exp $ */ +/* $NetBSD: tulipreg.h,v 1.2 1999/09/02 23:25:29 thorpej Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -93,6 +93,7 @@ struct tulip_desc { * Descriptor Status bits for Receive Descriptor. */ #define TDSTAT_Rx_FF 0x40000000 /* Filtering Fail */ +#define TDSTAT_WINB_Rx_RCMP 0x40000000 /* Receive Complete */ #define TDSTAT_Rx_FL 0x3fff0000 /* Frame Length including CRC */ #define TDSTAT_Rx_DE 0x00004000 /* Descriptor Error */ #define TDSTAT_Rx_DT 0x00003000 /* Data Type */ @@ -119,6 +120,7 @@ struct tulip_desc { /* * Descriptor Status bits for Transmit Descriptor. */ +#define TDSTAT_WINB_Tx_TE 0x00008000 /* Transmit Error */ #define TDSTAT_Tx_TO 0x00004000 /* Transmit Jabber Timeout */ #define TDSTAT_Tx_LO 0x00000800 /* Loss of Carrier */ #define TDSTAT_Tx_NC 0x00000400 /* No Carrier */ @@ -250,6 +252,10 @@ struct tulip_desc { #define BUSMODE_DAS 0x00010000 /* diagnostic address space */ /* must be zero on most */ /* transmit auto-poll */ + /* + * Transmit auto-polling not supported on: + * Winbond 89C040F + */ #define BUSMODE_TAP_NONE 0x00000000 /* no auto-polling */ #define BUSMODE_TAP_200us 0x00020000 /* 200 uS */ #define BUSMODE_TAP_800us 0x00040000 /* 400 uS */ @@ -260,6 +266,7 @@ struct tulip_desc { #define BUSMODE_TAP_102_4us 0x000e0000 /* 102.4 uS (21041+) */ #define BUSMODE_DBO 0x00100000 /* desc-only b/e (21041+) */ #define BUSMODE_RME 0x00200000 /* rd/mult enab (21140+) */ +#define BUSMODE_WINB_WAIT 0x00200000 /* wait state insertion */ #define BUSMODE_RLE 0x00800000 /* rd/line enab (21140+) */ #define BUSMODE_WLE 0x01000000 /* wt/line enab (21140+) */ #define BUSMODE_PNIC_MBO 0x04000000 /* magic `must be one' bit */ @@ -288,7 +295,9 @@ struct tulip_desc { #define STATUS_TPS 0x00000002 /* transmit process stopped */ #define STATUS_TU 0x00000004 /* transmit buffer unavail */ #define STATUS_TJT 0x00000008 /* transmit jabber timeout */ +#define STATUS_WINB_REI 0x00000008 /* receive early interrupt */ #define STATUS_LNPANC 0x00000010 /* link pass (21041) */ +#define STATUS_WINB_RERR 0x00000010 /* receive error */ #define STATUS_UNF 0x00000020 /* transmit underflow */ #define STATUS_RI 0x00000040 /* receive interrupt */ #define STATUS_RU 0x00000080 /* receive buffer unavail */ @@ -296,6 +305,7 @@ struct tulip_desc { #define STATUS_RWT 0x00000200 /* receive watchdog timeout */ #define STATUS_AT 0x00000400 /* SIA AUI/TP pin changed (21040) */ +#define STATUS_WINB_TEI 0x00000400 /* transmit early interrupt */ #define STATUS_FD 0x00000800 /* full duplex short frame received (21040) */ #define STATUS_TM 0x00000800 /* timer expired (21041) */ @@ -345,10 +355,15 @@ struct tulip_desc { #define OPMODE_SR 0x00000002 /* start receive */ #define OPMODE_HO 0x00000004 /* hash only mode (ro) */ #define OPMODE_PB 0x00000008 /* pass bad frames */ +#define OPMODE_WINB_APP 0x00000008 /* accept all physcal packet */ #define OPMODE_IF 0x00000010 /* inverse filter mode (ro) */ +#define OPMODE_WINB_AMP 0x00000010 /* accept multicast packet */ #define OPMODE_SB 0x00000020 /* start backoff counter */ +#define OPMODE_WINB_ABP 0x00000020 /* accept broadcast packet */ #define OPMODE_PR 0x00000040 /* promiscuous mode */ +#define OPMODE_WINB_ARP 0x00000040 /* accept runt packet */ #define OPMODE_PM 0x00000080 /* pass all multicast */ +#define OPMODE_WINB_AEP 0x00000080 /* accept error packet */ #define OPMODE_FKD 0x00000100 /* flaky oscillator disable */ #define OPMODE_FD 0x00000200 /* full-duplex mode */ #define OPMODE_OM 0x00000c00 /* operating mode */ @@ -362,6 +377,8 @@ struct tulip_desc { #define OPMODE_TR_96 0x00004000 /* 96 bytes */ #define OPMODE_TR_128 0x00008000 /* 128 bytes */ #define OPMODE_TR_160 0x0000c000 /* 160 bytes */ +#define OPMODE_WINB_TTH 0x001fc000 /* transmit threshold */ +#define OPMODE_WINB_TTH_SHIFT 14 #define OPMODE_BP 0x00010000 /* backpressure enable */ #define OPMODE_CA 0x00020000 /* capture effect enable */ #define OPMODE_PMAC_COE 0x00020000 /* collision offset enable */ @@ -375,6 +392,8 @@ struct tulip_desc { (21140) */ #define OPMODE_SF 0x00200000 /* store and forward mode (21140) */ +#define OPMODE_WINB_REIT 0x1fe00000 /* receive eartly intr thresh */ +#define OPMODE_WINB_REIT_SHIFT 21 #define OPMODE_TTM 0x00400000 /* Transmit Threshold Mode: 1 = 10mbps, 0 = 100mbps (21140) */ @@ -383,11 +402,14 @@ struct tulip_desc { #define OPMODE_MBO 0x02000000 /* must be one (21140) */ #define OPMODE_PNIC_RXCRCDIS 0x20000000 /* don't include CRC in Rx frames (PNIC) */ +#define OPMODE_WINB_FES 0x20000000 /* fast ethernet select */ #define OPMODE_RA 0x40000000 /* receive all (21140) */ #define OPMODE_PNIC_EXT_ENDEC 0x40000000 /* 1 == ext, 0 == int PHY (PNIC) */ +#define OPMODE_WINB_TEIO 0x40000000 /* transmit early intr on */ #define OPMODE_SC 0x80000000 /* special capture effect enable (21041+) */ +#define OPMODE_WINB_REIO 0x80000000 /* receive early intr on */ /* CSR7 - Interrupt Enable */ #define CSR_INTEN TULIP_CSR7 @@ -799,38 +821,46 @@ struct tulip_desc { */ /* CSR12 - Current Receive Descriptor Register */ -#define CSR_WINB_CURRXDESC TULIP_CSR12 +#define CSR_WINB_CRDAR TULIP_CSR12 /* CSR13 - Current Receive Buffer Register */ -#define CSR_WINB_CURRXBUF TULIP_CSR13 +#define CSR_WINB_CCRBAR TULIP_CSR13 /* CSR14 - Multicast Address Register 0 */ -#define CSR_WINB_MAR0 TULIP_CSR14 +#define CSR_WINB_CMA0 TULIP_CSR14 /* CSR15 - Multicast Address Register 1 */ -#define CSR_WINB_MAR1 TULIP_CSR15 +#define CSR_WINB_CMA1 TULIP_CSR15 -/* CSR16 - Node Address Register 0 */ -#define CSR_WINB_NODE0 TULIP_CSR16 +/* CSR16 - Physical Address Register 0 */ +#define CSR_WINB_CPA0 TULIP_CSR16 -/* CSR17 - Node Address Register 1 */ -#define CSR_WINB_NODE1 TULIP_CSR17 +/* CSR17 - Physical Address Register 1 */ +#define CSR_WINB_CPA1 TULIP_CSR17 /* CSR18 - Boot ROM Size Register */ -#define CSR_WINB_BOOTROMSIZE TULIP_CSR18 +#define CSR_WINB_CBRCR TULIP_CSR18 +#define WINB_CBRCR_NONE 0x00000000 /* no boot rom */ + /* 0x00000001 also no boot rom */ +#define WINB_CBRCR_8K 0x00000002 /* 8k */ +#define WINB_CBRCR_16K 0x00000003 /* 16k */ +#define WINB_CBRCR_32K 0x00000004 /* 32k */ +#define WINB_CBRCR_64K 0x00000005 /* 64k */ +#define WINB_CBRCR_128K 0x00000006 /* 128k */ +#define WINB_CBRCR_256K 0x00000007 /* CSR19 - Current Transmit Descriptor Register */ -#define CSR_WINB_CURTXDESC TULIP_CSR19 +#define CSR_WINB_CTDAR TULIP_CSR19 /* CSR20 - Current Transmit Buffer Register */ -#define CSR_WINB_CURTXBUF TULIP_CSR20 +#define CSR_WINB_CTBAR TULIP_CSR20 #endif /* _DEV_IC_TULIPREG_H_ */ diff --git a/sys/dev/ic/tulipvar.h b/sys/dev/ic/tulipvar.h index ebaf3f36dd2d..3da5bee95349 100644 --- a/sys/dev/ic/tulipvar.h +++ b/sys/dev/ic/tulipvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: tulipvar.h,v 1.3 1999/09/01 20:56:15 thorpej Exp $ */ +/* $NetBSD: tulipvar.h,v 1.4 1999/09/02 23:25:29 thorpej Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -210,6 +210,9 @@ struct tulip_softc { /* Filter setup function. */ void (*sc_filter_setup) __P((struct tulip_softc *)); + /* Media status update function */ + void (*sc_statchg) __P((struct device *)); + /* * The Winbond 89C840F places registers 4 bytes apart, instead * of 8. @@ -220,6 +223,9 @@ struct tulip_softc { u_int32_t sc_opmode; /* copy of CSR_OPMODE */ u_int32_t sc_inten; /* copy of CSR_INTEN */ + u_int32_t sc_rxint_mask; /* mask of Rx interrupts we want */ + u_int32_t sc_txint_mask; /* mask of Tx interrupts we want */ + u_int32_t sc_filtmode; /* filter mode we're using */ bus_dmamap_t sc_cddmamap; /* control data DMA map */