From owner-p4-projects@FreeBSD.ORG Tue Oct 12 14:27:30 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F261C16A4D1; Tue, 12 Oct 2004 14:27:29 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C899A16A4CE for ; Tue, 12 Oct 2004 14:27:29 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A192A43D39 for ; Tue, 12 Oct 2004 14:27:29 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9CERTKX014409 for ; Tue, 12 Oct 2004 14:27:29 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9CERTDP014406 for perforce@freebsd.org; Tue, 12 Oct 2004 14:27:29 GMT (envelope-from jhb@freebsd.org) Date: Tue, 12 Oct 2004 14:27:29 GMT Message-Id: <200410121427.i9CERTDP014406@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 63064 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2004 14:27:30 -0000 http://perforce.freebsd.org/chv.cgi?CH=63064 Change 63064 by jhb@jhb_slimer on 2004/10/12 14:27:25 Giant, Giant everywhere. Suggested by: rwatson Affected files ... .. //depot/projects/smpng/sys/pci/if_de.c#20 edit Differences ... ==== //depot/projects/smpng/sys/pci/if_de.c#20 (text+ko) ==== @@ -146,6 +146,7 @@ tulip_softc_t * const sc = arg; int s = splimp(); + mtx_assert(&Giant, MA_OWNED); TULIP_PERFSTART(timeout) sc->tulip_flags &= ~TULIP_TIMEOUTPENDING; @@ -160,6 +161,7 @@ tulip_timeout( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); if (sc->tulip_flags & TULIP_TIMEOUTPENDING) return; sc->tulip_flags |= TULIP_TIMEOUTPENDING; @@ -174,6 +176,7 @@ tulip_softc_t * const sc = arg; int s = splimp(); + mtx_assert(&Giant, MA_OWNED); sc->tulip_flags &= ~TULIP_FASTTIMEOUTPENDING; (sc->tulip_boardsw->bd_media_poll)(sc, TULIP_MEDIAPOLL_FASTTIMER); splx(s); @@ -183,6 +186,7 @@ tulip_fasttimeout( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); if (sc->tulip_flags & TULIP_FASTTIMEOUTPENDING) return; sc->tulip_flags |= TULIP_FASTTIMEOUTPENDING; @@ -195,6 +199,8 @@ tulip_softc_t * const sc) { struct mbuf *m; + + mtx_assert(&Giant, MA_OWNED); /* * Before we are sure this is the right media we need * to send a small packet to make sure there's carrier. @@ -242,6 +248,7 @@ { const tulip_media_info_t *mi = sc->tulip_mediums[media]; + mtx_assert(&Giant, MA_OWNED); if (mi == NULL) return; @@ -334,6 +341,8 @@ tulip_softc_t * const sc, tulip_media_t media) { + + mtx_assert(&Giant, MA_OWNED); if ((sc->tulip_flags & TULIP_LINKUP) == 0) sc->tulip_flags |= TULIP_PRINTLINKUP; sc->tulip_flags |= TULIP_LINKUP; @@ -387,6 +396,8 @@ tulip_media_print( tulip_softc_t * const sc) { + + mtx_assert(&Giant, MA_OWNED); if ((sc->tulip_flags & TULIP_LINKUP) == 0) return; if (sc->tulip_flags & TULIP_PRINTMEDIA) { @@ -409,6 +420,7 @@ tulip_media_t last_media = TULIP_MEDIA_UNKNOWN; tulip_media_t media; + mtx_assert(&Giant, MA_OWNED); /* * If one of the media blocks contained a default media flag, * use that. @@ -480,6 +492,7 @@ } + mtx_assert(&Giant, MA_OWNED); /* * Have we seen some packets? If so, the link must be good. */ @@ -578,6 +591,7 @@ tulip_softc_t * const sc, tulip_mediapoll_event_t event) { + mtx_assert(&Giant, MA_OWNED); #if defined(TULIP_DEBUG) sc->tulip_dbg.dbg_events[event]++; #endif @@ -867,6 +881,7 @@ tulip_media_select( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); if (sc->tulip_features & TULIP_HAVE_GPR) { TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_PINSET|sc->tulip_gpinit); DELAY(10); @@ -891,6 +906,7 @@ tulip_softc_t * const sc, tulip_media_t media) { + mtx_assert(&Giant, MA_OWNED); sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_THRSHLD160 |TULIP_CMD_BACKOFFCTR; sc->tulip_if.if_baudrate = 10000000; @@ -914,6 +930,7 @@ tulip_21040_media_probe( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); tulip_21040_mediainfo_init(sc, TULIP_MEDIA_UNKNOWN); return; } @@ -922,6 +939,7 @@ tulip_21040_10baset_only_media_probe( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); tulip_21040_mediainfo_init(sc, TULIP_MEDIA_10BASET); tulip_media_set(sc, TULIP_MEDIA_10BASET); sc->tulip_media = TULIP_MEDIA_10BASET; @@ -931,6 +949,7 @@ tulip_21040_10baset_only_media_select( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); sc->tulip_flags |= TULIP_LINKUP; if (sc->tulip_media == TULIP_MEDIA_10BASET_FD) { sc->tulip_cmdmode |= TULIP_CMD_FULLDUPLEX; @@ -946,6 +965,7 @@ tulip_21040_auibnc_only_media_probe( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); tulip_21040_mediainfo_init(sc, TULIP_MEDIA_AUIBNC); sc->tulip_flags |= TULIP_SQETEST|TULIP_LINKUP; tulip_media_set(sc, TULIP_MEDIA_AUIBNC); @@ -956,6 +976,7 @@ tulip_21040_auibnc_only_media_select( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); tulip_media_set(sc, TULIP_MEDIA_AUIBNC); sc->tulip_cmdmode &= ~TULIP_CMD_FULLDUPLEX; } @@ -987,6 +1008,7 @@ { tulip_media_info_t * const mi = sc->tulip_mediainfo; + mtx_assert(&Giant, MA_OWNED); #ifdef notyet if (sc->tulip_revinfo >= 0x20) { TULIP_MEDIAINFO_SIA_INIT(sc, &mi[0], 21041P2, 10BASET); @@ -1006,6 +1028,7 @@ tulip_21041_media_probe( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); sc->tulip_if.if_baudrate = 10000000; sc->tulip_cmdmode |= TULIP_CMD_CAPTREFFCT|TULIP_CMD_ENHCAPTEFFCT |TULIP_CMD_THRSHLD160|TULIP_CMD_BACKOFFCTR; @@ -1020,6 +1043,7 @@ { u_int32_t sia_status; + mtx_assert(&Giant, MA_OWNED); #if defined(TULIP_DEBUG) sc->tulip_dbg.dbg_events[event]++; #endif @@ -1241,6 +1265,7 @@ TULIP_MEDIA_UNKNOWN }; + mtx_assert(&Giant, MA_OWNED); /* * Don't read phy specific registers if link is not up. */ @@ -1290,6 +1315,7 @@ { unsigned phyaddr; + mtx_assert(&Giant, MA_OWNED); for (phyaddr = 1; phyaddr < 32; phyaddr++) { unsigned status = tulip_mii_readreg(sc, phyaddr, PHYREG_STATUS); if (status == 0 || status == 0xFFFF || status < PHYSTS_10BASET) @@ -1312,6 +1338,7 @@ tulip_softc_t * const sc, unsigned abilities) { + mtx_assert(&Giant, MA_OWNED); sc->tulip_abilities = abilities; if (abilities & PHYSTS_100BASETX_FD) { sc->tulip_probe_media = TULIP_MEDIA_100BASETX_FD; @@ -1336,6 +1363,7 @@ tulip_softc_t * const sc, const unsigned phyaddr) { + mtx_assert(&Giant, MA_OWNED); switch (sc->tulip_probe_state) { case TULIP_PROBE_MEDIATEST: case TULIP_PROBE_INACTIVE: { @@ -1436,6 +1464,7 @@ const tulip_media_info_t *mi = NULL; tulip_media_t media = sc->tulip_media; + mtx_assert(&Giant, MA_OWNED); if (sc->tulip_probe_state == TULIP_PROBE_INACTIVE) media = sc->tulip_media; else @@ -1511,6 +1540,7 @@ tulip_softc_t * const sc, tulip_mediapoll_event_t event) { + mtx_assert(&Giant, MA_OWNED); #if defined(TULIP_DEBUG) sc->tulip_dbg.dbg_events[event]++; #endif @@ -1528,6 +1558,7 @@ unsigned gpdata, unsigned cmdmode) { + mtx_assert(&Giant, MA_OWNED); sc->tulip_mediums[media] = mip; mip->mi_type = TULIP_MEDIAINFO_GPR; mip->mi_cmdmode = cmdmode; @@ -1540,6 +1571,7 @@ { tulip_media_info_t *mip = sc->tulip_mediainfo; + mtx_assert(&Giant, MA_OWNED); sc->tulip_gpinit = TULIP_GP_EB_PINS; sc->tulip_gpdata = TULIP_GP_EB_INIT; TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EB_PINS); @@ -1586,6 +1618,7 @@ tulip_media_info_t *mip = sc->tulip_mediainfo; unsigned gpdata; + mtx_assert(&Giant, MA_OWNED); sc->tulip_gpinit = TULIP_GP_EB_PINS; sc->tulip_gpdata = TULIP_GP_EB_INIT; TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EB_PINS); @@ -1640,6 +1673,7 @@ tulip_media_info_t *mip = sc->tulip_mediainfo; int idx, cnt = 0; + mtx_assert(&Giant, MA_OWNED); TULIP_CSR_WRITE(sc, csr_command, TULIP_CMD_PORTSELECT|TULIP_CMD_MUSTBEONE); TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET); DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at @@ -1696,6 +1730,7 @@ tulip_media_info_t *mip = sc->tulip_mediainfo; u_int32_t cmdmode = TULIP_CSR_READ(sc, csr_command); + mtx_assert(&Giant, MA_OWNED); sc->tulip_gpinit = TULIP_GP_EM100_PINS; sc->tulip_gpdata = TULIP_GP_EM100_INIT; TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_EM100_PINS); @@ -1743,6 +1778,7 @@ tulip_media_info_t *mip = sc->tulip_mediainfo; int cnt10 = 0, cnt100 = 0, idx; + mtx_assert(&Giant, MA_OWNED); sc->tulip_gpinit = TULIP_GP_ZX34X_PINS; sc->tulip_gpdata = TULIP_GP_ZX34X_INIT; TULIP_CSR_WRITE(sc, csr_gp, TULIP_GP_ZX34X_PINS); @@ -1797,6 +1833,7 @@ tulip_2114x_media_probe( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); sc->tulip_cmdmode |= TULIP_CMD_MUSTBEONE |TULIP_CMD_BACKOFFCTR|TULIP_CMD_THRSHLD72; } @@ -1824,6 +1861,7 @@ { unsigned bit, csr; + mtx_assert(&Giant, MA_OWNED); csr = SROMSEL ; EMIT; csr = SROMSEL | SROMRD; EMIT; csr ^= SROMCS; EMIT; @@ -1852,6 +1890,7 @@ const unsigned msb = 1 << (bitwidth + 3 - 1); unsigned lastidx = (1 << bitwidth) - 1; + mtx_assert(&Giant, MA_OWNED); tulip_srom_idle(sc); for (idx = 0; idx <= lastidx; idx++) { @@ -1901,6 +1940,7 @@ unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK); unsigned lastbit = (csr & MII_DOUT) ? msb : 0; + mtx_assert(&Giant, MA_OWNED); csr |= MII_WR; MII_EMIT; /* clock low; assert write */ for (; bits > 0; bits--, data <<= 1) { @@ -1921,6 +1961,7 @@ { unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK); + mtx_assert(&Giant, MA_OWNED); if (cmd == MII_WRCMD) { csr |= MII_DOUT; MII_EMIT; /* clock low; change data */ csr ^= MII_CLKON; MII_EMIT; /* clock high; data valid */ @@ -1941,6 +1982,7 @@ unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK); int idx; + mtx_assert(&Giant, MA_OWNED); for (idx = 0, data = 0; idx < 16; idx++) { data <<= 1; /* this is NOOP on the first pass through */ csr ^= MII_CLKON; MII_EMIT; /* clock high; data valid */ @@ -1962,6 +2004,7 @@ unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK); unsigned data; + mtx_assert(&Giant, MA_OWNED); csr &= ~(MII_RD|MII_CLK); MII_EMIT; tulip_mii_writebits(sc, MII_PREAMBLE, 32); tulip_mii_writebits(sc, MII_RDCMD, 8); @@ -1985,6 +2028,7 @@ unsigned data) { unsigned csr = TULIP_CSR_READ(sc, csr_srom_mii) & (MII_RD|MII_DOUT|MII_CLK); + mtx_assert(&Giant, MA_OWNED); csr &= ~(MII_RD|MII_CLK); MII_EMIT; tulip_mii_writebits(sc, MII_PREAMBLE, 32); tulip_mii_writebits(sc, MII_WRCMD, 8); @@ -2007,6 +2051,7 @@ tulip_identify_dec_nic( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); strcpy(sc->tulip_boardid, "DEC "); #define D0 4 if (sc->tulip_chipid <= TULIP_21040) @@ -2024,6 +2069,7 @@ tulip_softc_t * const sc) { unsigned id = 0; + mtx_assert(&Giant, MA_OWNED); strcpy(sc->tulip_boardid, "ZNYX ZX3XX "); if (sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A) { unsigned znyx_ptr; @@ -2120,6 +2166,7 @@ int auibnc = 0, utp = 0; char *cp; + mtx_assert(&Giant, MA_OWNED); strcpy(sc->tulip_boardid, "SMC "); if (sc->tulip_chipid == TULIP_21041) return; @@ -2165,6 +2212,7 @@ tulip_identify_cogent_nic( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); strcpy(sc->tulip_boardid, "Cogent "); if (sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A) { if (sc->tulip_rombuf[32] == TULIP_COGENT_EM100TX_ID) { @@ -2201,6 +2249,7 @@ tulip_identify_accton_nic( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); strcpy(sc->tulip_boardid, "ACCTON "); switch (sc->tulip_chipid) { case TULIP_21140A: @@ -2231,6 +2280,7 @@ tulip_identify_asante_nic( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); strcpy(sc->tulip_boardid, "Asante "); if ((sc->tulip_chipid == TULIP_21140 || sc->tulip_chipid == TULIP_21140A) && sc->tulip_boardsw != &tulip_2114x_isv_boardsw) { @@ -2287,6 +2337,7 @@ tulip_identify_compex_nic( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); strcpy(sc->tulip_boardid, "COMPEX "); if (sc->tulip_chipid == TULIP_21140A) { int root_unit; @@ -2335,6 +2386,7 @@ const u_int8_t *dp; u_int32_t leaf_offset, blocks, data; + mtx_assert(&Giant, MA_OWNED); for (idx1 = 0; idx1 < shp->sh_adapter_count; idx1++, saip++) { if (shp->sh_adapter_count == 1) break; @@ -2714,6 +2766,7 @@ unsigned char tmpbuf[8]; static const u_char testpat[] = { 0xFF, 0, 0x55, 0xAA, 0xFF, 0, 0x55, 0xAA }; + mtx_assert(&Giant, MA_OWNED); sc->tulip_connidx = TULIP_SROM_LASTCONNIDX; if (sc->tulip_chipid == TULIP_21040) { @@ -2914,6 +2967,7 @@ tulip_media_t media; int medias = 0; + mtx_assert(&Giant, MA_OWNED); for (media = TULIP_MEDIA_UNKNOWN; media < TULIP_MEDIA_MAX; media++) { if (sc->tulip_mediums[media] != NULL) { ifmedia_add(&sc->tulip_ifmedia, tulip_media_to_ifmedia[media], @@ -2941,6 +2995,7 @@ { tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc; + mtx_assert(&Giant, MA_OWNED); sc->tulip_flags |= TULIP_NEEDRESET; sc->tulip_probe_state = TULIP_PROBE_INACTIVE; sc->tulip_media = TULIP_MEDIA_UNKNOWN; @@ -2972,6 +3027,7 @@ { tulip_softc_t *sc = (tulip_softc_t *)ifp->if_softc; + mtx_assert(&Giant, MA_OWNED); if (sc->tulip_media == TULIP_MEDIA_UNKNOWN) return; @@ -2990,6 +3046,7 @@ u_char *addrp; int multicnt; + mtx_assert(&Giant, MA_OWNED); sc->tulip_flags &= ~(TULIP_WANTHASHPERFECT|TULIP_WANTHASHONLY|TULIP_ALLMULTI); sc->tulip_flags |= TULIP_WANTSETUP|TULIP_WANTTXSTART; sc->tulip_cmdmode &= ~TULIP_CMD_RXRUN; @@ -3136,6 +3193,7 @@ tulip_desc_t *di; u_int32_t inreset = (sc->tulip_flags & TULIP_INRESET); + mtx_assert(&Giant, MA_OWNED); /* * Brilliant. Simply brilliant. When switching modes/speeds * on a 2114*, you need to set the appriopriate MII/PCS/SCL/PS @@ -3277,6 +3335,7 @@ tulip_ifinit( void * sc) { + mtx_assert(&Giant, MA_OWNED); tulip_init((tulip_softc_t *)sc); } @@ -3284,6 +3343,7 @@ tulip_init( tulip_softc_t * const sc) { + mtx_assert(&Giant, MA_OWNED); if (sc->tulip_if.if_flags & IFF_UP) { if ((sc->tulip_if.if_flags & IFF_RUNNING) == 0) { /* initialize the media */ @@ -3335,6 +3395,7 @@ int cnt = 0; #endif + mtx_assert(&Giant, MA_OWNED); for (;;) { TULIP_PERFSTART(rxget) tulip_desc_t *eop = ri->ri_nextin; @@ -3650,6 +3711,7 @@ int xmits = 0; int descs = 0; + mtx_assert(&Giant, MA_OWNED); while (ri->ri_free < ri->ri_max) { u_int32_t d_flag; @@ -3782,6 +3844,7 @@ u_int32_t mask; const char thrsh[] = "72|128\0\0\0" "96|256\0\0\0" "128|512\0\0" "160|1024"; + mtx_assert(&Giant, MA_OWNED); csr &= (1 << (sizeof(tulip_status_bits)/sizeof(tulip_status_bits[0]))) - 1; printf("%s: abnormal interrupt:", sc->tulip_xname); for (sep = " ", mask = 1; mask <= csr; mask <<= 1, msgp++) { @@ -3810,6 +3873,7 @@ TULIP_PERFSTART(intr) u_int32_t csr; + mtx_assert(&Giant, MA_OWNED); while ((csr = TULIP_CSR_READ(sc, csr_status)) & sc->tulip_intrmask) { *progress_p = 1; TULIP_CSR_WRITE(sc, csr_status, csr); @@ -3922,6 +3986,7 @@ tulip_softc_t * const sc, int *progress_p) { + mtx_assert(&Giant, MA_OWNED); if (TULIP_CSR_READ(sc, csr_status) & (TULIP_STS_NORMALINTR|TULIP_STS_ABNRMLINTR) == 0) return; *progress_p = 1; @@ -3944,6 +4009,7 @@ int unit; int s; + mtx_assert(&Giant, MA_OWNED); /* * Copy mask to local copy and reset global one to 0. */ @@ -4005,6 +4071,7 @@ tulip_softc_t * sc = arg; int progress = 0; + mtx_assert(&Giant, MA_OWNED); for (; sc != NULL; sc = sc->tulip_slaves) { #if defined(TULIP_DEBUG) sc->tulip_dbg.dbg_intrs++; @@ -4028,6 +4095,7 @@ tulip_softc_t * sc = (tulip_softc_t *) arg; int progress = 0; + mtx_assert(&Giant, MA_OWNED); #if defined(TULIP_DEBUG) sc->tulip_dbg.dbg_intrs++; #endif @@ -4064,6 +4132,7 @@ int len = m->m_pkthdr.len; struct mbuf **mp = &m0; + mtx_assert(&Giant, MA_OWNED); while (len > 0) { if (mlen == MHLEN) { MGETHDR(*mp, M_DONTWAIT, MT_DATA); @@ -4114,6 +4183,7 @@ struct mbuf *m0; #endif + mtx_assert(&Giant, MA_OWNED); #if defined(TULIP_DEBUG) if ((sc->tulip_cmdmode & TULIP_CMD_TXRUN) == 0) { printf("%s: txput%s: tx not running\n", @@ -4435,6 +4505,7 @@ tulip_ringinfo_t * const ri = &sc->tulip_txinfo; tulip_desc_t *nextout; + mtx_assert(&Giant, MA_OWNED); /* * We will transmit, at most, one setup packet per call to ifstart. */ @@ -4534,6 +4605,7 @@ int s; int error = 0; + mtx_assert(&Giant, MA_OWNED); #if defined(TULIP_USE_SOFTINTR) s = splnet(); #else @@ -4620,6 +4692,7 @@ TULIP_PERFSTART(ifstart) tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc; + mtx_assert(&Giant, MA_OWNED); if (sc->tulip_if.if_flags & IFF_RUNNING) { if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == TULIP_WANTSETUP) @@ -4649,6 +4722,7 @@ TULIP_PERFSTART(ifstart_one) tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc; + mtx_assert(&Giant, MA_OWNED); if ((sc->tulip_if.if_flags & IFF_RUNNING) && !IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd)) { struct mbuf *m; @@ -4676,11 +4750,13 @@ #if defined(TULIP_DEBUG) u_int32_t rxintrs = sc->tulip_dbg.dbg_rxintrs - sc->tulip_dbg.dbg_last_rxintrs; + mtx_assert(&Giant, MA_OWNED); if (rxintrs > sc->tulip_dbg.dbg_high_rxintrs_hz) sc->tulip_dbg.dbg_high_rxintrs_hz = rxintrs; sc->tulip_dbg.dbg_last_rxintrs = sc->tulip_dbg.dbg_rxintrs; #endif /* TULIP_DEBUG */ + mtx_assert(&Giant, MA_OWNED); sc->tulip_if.if_timer = 1; /* * These should be rare so do a bulk test up front so we can just skip @@ -4755,6 +4831,7 @@ { struct ifnet * const ifp = &sc->tulip_if; + mtx_assert(&Giant, MA_OWNED); /* XXX: driver name/unit should be set some other way */ ifp->if_dname = "de"; ifp->if_dunit = sc->tulip_unit; @@ -4813,6 +4890,7 @@ { bus_dma_segment_t segs[1]; int nsegs, error; + mtx_assert(&Giant, MA_OWNED); error = bus_dmamem_alloc(sc->tulip_dmatag, size, 1, PAGE_SIZE, segs, sizeof(segs)/sizeof(segs[0]), &nsegs, BUS_DMA_NOWAIT); @@ -4850,6 +4928,7 @@ { int error = 0; + mtx_assert(&Giant, MA_OWNED); #if !defined(TULIP_BUS_DMA_NOTX) /* * Allocate dmamap for setup descriptor @@ -4937,6 +5016,7 @@ tulip_csrptr_t csr_base, size_t csr_size) { + mtx_assert(&Giant, MA_OWNED); sc->tulip_csrs.csr_busmode = csr_base + 0 * csr_size; sc->tulip_csrs.csr_txpoll = csr_base + 1 * csr_size; sc->tulip_csrs.csr_rxpoll = csr_base + 2 * csr_size; @@ -4962,6 +5042,7 @@ tulip_desc_t *descs, int ndescs) { + mtx_assert(&Giant, MA_OWNED); ri->ri_max = ndescs; ri->ri_first = descs; ri->ri_last = ri->ri_first + ri->ri_max; @@ -4982,6 +5063,7 @@ { const char *name = NULL; + mtx_assert(&Giant, MA_OWNED); if (pci_get_vendor(dev) != DEC_VENDORID) return ENXIO; @@ -5023,6 +5105,7 @@ tulip_shutdown(device_t dev) { tulip_softc_t * const sc = device_get_softc(dev); + mtx_assert(&Giant, MA_OWNED); TULIP_CSR_WRITE(sc, csr_busmode, TULIP_BUSMODE_SWRESET); DELAY(10); /* Wait 10 microseconds (actually 50 PCI cycles but at 33MHz that comes to two microseconds but wait a @@ -5046,6 +5129,7 @@ struct resource *res; int rid, unit; + mtx_assert(&Giant, MA_OWNED); unit = device_get_unit(dev); if (unit >= TULIP_MAX_DEVICES) {