Date: Thu, 9 Jan 2003 12:37:42 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 23502 for review Message-ID: <200301092037.h09KbgBR058163@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=23502 Change 23502 by jhb@jhb_laptop on 2003/01/09 12:37:01 IFC @23498. Affected files ... .. //depot/projects/smpng/sys/conf/files#61 integrate .. //depot/projects/smpng/sys/conf/files.powerpc#11 integrate .. //depot/projects/smpng/sys/dev/ata/ata-cbus.c#3 integrate .. //depot/projects/smpng/sys/dev/ata/ata-dma.c#26 integrate .. //depot/projects/smpng/sys/dev/ata/ata-pci.c#26 integrate .. //depot/projects/smpng/sys/dev/firewire/firewire.c#8 integrate .. //depot/projects/smpng/sys/dev/firewire/fwohci.c#7 integrate .. //depot/projects/smpng/sys/dev/gem/if_gem.c#11 integrate .. //depot/projects/smpng/sys/dev/gem/if_gem_pci.c#5 integrate .. //depot/projects/smpng/sys/dev/gem/if_gemvar.h#6 integrate .. //depot/projects/smpng/sys/dev/hme/if_hme.c#9 integrate .. //depot/projects/smpng/sys/dev/hme/if_hme_pci.c#4 integrate .. //depot/projects/smpng/sys/dev/hme/if_hme_sbus.c#3 integrate .. //depot/projects/smpng/sys/dev/hme/if_hmevar.h#4 integrate .. //depot/projects/smpng/sys/dev/mly/mly.c#12 integrate .. //depot/projects/smpng/sys/dev/sab/sab.c#6 integrate .. //depot/projects/smpng/sys/dev/sound/isa/mss.c#11 integrate .. //depot/projects/smpng/sys/dev/usb/umodem.c#13 integrate .. //depot/projects/smpng/sys/dev/usb/usb_subr.c#12 integrate .. //depot/projects/smpng/sys/dev/usb/usbcdc.h#2 integrate .. //depot/projects/smpng/sys/dev/zs/z8530reg.h#2 integrate .. //depot/projects/smpng/sys/dev/zs/z8530var.h#1 branch .. //depot/projects/smpng/sys/dev/zs/zs.c#3 integrate .. //depot/projects/smpng/sys/dev/zs/zs_sbus.c#1 branch .. //depot/projects/smpng/sys/i386/i386/identcpu.c#14 integrate .. //depot/projects/smpng/sys/i386/i386/initcpu.c#14 integrate .. //depot/projects/smpng/sys/i386/i386/locore.s#13 integrate .. //depot/projects/smpng/sys/i386/i386/machdep.c#53 integrate .. //depot/projects/smpng/sys/i386/include/md_var.h#16 integrate .. //depot/projects/smpng/sys/kern/init_sysent.c#25 integrate .. //depot/projects/smpng/sys/kern/subr_witness.c#68 integrate .. //depot/projects/smpng/sys/kern/syscalls.c#25 integrate .. //depot/projects/smpng/sys/modules/Makefile#42 integrate .. //depot/projects/smpng/sys/modules/gem/Makefile#1 branch .. //depot/projects/smpng/sys/modules/hme/Makefile#1 branch .. //depot/projects/smpng/sys/netinet6/esp_rijndael.c#2 integrate .. //depot/projects/smpng/sys/netinet6/ipcomp_core.c#4 integrate .. //depot/projects/smpng/sys/netipsec/ipsec_mbuf.c#3 integrate .. //depot/projects/smpng/sys/netkey/keydb.h#3 integrate .. //depot/projects/smpng/sys/netkey/keysock.c#12 integrate .. //depot/projects/smpng/sys/opencrypto/crypto.c#5 integrate .. //depot/projects/smpng/sys/powerpc/conf/GENERIC#13 integrate .. //depot/projects/smpng/sys/powerpc/include/bus.h#5 integrate .. //depot/projects/smpng/sys/powerpc/ofw/ofw_pci.c#2 integrate .. //depot/projects/smpng/sys/powerpc/ofw/ofw_pcib_pci.c#1 branch .. //depot/projects/smpng/sys/powerpc/powermac/ata_macio.c#2 integrate .. //depot/projects/smpng/sys/powerpc/powermac/macio.c#2 integrate .. //depot/projects/smpng/sys/powerpc/powermac/maciovar.h#2 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/autoconf.c#8 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/busdma_machdep.c#3 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/clock.c#8 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/copyinout.c#6 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/interrupt.c#3 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/machdep.c#31 integrate .. //depot/projects/smpng/sys/powerpc/powerpc/vm_machdep.c#22 integrate .. //depot/projects/smpng/sys/sparc64/include/bus.h#10 integrate .. //depot/projects/smpng/sys/sys/syscall.h#25 integrate .. //depot/projects/smpng/sys/sys/syscall.mk#25 integrate .. //depot/projects/smpng/sys/sys/sysproto.h#27 integrate .. //depot/projects/smpng/sys/ufs/ffs/fs.h#10 integrate .. //depot/projects/smpng/sys/vm/vm_page.c#27 integrate Differences ... ==== //depot/projects/smpng/sys/conf/files#61 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.743 2003/01/04 22:07:48 jake Exp $ +# $FreeBSD: src/sys/conf/files,v 1.744 2003/01/08 23:36:59 jake Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -791,7 +791,8 @@ dev/xe/if_xe.c optional xe dev/xe/if_xe_pccard.c optional xe card dev/xe/if_xe_pccard.c optional xe pccard -dev/zs/zs.c optional zs sbus +dev/zs/zs.c optional zs +dev/zs/zs_sbus.c optional zs sbus fs/deadfs/dead_vnops.c standard fs/devfs/devfs_devs.c standard fs/devfs/devfs_rule.c standard ==== //depot/projects/smpng/sys/conf/files.powerpc#11 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.powerpc,v 1.20 2002/09/19 05:11:15 grehan Exp $ +# $FreeBSD: src/sys/conf/files.powerpc,v 1.21 2003/01/09 12:04:18 benno Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -68,6 +68,7 @@ powerpc/powerpc/mp_machdep.c optional smp powerpc/ofw/ofw_pci.c optional pci +powerpc/ofw/ofw_pcib_pci.c optional pci powerpc/powermac/uninorth.c optional powermac pci powerpc/powermac/macio.c optional powermac pci ==== //depot/projects/smpng/sys/dev/ata/ata-cbus.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-cbus.c,v 1.2 2002/12/17 16:26:22 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-cbus.c,v 1.3 2003/01/09 14:00:07 sos Exp $ */ #include "opt_ata.h" @@ -60,6 +60,10 @@ int rid; u_long tmp; + /* dont probe PnP devices */ + if (isa_get_vendorid(dev)) + return (ENXIO); + /* allocate the ioport range */ rid = ATA_IOADDR_RID; io = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid, ata_pc98_ports, ==== //depot/projects/smpng/sys/dev/ata/ata-dma.c#26 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.106 2002/12/03 20:19:37 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-dma.c,v 1.109 2003/01/09 13:54:07 sos Exp $ */ #include <sys/param.h> @@ -502,6 +502,7 @@ break; case 0x01bc10de: /* nVIDIA nForce */ + case 0x006510de: /* nVIDIA nForce2 */ case 0x74411022: /* AMD 768 */ case 0x74111022: /* AMD 766 */ case 0x74091022: /* AMD 756 */ @@ -512,7 +513,8 @@ { 0x00, 0x00, 0xea, 0x00, 0xe8, 0x00, 0x00 }, /* VIA ATA66 */ { 0x00, 0x00, 0xf4, 0x00, 0xf1, 0xf0, 0x00 }, /* VIA ATA100 */ { 0x00, 0x00, 0xf6, 0x00, 0xf2, 0xf1, 0xf0 }, /* VIA ATA133 */ - { 0x00, 0x00, 0xc0, 0x00, 0xc5, 0xc6, 0x00 }}; /* AMD/nVIDIA */ + { 0x00, 0x00, 0xc0, 0x00, 0xc5, 0xc6, 0xc7 }}; /* AMD/nVIDIA */ + int reg = 0x53 - devno; int *reg_val = NULL; char *chip = "VIA"; @@ -553,14 +555,24 @@ reg_val = via_modes[4]; chip = "AMD"; } - else if (chiptype == 0x01bc10de) { /* nVIDIA */ + else if (chiptype == 0x006510de) { /* nForce2 */ + udmamode = imin(udmamode, 6); + reg += 0x10; + reg_val = via_modes[4]; + chip = "nVidia"; + } + else if (chiptype == 0x01bc10de) { /* nForce */ udmamode = imin(udmamode, 5); + reg += 0x10; reg_val = via_modes[4]; - chip = "nVIDIA"; + chip = "nVidia"; } else udmamode = 0; + if (udmamode || wdmamode) + pci_write_config(parent, reg - 0x08, 0x20, 1); + if (udmamode >= 6) { error = ata_command(atadev, ATA_C_SETFEATURES, 0, ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY); @@ -568,7 +580,7 @@ ata_prtdev(atadev, "%s setting UDMA6 on %s chip\n", (error) ? "failed" : "success", chip); if (!error) { - pci_write_config(parent, 0x53 - devno, reg_val[6], 1); + pci_write_config(parent, reg, reg_val[6], 1); ata_dmacreate(atadev, apiomode, ATA_UDMA6); return; } @@ -580,7 +592,7 @@ ata_prtdev(atadev, "%s setting UDMA5 on %s chip\n", (error) ? "failed" : "success", chip); if (!error) { - pci_write_config(parent, 0x53 - devno, reg_val[5], 1); + pci_write_config(parent, reg, reg_val[5], 1); ata_dmacreate(atadev, apiomode, ATA_UDMA5); return; } @@ -592,7 +604,7 @@ ata_prtdev(atadev, "%s setting UDMA4 on %s chip\n", (error) ? "failed" : "success", chip); if (!error) { - pci_write_config(parent, 0x53 - devno, reg_val[4], 1); + pci_write_config(parent, reg, reg_val[4], 1); ata_dmacreate(atadev, apiomode, ATA_UDMA4); return; } @@ -604,7 +616,7 @@ ata_prtdev(atadev, "%s setting UDMA2 on %s chip\n", (error) ? "failed" : "success", chip); if (!error) { - pci_write_config(parent, 0x53 - devno, reg_val[2], 1); + pci_write_config(parent, reg, reg_val[2], 1); ata_dmacreate(atadev, apiomode, ATA_UDMA2); return; } @@ -616,8 +628,8 @@ ata_prtdev(atadev, "%s setting WDMA2 on %s chip\n", (error) ? "failed" : "success", chip); if (!error) { - pci_write_config(parent, 0x53 - devno, 0x0b, 1); - pci_write_config(parent, 0x4b - devno, 0x31, 1); + pci_write_config(parent, reg, 0x0b, 1); + pci_write_config(parent, reg - 0x08, 0x31, 1); ata_dmacreate(atadev, apiomode, ATA_WDMA2); return; } @@ -1325,7 +1337,7 @@ } if (udmamode >= 2) { error = ata_command(atadev, ATA_C_SETFEATURES, 0, - ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY); + ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY); if (bootverbose) ata_prtdev(atadev, "%s setting up UDMA2 mode on Acard chip\n", (error) ? "failed" : "success"); @@ -1510,6 +1522,19 @@ if (ds->flags & ATA_DS_ACTIVE) panic("ata_dmasetup: transfer active on this device!"); + switch(ch->chiptype) { + case 0x0d38105a: /* Promise Fasttrak 66 */ + case 0x4d38105a: /* Promise Ultra/Fasttrak 66 */ + case 0x0d30105a: /* Promise OEM ATA 100 */ + case 0x4d30105a: /* Promise Ultra/Fasttrak 100 */ + ATA_OUTB(ch->r_bmio, 0x11, + ATA_INB(ch->r_bmio, 0x11) | (atadev->unit ? 0x08 : 0x02)); + + ATA_OUTL(ch->r_bmio, (atadev->unit ? 0x24 : 0x20), + (dir ? 0x05000000 : 0x06000000) | (count >> 1)); + break; + } + cba.dmatab = ds->dmatab; bus_dmamap_sync(ds->cdmatag, ds->cdmamap, BUS_DMASYNC_PREWRITE); if (bus_dmamap_load(ds->ddmatag, ds->ddmamap, data, count, @@ -1521,33 +1546,40 @@ BUS_DMASYNC_PREWRITE); ch->flags |= ATA_DMA_ACTIVE; - ds->flags = ATA_DS_ACTIVE; - if (dir) - ds->flags |= ATA_DS_READ; + ds->flags = dir ? (ATA_DS_ACTIVE | ATA_DS_READ) : ATA_DS_ACTIVE; ATA_OUTL(ch->r_bmio, ATA_BMDTP_PORT, ds->mdmatab); ATA_OUTB(ch->r_bmio, ATA_BMCMD_PORT, dir ? ATA_BMCMD_WRITE_READ : 0); ATA_OUTB(ch->r_bmio, ATA_BMSTAT_PORT, - (ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) | - (ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR))); + (ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT) | + (ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR))); ATA_OUTB(ch->r_bmio, ATA_BMCMD_PORT, - ATA_INB(ch->r_bmio, ATA_BMCMD_PORT) | ATA_BMCMD_START_STOP); + ATA_INB(ch->r_bmio, ATA_BMCMD_PORT) | ATA_BMCMD_START_STOP); return 0; } int ata_dmadone(struct ata_device *atadev) { - struct ata_channel *ch; - struct ata_dmastate *ds; + struct ata_channel *ch = atadev->channel; + struct ata_dmastate *ds = &atadev->dmastate; int error; - ch = atadev->channel; - ds = &atadev->dmastate; + switch(ch->chiptype) { + case 0x0d38105a: /* Promise Fasttrak 66 */ + case 0x4d38105a: /* Promise Ultra/Fasttrak 66 */ + case 0x0d30105a: /* Promise OEM ATA 100 */ + case 0x4d30105a: /* Promise Ultra/Fasttrak 100 */ + ATA_OUTL(ch->r_bmio, (atadev->unit ? 0x24 : 0x20), 0); + ATA_OUTB(ch->r_bmio, 0x11, + ATA_INB(ch->r_bmio, 0x11) & ~(atadev->unit ? 0x08 : 0x02)); + break; + } + bus_dmamap_sync(ds->ddmatag, ds->ddmamap, (ds->flags & ATA_DS_READ) != 0 ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ds->ddmatag, ds->ddmamap); - + ATA_OUTB(ch->r_bmio, ATA_BMCMD_PORT, ATA_INB(ch->r_bmio, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP); error = ATA_INB(ch->r_bmio, ATA_BMSTAT_PORT); ==== //depot/projects/smpng/sys/dev/ata/ata-pci.c#26 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.51 2002/12/03 20:19:37 sos Exp $ + * $FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.53 2003/01/08 17:44:36 sos Exp $ */ #include "opt_ata.h" @@ -234,7 +234,10 @@ return "AMD 768 ATA100 controller"; case 0x01bc10de: - return "nVIDIA nForce ATA100 controller"; + return "nVidia nForce ATA100 controller"; + + case 0x006510de: + return "nVidia nForce ATA133 controller"; case 0x02111166: return "ServerWorks ROSB4 ATA33 controller"; @@ -284,10 +287,22 @@ } return "Promise TX2 ATA100 controller"; + case 0x5275105a: + case 0x7275105a: + { + uintptr_t devid = 0; + + /* if we are on a SuperTrak SX6000 dont attach */ + if (!BUS_READ_IVAR(device_get_parent(GRANDPARENT(dev)), + GRANDPARENT(dev), PCI_IVAR_DEVID, &devid) && + devid == 0x09628086 && + pci_get_class(GRANDPARENT(dev)) == PCIC_BRIDGE) + break; + } + /* FALLTHROUGH */ + case 0x4d69105a: - case 0x5275105a: case 0x6269105a: - case 0x7275105a: return "Promise TX2 ATA133 controller"; case 0x00041103: ==== //depot/projects/smpng/sys/dev/firewire/firewire.c#8 (text+ko) ==== @@ -30,7 +30,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.17 2003/01/07 04:26:45 simokawa Exp $ + * $FreeBSD: src/sys/dev/firewire/firewire.c,v 1.18 2003/01/09 10:25:07 simokawa Exp $ * */ @@ -289,6 +289,7 @@ STAILQ_REMOVE_HEAD(&ir->stfree, link); } }else{ + device_printf(fc->bdev, "no free chunk available\n"); bulkxfer = STAILQ_FIRST(&ir->stvalid); STAILQ_REMOVE_HEAD(&ir->stvalid, link); } ==== //depot/projects/smpng/sys/dev/firewire/fwohci.c#7 (text+ko) ==== @@ -30,7 +30,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/fwohci.c,v 1.15 2003/01/05 14:58:45 simokawa Exp $ + * $FreeBSD: src/sys/dev/firewire/fwohci.c,v 1.16 2003/01/09 10:25:07 simokawa Exp $ * */ @@ -1485,11 +1485,12 @@ struct fwohci_softc *sc = (struct fwohci_softc *)fc; int err = 0; unsigned short tag, ich; - tag = (sc->ir[dmach].xferq.flag >> 6) & 3; - ich = sc->ir[dmach].xferq.flag & 0x3f; - OWRITE(sc, OHCI_IRMATCH(dmach), tagbit[tag] | ich); if(!(sc->ir[dmach].xferq.flag & FWXFERQ_RUNNING)){ + tag = (sc->ir[dmach].xferq.flag >> 6) & 3; + ich = sc->ir[dmach].xferq.flag & 0x3f; + OWRITE(sc, OHCI_IRMATCH(dmach), tagbit[tag] | ich); + sc->ir[dmach].xferq.queued = 0; sc->ir[dmach].ndb = sc->ir[dmach].xferq.bnpacket * sc->ir[dmach].xferq.bnchunk; @@ -1539,8 +1540,8 @@ OWRITE(sc, OHCI_IRCMD(dmach), vtophys(((struct fwohcidb_tr *)(sc->ir[dmach].xferq.stdma->start))->db) | sc->ir[dmach].ndesc); OWRITE(sc, OHCI_IRCTL(dmach), OHCI_CNTL_DMA_RUN); + OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_DMA_IR); } - OWRITE(sc, FWOHCI_INTMASK, OHCI_INT_DMA_IR); return err; } @@ -1922,6 +1923,7 @@ fwohci_irx_enable(&sc->fc, dmach); break; default: + device_printf(sc->fc.dev, "Isochronous receive err %02x\n", stat); break; } } ==== //depot/projects/smpng/sys/dev/gem/if_gem.c#11 (text+ko) ==== @@ -26,7 +26,7 @@ * * from: NetBSD: gem.c,v 1.21 2002/06/01 23:50:58 lukem Exp * - * $FreeBSD: src/sys/dev/gem/if_gem.c,v 1.11 2003/01/06 22:09:01 tmm Exp $ + * $FreeBSD: src/sys/dev/gem/if_gem.c,v 1.12 2003/01/08 20:12:45 tmm Exp $ */ /* @@ -350,6 +350,55 @@ return (error); } +void +gem_detach(sc) + struct gem_softc *sc; +{ + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + int i; + + ether_ifdetach(ifp); + gem_stop(ifp, 1); + device_delete_child(sc->sc_dev, sc->sc_miibus); + + for (i = 0; i < GEM_NRXDESC; i++) { + if (sc->sc_rxsoft[i].rxs_dmamap != NULL) + bus_dmamap_destroy(sc->sc_rdmatag, + sc->sc_rxsoft[i].rxs_dmamap); + } + for (i = 0; i < GEM_TXQUEUELEN; i++) { + if (sc->sc_txsoft[i].txs_dmamap != NULL) + bus_dmamap_destroy(sc->sc_tdmatag, + sc->sc_txsoft[i].txs_dmamap); + } + bus_dmamap_unload(sc->sc_cdmatag, sc->sc_cddmamap); + bus_dmamem_free(sc->sc_cdmatag, sc->sc_control_data, + sc->sc_cddmamap); + bus_dma_tag_destroy(sc->sc_cdmatag); + bus_dma_tag_destroy(sc->sc_tdmatag); + bus_dma_tag_destroy(sc->sc_rdmatag); + bus_dma_tag_destroy(sc->sc_pdmatag); +} + +void +gem_suspend(sc) + struct gem_softc *sc; +{ + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + + gem_stop(ifp, 0); +} + +void +gem_resume(sc) + struct gem_softc *sc; +{ + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + + if (ifp->if_flags & IFF_UP) + gem_init(ifp); +} + static void gem_cddma_callback(xsc, segs, nsegs, error) void *xsc; @@ -1833,43 +1882,3 @@ chipit: bus_space_write_4(t, h, GEM_MAC_RX_CONFIG, v); } - -#if notyet - -/* - * gem_power: - * - * Power management (suspend/resume) hook. - */ -void -static gem_power(why, arg) - int why; - void *arg; -{ - struct gem_softc *sc = arg; - struct ifnet *ifp = &sc->sc_arpcom.ac_if; - int s; - - s = splnet(); - switch (why) { - case PWR_SUSPEND: - case PWR_STANDBY: - gem_stop(ifp, 1); - if (sc->sc_power != NULL) - (*sc->sc_power)(sc, why); - break; - case PWR_RESUME: - if (ifp->if_flags & IFF_UP) { - if (sc->sc_power != NULL) - (*sc->sc_power)(sc, why); - gem_init(ifp); - } - break; - case PWR_SOFTSUSPEND: - case PWR_SOFTSTANDBY: - case PWR_SOFTRESUME: - break; - } - splx(s); -} -#endif ==== //depot/projects/smpng/sys/dev/gem/if_gem_pci.c#5 (text+ko) ==== @@ -26,7 +26,7 @@ * * from: NetBSD: if_gem_pci.c,v 1.7 2001/10/18 15:09:15 thorpej Exp * - * $FreeBSD: src/sys/dev/gem/if_gem_pci.c,v 1.5 2002/07/10 10:24:23 benno Exp $ + * $FreeBSD: src/sys/dev/gem/if_gem_pci.c,v 1.6 2003/01/08 20:12:45 tmm Exp $ */ /* @@ -77,12 +77,19 @@ static int gem_pci_probe(device_t); static int gem_pci_attach(device_t); - +static int gem_pci_detach(device_t); +static int gem_pci_suspend(device_t); +static int gem_pci_resume(device_t); static device_method_t gem_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, gem_pci_probe), DEVMETHOD(device_attach, gem_pci_attach), + DEVMETHOD(device_detach, gem_pci_detach), + DEVMETHOD(device_suspend, gem_pci_suspend), + DEVMETHOD(device_resume, gem_pci_resume), + /* Use the suspend handler here, it is all that is required. */ + DEVMETHOD(device_shutdown, gem_pci_suspend), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), @@ -202,3 +209,40 @@ bus_release_resource(dev, SYS_RES_MEMORY, gsc->gsc_srid, gsc->gsc_sres); return (ENXIO); } + +static int +gem_pci_detach(dev) + device_t dev; +{ + struct gem_pci_softc *gsc = device_get_softc(dev); + struct gem_softc *sc = &gsc->gsc_gem; + + gem_detach(sc); + + bus_teardown_intr(dev, gsc->gsc_ires, gsc->gsc_ih); + bus_release_resource(dev, SYS_RES_IRQ, gsc->gsc_irid, gsc->gsc_ires); + bus_release_resource(dev, SYS_RES_MEMORY, gsc->gsc_srid, gsc->gsc_sres); + return (0); +} + +static int +gem_pci_suspend(dev) + device_t dev; +{ + struct gem_pci_softc *gsc = device_get_softc(dev); + struct gem_softc *sc = &gsc->gsc_gem; + + gem_suspend(sc); + return (0); +} + +static int +gem_pci_resume(dev) + device_t dev; +{ + struct gem_pci_softc *gsc = device_get_softc(dev); + struct gem_softc *sc = &gsc->gsc_gem; + + gem_resume(sc); + return (0); +} ==== //depot/projects/smpng/sys/dev/gem/if_gemvar.h#6 (text+ko) ==== @@ -25,7 +25,7 @@ * * from: NetBSD: gemvar.h,v 1.8 2002/05/15 02:36:12 matt Exp * - * $FreeBSD: src/sys/dev/gem/if_gemvar.h,v 1.5 2003/01/06 22:09:01 tmm Exp $ + * $FreeBSD: src/sys/dev/gem/if_gemvar.h,v 1.6 2003/01/08 20:12:45 tmm Exp $ */ #ifndef _IF_GEMVAR_H @@ -219,7 +219,9 @@ extern devclass_t gem_devclass; int gem_attach(struct gem_softc *); -int gem_detach(struct gem_softc *); +void gem_detach(struct gem_softc *); +void gem_suspend(struct gem_softc *); +void gem_resume(struct gem_softc *); void gem_intr(void *); int gem_mediachange(struct ifnet *); ==== //depot/projects/smpng/sys/dev/hme/if_hme.c#9 (text+ko) ==== @@ -36,7 +36,7 @@ * * from: NetBSD: hme.c,v 1.20 2000/12/14 06:27:25 thorpej Exp * - * $FreeBSD: src/sys/dev/hme/if_hme.c,v 1.8 2003/01/06 22:12:57 tmm Exp $ + * $FreeBSD: src/sys/dev/hme/if_hme.c,v 1.10 2003/01/09 00:45:10 tmm Exp $ */ /* @@ -90,9 +90,6 @@ static int hme_ioctl(struct ifnet *, u_long, caddr_t); static void hme_tick(void *); static void hme_watchdog(struct ifnet *); -#if 0 -static void hme_shutdown(void *); -#endif static void hme_init(void *); static int hme_add_rxbuf(struct hme_softc *, unsigned int, int); static int hme_meminit(struct hme_softc *); @@ -122,7 +119,7 @@ static int hme_nerr; DRIVER_MODULE(miibus, hme, miibus_driver, miibus_devclass, 0, 0); -MODULE_DEPEND(hem, miibus, 1, 1, 1); +MODULE_DEPEND(hme, miibus, 1, 1, 1); #define HME_SPC_READ_4(spc, sc, offs) \ bus_space_read_4((sc)->sc_ ## spc ## t, (sc)->sc_ ## spc ## h, \ @@ -345,6 +342,49 @@ return (error); } +void +hme_detach(struct hme_softc *sc) +{ + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + int i; + + ether_ifdetach(ifp); + hme_stop(sc); + device_delete_child(sc->sc_dev, sc->sc_miibus); + + for (i = 0; i < HME_NTXQ; i++) { + bus_dmamap_destroy(sc->sc_tdmatag, + sc->sc_rb.rb_txdesc[i].htx_dmamap); + } + bus_dmamap_destroy(sc->sc_rdmatag, sc->sc_rb.rb_spare_dmamap); + for (i = 0; i < HME_NRXDESC; i++) { + bus_dmamap_destroy(sc->sc_rdmatag, + sc->sc_rb.rb_rxdesc[i].hrx_dmamap); + } + bus_dmamap_unload(sc->sc_cdmatag, sc->sc_cdmamap); + bus_dmamem_free(sc->sc_cdmatag, sc->sc_rb.rb_membase, sc->sc_cdmamap); + bus_dma_tag_destroy(sc->sc_tdmatag); + bus_dma_tag_destroy(sc->sc_rdmatag); + bus_dma_tag_destroy(sc->sc_cdmatag); + bus_dma_tag_destroy(sc->sc_pdmatag); +} + +void +hme_suspend(struct hme_softc *sc) +{ + + hme_stop(sc); +} + +void +hme_resume(struct hme_softc *sc) +{ + struct ifnet *ifp = &sc->sc_arpcom.ac_if; + + if ((ifp->if_flags & IFF_UP) != 0) + hme_init(ifp); +} + static void hme_cdma_callback(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) { @@ -1342,15 +1382,6 @@ return (error); } -#if 0 -static void -hme_shutdown(void *arg) -{ - - hme_stop((struct hme_softc *)arg); -} -#endif - /* * Set up the logical address filter. */ ==== //depot/projects/smpng/sys/dev/hme/if_hme_pci.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ * * from: NetBSD: if_hme_pci.c,v 1.4 2001/08/27 22:18:49 augustss Exp * - * $FreeBSD: src/sys/dev/hme/if_hme_pci.c,v 1.3 2002/03/23 19:37:11 tmm Exp $ + * $FreeBSD: src/sys/dev/hme/if_hme_pci.c,v 1.4 2003/01/09 00:45:10 tmm Exp $ */ /* @@ -77,11 +77,19 @@ static int hme_pci_probe(device_t); static int hme_pci_attach(device_t); +static int hme_pci_detach(device_t); +static int hme_pci_suspend(device_t); +static int hme_pci_resume(device_t); static device_method_t hme_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, hme_pci_probe), DEVMETHOD(device_attach, hme_pci_attach), + DEVMETHOD(device_detach, hme_pci_detach), + DEVMETHOD(device_suspend, hme_pci_suspend), + DEVMETHOD(device_resume, hme_pci_resume), + /* Can just use the suspend method here. */ + DEVMETHOD(device_shutdown, hme_pci_suspend), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), @@ -182,6 +190,7 @@ if ((error = bus_setup_intr(dev, hsc->hsc_ires, INTR_TYPE_NET, hme_intr, sc, &hsc->hsc_ih)) != 0) { device_printf(dev, "couldn't establish interrupt\n"); + hme_detach(sc); goto fail_ires; } return (0); @@ -192,3 +201,37 @@ bus_release_resource(dev, SYS_RES_MEMORY, hsc->hsc_srid, hsc->hsc_sres); return (ENXIO); } + +static int +hme_pci_detach(device_t dev) +{ + struct hme_pci_softc *hsc = device_get_softc(dev); + struct hme_softc *sc = &hsc->hsc_hme; + + hme_detach(sc); + + bus_teardown_intr(dev, hsc->hsc_ires, hsc->hsc_ih); + bus_release_resource(dev, SYS_RES_IRQ, hsc->hsc_irid, hsc->hsc_ires); + bus_release_resource(dev, SYS_RES_MEMORY, hsc->hsc_srid, hsc->hsc_sres); + return (0); +} + +static int +hme_pci_suspend(device_t dev) +{ + struct hme_pci_softc *hsc = device_get_softc(dev); + struct hme_softc *sc = &hsc->hsc_hme; + + hme_suspend(sc); + return (0); +} + +static int +hme_pci_resume(device_t dev) +{ + struct hme_pci_softc *hsc = device_get_softc(dev); + struct hme_softc *sc = &hsc->hsc_hme; + + hme_resume(sc); + return (0); +} ==== //depot/projects/smpng/sys/dev/hme/if_hme_sbus.c#3 (text+ko) ==== @@ -35,7 +35,7 @@ * * from: NetBSD: if_hme_sbus.c,v 1.9 2001/11/13 06:58:17 lukem Exp * - * $FreeBSD: src/sys/dev/hme/if_hme_sbus.c,v 1.2 2002/03/23 19:37:11 tmm Exp $ + * $FreeBSD: src/sys/dev/hme/if_hme_sbus.c,v 1.3 2003/01/09 00:45:10 tmm Exp $ */ /* @@ -92,11 +92,19 @@ static int hme_sbus_probe(device_t); static int hme_sbus_attach(device_t); +static int hme_sbus_detach(device_t); +static int hme_sbus_suspend(device_t); +static int hme_sbus_resume(device_t); static device_method_t hme_sbus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, hme_sbus_probe), DEVMETHOD(device_attach, hme_sbus_attach), + DEVMETHOD(device_detach, hme_sbus_detach), + DEVMETHOD(device_suspend, hme_sbus_suspend), + DEVMETHOD(device_resume, hme_sbus_resume), + /* Can just use the suspend method here. */ + DEVMETHOD(device_shutdown, hme_sbus_suspend), /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), @@ -249,6 +257,7 @@ if ((error = bus_setup_intr(dev, hsc->hsc_ires, INTR_TYPE_NET, hme_intr, sc, &hsc->hsc_ih)) != 0) { device_printf(dev, "couldn't establish interrupt\n"); + hme_detach(sc); goto fail_ires; } return (0); @@ -274,3 +283,47 @@ hsc->hsc_seb_res); return (ENXIO); } + +static int +hme_sbus_detach(device_t dev) +{ + struct hme_sbus_softc *hsc = device_get_softc(dev); + struct hme_softc *sc = &hsc->hsc_hme; + + hme_detach(sc); + + bus_teardown_intr(dev, hsc->hsc_ires, hsc->hsc_ih); + if (hsc->hsc_mif_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, hsc->hsc_mif_rid, + hsc->hsc_mif_res); + } + bus_release_resource(dev, SYS_RES_MEMORY, hsc->hsc_mac_rid, + hsc->hsc_mac_res); + bus_release_resource(dev, SYS_RES_MEMORY, hsc->hsc_erx_rid, + hsc->hsc_erx_res); + bus_release_resource(dev, SYS_RES_MEMORY, hsc->hsc_etx_rid, + hsc->hsc_etx_res); + bus_release_resource(dev, SYS_RES_MEMORY, hsc->hsc_seb_rid, + hsc->hsc_seb_res); + return (0); +} + +static int +hme_sbus_suspend(device_t dev) +{ + struct hme_sbus_softc *hsc = device_get_softc(dev); + struct hme_softc *sc = &hsc->hsc_hme; + + hme_suspend(sc); + return (0); +} + +static int +hme_sbus_resume(device_t dev) +{ + struct hme_sbus_softc *hsc = device_get_softc(dev); + struct hme_softc *sc = &hsc->hsc_hme; + + hme_resume(sc); + return (0); +} ==== //depot/projects/smpng/sys/dev/hme/if_hmevar.h#4 (text+ko) ==== @@ -35,7 +35,7 @@ * * from: NetBSD: hmevar.h,v 1.5 2000/06/25 01:10:04 eeh Exp * - * $FreeBSD: src/sys/dev/hme/if_hmevar.h,v 1.3 2003/01/06 22:12:57 tmm Exp $ + * $FreeBSD: src/sys/dev/hme/if_hmevar.h,v 1.4 2003/01/09 00:45:10 tmm Exp $ */ #include <sys/callout.h> @@ -150,6 +150,9 @@ extern devclass_t hme_devclass; int hme_config(struct hme_softc *); +void hme_detach(struct hme_softc *); +void hme_suspend(struct hme_softc *); +void hme_resume(struct hme_softc *); void hme_intr(void *); /* MII methods & callbacks */ ==== //depot/projects/smpng/sys/dev/mly/mly.c#12 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/mly/mly.c,v 1.17 2002/11/14 13:25:53 mux Exp $ + * $FreeBSD: src/sys/dev/mly/mly.c,v 1.18 2003/01/08 06:30:34 scottl Exp $ */ #include <sys/param.h> @@ -685,6 +685,9 @@ debug_called(1); + /* Remove the management device */ + destroy_dev(sc->mly_dev_t); + /* detach from CAM */ mly_cam_detach(sc); ==== //depot/projects/smpng/sys/dev/sab/sab.c#6 (text+ko) ==== @@ -34,7 +34,7 @@ * Agency (DARPA) and Air Force Research Laboratory, Air Force * Materiel Command, USAF, under agreement number F30602-01-2-0537. * - * $FreeBSD: src/sys/dev/sab/sab.c,v 1.8 2003/01/05 04:07:31 jake Exp $ + * $FreeBSD: src/sys/dev/sab/sab.c,v 1.9 2003/01/08 04:30:30 jake Exp $ */ /* @@ -446,12 +446,14 @@ case 0: /* port A */ sc->sc_pvr_dtr = SAB_PVR_DTR_A; sc->sc_pvr_dsr = SAB_PVR_DSR_A; - sc->sc_bh = sc->sc_parent->sc_bh + SAB_CHAN_A; + bus_space_subregion(sc->sc_bt, sc->sc_parent->sc_bh, + SAB_CHAN_A, SAB_CHANLEN, &sc->sc_bh); break; case 1: /* port B */ sc->sc_pvr_dtr = SAB_PVR_DTR_B; sc->sc_pvr_dsr = SAB_PVR_DSR_B; - sc->sc_bh = sc->sc_parent->sc_bh + SAB_CHAN_B; + bus_space_subregion(sc->sc_bt, sc->sc_parent->sc_bh, + SAB_CHAN_B, SAB_CHANLEN, &sc->sc_bh); break; default: return (ENXIO); ==== //depot/projects/smpng/sys/dev/sound/isa/mss.c#11 (text+ko) ==== @@ -29,7 +29,7 @@ #include <dev/sound/pcm/sound.h> -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.81 2003/01/01 18:48:51 schweikh Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.82 2003/01/08 06:24:25 mdodd Exp $"); /* board-specific include files */ #include <dev/sound/isa/mss.h> @@ -158,6 +158,7 @@ #define MD_AD1848 0x91 #define MD_AD1845 0x92 #define MD_CS42XX 0xA1 +#define MD_CS423X 0xA2 #define MD_OPTI930 0xB0 #define MD_OPTI931 0xB1 #define MD_OPTI925 0xB2 @@ -1807,8 +1808,7 @@ mss = pcm_getdevinfo(dev); >>> TRUNCATED FOR MAIL (1000 lines) <<< To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301092037.h09KbgBR058163>
