From owner-p4-projects@FreeBSD.ORG Wed Apr 23 11:06:07 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E16C437B404; Wed, 23 Apr 2003 11:06:06 -0700 (PDT) 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 73FBC37B401 for ; Wed, 23 Apr 2003 11:06:06 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CFC543FCB for ; Wed, 23 Apr 2003 11:06:05 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h3NI640U031338 for ; Wed, 23 Apr 2003 11:06:04 -0700 (PDT) (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h3NI64JC031329 for perforce@freebsd.org; Wed, 23 Apr 2003 11:06:04 -0700 (PDT) Date: Wed, 23 Apr 2003 11:06:04 -0700 (PDT) Message-Id: <200304231806.h3NI64JC031329@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 29510 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: Wed, 23 Apr 2003 18:06:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=29510 Change 29510 by jhb@jhb_laptop on 2003/04/23 11:05:05 IFC @29509. Affected files ... .. //depot/projects/smpng/sys/dev/ar/if_ar.c#8 integrate .. //depot/projects/smpng/sys/dev/ar/if_ar_isa.c#4 integrate .. //depot/projects/smpng/sys/dev/ar/if_ar_pci.c#3 integrate .. //depot/projects/smpng/sys/dev/ar/if_arregs.h#3 integrate .. //depot/projects/smpng/sys/dev/pci/pcireg.h#3 integrate .. //depot/projects/smpng/sys/dev/sound/pcm/ac97.c#17 integrate .. //depot/projects/smpng/sys/geom/geom.h#25 integrate .. //depot/projects/smpng/sys/geom/geom_ctl.c#9 integrate .. //depot/projects/smpng/sys/geom/geom_ctl.h#4 integrate .. //depot/projects/smpng/sys/geom/geom_slice.c#19 integrate .. //depot/projects/smpng/sys/geom/geom_subr.c#24 integrate .. //depot/projects/smpng/sys/geom/geom_sunlabel.c#19 integrate .. //depot/projects/smpng/sys/kern/vfs_mount.c#12 integrate .. //depot/projects/smpng/sys/nfsclient/nfs_vnops.c#27 integrate .. //depot/projects/smpng/sys/sys/sun_disklabel.h#4 integrate Differences ... ==== //depot/projects/smpng/sys/dev/ar/if_ar.c#8 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ar/if_ar.c,v 1.57 2003/02/23 13:20:42 nyan Exp $ + * $FreeBSD: src/sys/dev/ar/if_ar.c,v 1.58 2003/04/23 15:40:11 jhay Exp $ */ /* @@ -346,7 +346,7 @@ } if(hc->bustype == AR_BUS_ISA) - ARC_SET_OFF(hc->iobase); + ARC_SET_OFF(hc); return (0); } @@ -386,6 +386,9 @@ if (hc->res_ioport == NULL) { goto errexit; } + hc->bt = rman_get_bustag(hc->res_ioport); + hc->bh = rman_get_bushandle(hc->res_ioport); + return (0); errexit: @@ -501,7 +504,7 @@ if(hc->bustype == AR_BUS_PCI) arisr = hc->orbase[AR_ISTAT * 4]; else - arisr = inb(hc->iobase + AR_ISTAT); + arisr = ar_inb(hc, AR_ISTAT); while(arisr & AR_BD_INT) { TRC(printf("arisr = %x\n", arisr)); @@ -518,7 +521,7 @@ sca = hc->sca[scano]; if(hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(hc->iobase, scano); + ARC_SET_SCA(hc, scano); isr0 = sca->isr0; isr1 = sca->isr1; @@ -548,12 +551,12 @@ if(hc->bustype == AR_BUS_PCI) arisr = hc->orbase[AR_ISTAT * 4]; else - arisr = inb(hc->iobase + AR_ISTAT); + arisr = ar_inb(hc, AR_ISTAT); } } if(hc->bustype == AR_BUS_ISA) - ARC_SET_OFF(hc->iobase); + ARC_SET_OFF(hc); } @@ -576,7 +579,7 @@ dmac = &sc->sca->dmac[DMAC_TXCH(sc->scachan)]; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); dmac->cda = (u_short)(sc->block[sc->txb_next_tx].txdesc & 0xffff); dmac->eda = (u_short)(sc->block[sc->txb_next_tx].txeda & 0xffff); @@ -594,7 +597,7 @@ sc->out_dog = DOG_HOLDOFF; /* give ourself some breathing space*/ #endif /* NETGRAPH */ if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_OFF(sc->hc->iobase); + ARC_SET_OFF(sc->hc); } /* @@ -665,7 +668,7 @@ * 16K window. */ if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_MEM(sc->hc->iobase, sc->block[0].txdesc); + ARC_SET_MEM(sc->hc, sc->block[0].txdesc); /* * We stay in this loop until there is nothing in the @@ -760,7 +763,7 @@ ar_xmit(sc); if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_OFF(sc->hc->iobase); + ARC_SET_OFF(sc->hc); goto top_arstart; } @@ -829,7 +832,7 @@ #endif /* NETGRAPH */ if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); /* XXX if(sc->ifsppp.pp_if.if_flags & IFF_DEBUG) */ printf("ar%d: transmit failed, " @@ -881,7 +884,7 @@ * Enable interrupts. */ if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); /* XXX * What about using AUTO mode in msci->md0 ??? @@ -896,7 +899,7 @@ sc->hc->orbase[sc->hc->txc_dtr_off[sc->scano]] = sc->hc->txc_dtr[sc->scano]; else - outb(sc->hc->iobase + sc->hc->txc_dtr_off[sc->scano], + ar_outb(sc->hc, sc->hc->txc_dtr_off[sc->scano], sc->hc->txc_dtr[sc->scano]); } @@ -910,11 +913,11 @@ msci->cmd = SCA_CMD_RXENABLE; if(sc->hc->bustype == AR_BUS_ISA) - inb(sc->hc->iobase + AR_ID_5); /* XXX slow it down a bit. */ + ar_inb(sc->hc, AR_ID_5); /* XXX slow it down a bit. */ msci->cmd = SCA_CMD_TXENABLE; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_OFF(sc->hc->iobase); + ARC_SET_OFF(sc->hc); #ifdef NETGRAPH untimeout(ngar_watchdog_frame, sc, sc->handle); sc->handle = timeout(ngar_watchdog_frame, sc, hz); @@ -941,10 +944,10 @@ * Disable interrupts. */ if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); msci->cmd = SCA_CMD_RXDISABLE; if(sc->hc->bustype == AR_BUS_ISA) - inb(sc->hc->iobase + AR_ID_5); /* XXX slow it down a bit. */ + ar_inb(sc->hc, AR_ID_5); /* XXX slow it down a bit. */ msci->cmd = SCA_CMD_TXDISABLE; if(sc->hc->handshake & AR_SHSK_RTS) @@ -956,7 +959,7 @@ sc->hc->orbase[sc->hc->txc_dtr_off[sc->scano]] = sc->hc->txc_dtr[sc->scano]; else - outb(sc->hc->iobase + sc->hc->txc_dtr_off[sc->scano], + ar_outb(sc->hc, sc->hc->txc_dtr_off[sc->scano], sc->hc->txc_dtr[sc->scano]); } @@ -969,7 +972,7 @@ } if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_OFF(sc->hc->iobase); + ARC_SET_OFF(sc->hc); } static int @@ -1078,6 +1081,7 @@ u_int next; u_int descneeded; u_char isr, mar; + u_long memst; MALLOC(sc, struct ar_softc *, hc->numports * sizeof(struct ar_softc), M_DEVBUF, M_WAITOK | M_ZERO); @@ -1102,31 +1106,32 @@ hc->orbase[AR_TXC_DTR0 * 4] = ~AR_TXC_DTR_NOTRESET & hc->txc_dtr[0]; else - outb(hc->iobase + AR_TXC_DTR0, ~AR_TXC_DTR_NOTRESET & + ar_outb(hc, AR_TXC_DTR0, ~AR_TXC_DTR_NOTRESET & hc->txc_dtr[0]); DELAY(2); if(hc->bustype == AR_BUS_PCI) hc->orbase[AR_TXC_DTR0 * 4] = hc->txc_dtr[0]; else - outb(hc->iobase + AR_TXC_DTR0, hc->txc_dtr[0]); + ar_outb(hc, AR_TXC_DTR0, hc->txc_dtr[0]); if(hc->bustype == AR_BUS_ISA) { /* * Configure the card. * Mem address, irq, */ - mar = kvtop(hc->mem_start) >> 16; + memst = rman_get_start(hc->res_memory); + mar = memst >> 16; isr = irqtable[hc->isa_irq] << 1; if(isr == 0) printf("ar%d: Warning illegal interrupt %d\n", hc->cunit, hc->isa_irq); - isr = isr | ((kvtop(hc->mem_start) & 0xc000) >> 10); + isr = isr | ((memst & 0xc000) >> 10); hc->sca[0] = (sca_regs *)hc->mem_start; hc->sca[1] = (sca_regs *)hc->mem_start; - outb(hc->iobase + AR_MEM_SEL, mar); - outb(hc->iobase + AR_INT_SEL, isr | AR_INTS_CEN); + ar_outb(hc, AR_MEM_SEL, mar); + ar_outb(hc, AR_INT_SEL, isr | AR_INTS_CEN); } if(hc->bustype == AR_BUS_PCI && hc->interface[0] == AR_IFACE_PIM) @@ -1156,12 +1161,12 @@ if(hc->bustype == AR_BUS_PCI) hc->orbase[AR_TXC_DTR0 * 4] = hc->txc_dtr[0]; else - outb(hc->iobase + AR_TXC_DTR0, hc->txc_dtr[0]); + ar_outb(hc, AR_TXC_DTR0, hc->txc_dtr[0]); if(hc->numports > NCHAN) { if(hc->bustype == AR_BUS_PCI) hc->orbase[AR_TXC_DTR2 * 4] = hc->txc_dtr[1]; else - outb(hc->iobase + AR_TXC_DTR2, hc->txc_dtr[1]); + ar_outb(hc, AR_TXC_DTR2, hc->txc_dtr[1]); } chanmem = hc->memsize / hc->numports; @@ -1228,7 +1233,7 @@ sca = hc->sca[scano]; if(hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(hc->iobase, scano); + ARC_SET_SCA(hc, scano); /* * Do the wait registers. @@ -1294,7 +1299,7 @@ msci = &sc->sca->msci[sc->scachan]; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); msci->cmd = SCA_CMD_RESET; @@ -1368,7 +1373,7 @@ dmac = &sc->sca->dmac[DMAC_RXCH(sc->scachan)]; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_MEM(sc->hc->iobase, sc->rxdesc); + ARC_SET_MEM(sc->hc, sc->rxdesc); rxd = (sca_descriptor *)(sc->hc->mem_start + (sc->rxdesc&sc->hc->winmsk)); rxda_d = (u_int)sc->hc->mem_start - (sc->rxdesc & ~sc->hc->winmsk); @@ -1396,7 +1401,7 @@ sc->rxhind = 0; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); dmac->dsr = 0; /* Disable DMA transfer */ dmac->dcr = SCA_DCR_ABRT; @@ -1434,7 +1439,7 @@ dmac = &sc->sca->dmac[DMAC_TXCH(sc->scachan)]; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_MEM(sc->hc->iobase, sc->block[0].txdesc); + ARC_SET_MEM(sc->hc, sc->block[0].txdesc); for(blk = 0; blk < AR_TX_BLOCKS; blk++) { blkp = &sc->block[blk]; @@ -1465,7 +1470,7 @@ } if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); dmac->dsr = 0; /* Disable DMA */ dmac->dcr = SCA_DCR_ABRT; @@ -1498,13 +1503,13 @@ sca_descriptor *cda; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); dmac = &sc->sca->dmac[DMAC_RXCH(sc->scachan)]; cda = (sca_descriptor *)(sc->hc->mem_start + ((((u_int)dmac->sarb << 16) + dmac->cda) & sc->hc->winmsk)); if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_MEM(sc->hc->iobase, sc->rxdesc); + ARC_SET_MEM(sc->hc, sc->rxdesc); rxdesc = (sca_descriptor *) (sc->hc->mem_start + (sc->rxdesc & sc->hc->winmsk)); endp = rxdesc; @@ -1561,7 +1566,7 @@ while(len) { tlen = (len < AR_BUF_SIZ) ? len : AR_BUF_SIZ; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_MEM(sc->hc->iobase, rxdata); + ARC_SET_MEM(sc->hc, rxdata); bcopy(sc->hc->mem_start + (rxdata & sc->hc->winmsk), mtod(m, caddr_t) + off, tlen); @@ -1570,7 +1575,7 @@ len -= tlen; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_MEM(sc->hc->iobase, sc->rxdesc); + ARC_SET_MEM(sc->hc, sc->rxdesc); rxdesc->len = 0; rxdesc->stat = 0xff; @@ -1599,7 +1604,7 @@ u_char stat; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); dmac = &sc->sca->dmac[DMAC_RXCH(sc->scachan)]; cda = (sca_descriptor *)(sc->hc->mem_start + ((((u_int)dmac->sarb << 16) + dmac->cda) & sc->hc->winmsk)); @@ -1610,7 +1615,7 @@ * Increment the descriptor. */ if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_MEM(sc->hc->iobase, sc->rxdesc); + ARC_SET_MEM(sc->hc, sc->rxdesc); rxdesc = (sca_descriptor *) (sc->hc->mem_start + (sc->rxdesc & sc->hc->winmsk)); endp = rxdesc; @@ -1651,7 +1656,7 @@ * Update the eda to the previous descriptor. */ if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); rxdesc = (sca_descriptor *)sc->rxdesc; rxdesc = &rxdesc[(sc->rxhind + sc->rxmax - 2 ) % sc->rxmax]; @@ -1719,7 +1724,7 @@ sc->rxhind = (sc->rxhind + i) % sc->rxmax; if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); rxdesc = (sca_descriptor *)sc->rxdesc; rxdesc = @@ -1750,7 +1755,7 @@ #endif /* NETGRAPH */ if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(sc->hc->iobase, sc->scano); + ARC_SET_SCA(sc->hc, sc->scano); TRCL(printf("ar%d: Receive error chan %d, " "stat %x, msci st3 %x," @@ -1806,7 +1811,7 @@ dmac = &sca->dmac[DMAC_TXCH(mch)]; if(hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(hc->iobase, scano); + ARC_SET_SCA(hc, scano); dsr = dmac->dsr; dmac->dsr = dsr; @@ -1877,7 +1882,7 @@ dmac = &sca->dmac[DMAC_RXCH(mch)]; if(hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(hc->iobase, scano); + ARC_SET_SCA(hc, scano); dsr = dmac->dsr; dmac->dsr = dsr; @@ -1900,7 +1905,7 @@ int i; if(hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(hc->iobase, scano); + ARC_SET_SCA(hc, scano); printf("AR: RXINTR isr1 %x, dsr %x, " "no data %d pkts, orxhind %d.\n", dotxstart, @@ -1920,7 +1925,7 @@ dmac->eda); if(sc->hc->bustype == AR_BUS_ISA) - ARC_SET_MEM(sc->hc->iobase, + ARC_SET_MEM(sc->hc, sc->rxdesc); rxdesc = (sca_descriptor *) (sc->hc->mem_start + @@ -1951,7 +1956,7 @@ /* Buffer overflow */ if(dsr & SCA_DSR_BOF) { if(hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(hc->iobase, scano); + ARC_SET_SCA(hc, scano); printf("ar%d: RX DMA Buffer overflow, " "rxpkts %lu, rxind %d, " "cda %x, eda %x, dsr %x.\n", @@ -1976,7 +1981,7 @@ sc->ierrors[2]++; #endif /* NETGRAPH */ if(hc->bustype == AR_BUS_ISA) - ARC_SET_SCA(hc->iobase, scano); + ARC_SET_SCA(hc, scano); sca->msci[mch].cmd = SCA_CMD_RXMSGREJ; dmac->dsr = SCA_DSR_DE; ==== //depot/projects/smpng/sys/dev/ar/if_ar_isa.c#4 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ar/if_ar_isa.c,v 1.51 2003/04/15 06:37:20 mdodd Exp $ + * $FreeBSD: src/sys/dev/ar/if_ar_isa.c,v 1.52 2003/04/23 15:40:11 jhay Exp $ */ /* @@ -101,12 +101,15 @@ ar_isa_probe(device_t device) { int error; - u_long membase, memsize, port_start, port_count; + u_long membase, memsize; + struct ar_hardc *hc; error = ISA_PNP_PROBE(device_get_parent(device), device, ar_ids); if(error == ENXIO || error == 0) return (error); + hc = (struct ar_hardc *)device_get_softc(device); + if((error = ar_allocate_ioport(device, 0, ARC_IO_SIZ))) { return (ENXIO); } @@ -117,17 +120,14 @@ * XXX For now I just check the undocumented ports * for "570". We will probably have to do more checking. */ - error = bus_get_resource(device, SYS_RES_IOPORT, 0, &port_start, - &port_count); - - if((inb(port_start + AR_ID_5) != '5') || - (inb(port_start + AR_ID_7) != '7') || - (inb(port_start + AR_ID_0) != '0')) { + if((ar_inb(hc, AR_ID_5) != '5') || + (ar_inb(hc, AR_ID_7) != '7') || + (ar_inb(hc, AR_ID_0) != '0')) { ar_deallocate_resources(device); return (ENXIO); } membase = bus_get_resource_start(device, SYS_RES_MEMORY, 0); - memsize = inb(port_start + AR_REV); + memsize = ar_inb(hc, AR_REV); memsize = 1 << ((memsize & AR_WSIZ_MSK) >> AR_WSIZ_SHFT); memsize *= ARC_WIN_SIZ; error = bus_set_resource(device, SYS_RES_MEMORY, 0, membase, memsize); @@ -153,12 +153,8 @@ hc = (struct ar_hardc *)device_get_softc(device); if(ar_allocate_ioport(device, 0, ARC_IO_SIZ)) return (ENXIO); - hc->bt = rman_get_bustag(hc->res_ioport); - hc->bh = rman_get_bushandle(hc->res_ioport); - hc->iobase = rman_get_start(hc->res_ioport); - - tmp = inb(hc->iobase + AR_BMI); + tmp = ar_inb(hc, AR_BMI); hc->bustype = tmp & AR_BUS_MSK; hc->memsize = (tmp & AR_MEM_MSK) >> AR_MEM_SHFT; hc->memsize = 1 << hc->memsize; @@ -167,13 +163,13 @@ hc->interface[1] = hc->interface[0]; hc->interface[2] = hc->interface[0]; hc->interface[3] = hc->interface[0]; - tmp = inb(hc->iobase + AR_REV); + tmp = ar_inb(hc, AR_REV); hc->revision = tmp & AR_REV_MSK; hc->winsize = 1 << ((tmp & AR_WSIZ_MSK) >> AR_WSIZ_SHFT); hc->winsize *= ARC_WIN_SIZ; hc->winmsk = hc->winsize - 1; - hc->numports = inb(hc->iobase + AR_PNUM); - hc->handshake = inb(hc->iobase + AR_HNDSH); + hc->numports = ar_inb(hc, AR_PNUM); + hc->handshake = ar_inb(hc, AR_HNDSH); if(ar_allocate_memory(device, 0, hc->winsize)) return (ENXIO); @@ -227,12 +223,6 @@ return (0); } - - - - - - /* ********************************* END ************************************ */ ==== //depot/projects/smpng/sys/dev/ar/if_ar_pci.c#3 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ar/if_ar_pci.c,v 1.7 2003/04/15 06:37:20 mdodd Exp $ + * $FreeBSD: src/sys/dev/ar/if_ar_pci.c,v 1.8 2003/04/23 15:40:11 jhay Exp $ */ #include @@ -107,7 +107,6 @@ { int error; u_int i, tmp; - u_char *inten; struct ar_hardc *hc; hc = (struct ar_hardc *)device_get_softc(device); @@ -125,13 +124,11 @@ if(error) goto errexit; - hc->plx_mem = rman_get_virtual(hc->res_plx_memory); hc->mem_start = rman_get_virtual(hc->res_memory); hc->cunit = device_get_unit(device); hc->sca[0] = (sca_regs *)(hc->mem_start + AR_PCI_SCA_1_OFFSET); hc->sca[1] = (sca_regs *)(hc->mem_start + AR_PCI_SCA_2_OFFSET); - hc->iobase = 0; hc->orbase = (u_char *)(hc->mem_start + AR_PCI_ORBASE_OFFSET); tmp = hc->orbase[AR_BMI * 4]; @@ -159,8 +156,8 @@ ar_attach(device); /* Magic to enable the card to generate interrupts. */ - inten = (u_char *)hc->plx_mem; - inten[0x69] = 0x09; + bus_space_write_1(rman_get_bustag(hc->res_plx_memory), + rman_get_bushandle(hc->res_plx_memory), 0x69, 0x09); return (0); ==== //depot/projects/smpng/sys/dev/ar/if_arregs.h#3 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/ar/if_arregs.h,v 1.8 2003/01/01 18:48:49 schweikh Exp $ + * $FreeBSD: src/sys/dev/ar/if_arregs.h,v 1.9 2003/04/23 15:40:11 jhay Exp $ */ #ifndef _IF_ARREGS_H_ #define _IF_ARREGS_H_ @@ -169,21 +169,19 @@ #define ARC_GET_WIN(addr) ((addr >> ARC_WIN_SHFT) & AR_WIN_MSK) -#define ARC_SET_MEM(iobase,win) outb(iobase+AR_MSCA_EN, AR_ENA_MEM | \ +#define ARC_SET_MEM(hc,win) ar_outb(hc, AR_MSCA_EN, AR_ENA_MEM | \ ARC_GET_WIN(win)) -#define ARC_SET_SCA(iobase,ch) outb(iobase+AR_MSCA_EN, AR_ENA_MEM | \ +#define ARC_SET_SCA(hc,ch) ar_outb(hc, AR_MSCA_EN, AR_ENA_MEM | \ AR_ENA_SCA | (ch ? AR_SEL_SCA_1:AR_SEL_SCA_0)) -#define ARC_SET_OFF(iobase) outb(iobase+AR_MSCA_EN, 0) +#define ARC_SET_OFF(hc) ar_outb(hc, AR_MSCA_EN, 0) struct ar_hardc { int cunit; struct ar_softc *sc; - u_short iobase; int isa_irq; int numports; caddr_t mem_start; caddr_t mem_end; - caddr_t plx_mem; u_char *orbase; u_int memsize; /* in bytes */ @@ -224,4 +222,10 @@ int ar_attach(device_t device); int ar_detach (device_t); +#define ar_inb(hc, port) \ + bus_space_read_1((hc)->bt, (hc)->bh, (port)) + +#define ar_outb(hc, port, value) \ + bus_space_write_1((hc)->bt, (hc)->bh, (port), (value)) + #endif /* _IF_ARREGS_H_ */ ==== //depot/projects/smpng/sys/dev/pci/pcireg.h#3 (text+ko) ==== @@ -23,7 +23,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/pci/pcireg.h,v 1.31 2002/06/05 22:25:51 gibbs Exp $ + * $FreeBSD: src/sys/dev/pci/pcireg.h,v 1.32 2003/04/23 15:51:36 des Exp $ * */ @@ -239,6 +239,9 @@ #define PCIS_SERIALBUS_ACCESS 0x01 #define PCIS_SERIALBUS_SSA 0x02 #define PCIS_SERIALBUS_USB 0x03 +#define PCIP_SERIALBUS_USB_UHCI 0x00 +#define PCIP_SERIALBUS_USB_OHCI 0x10 +#define PCIP_SERIALBUS_USB_EHCI 0x20 #define PCIS_SERIALBUS_FC 0x04 #define PCIS_SERIALBUS_SMBUS 0x05 ==== //depot/projects/smpng/sys/dev/sound/pcm/ac97.c#17 (text+ko) ==== @@ -30,7 +30,7 @@ #include "mixer_if.h" -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.41 2003/04/21 04:48:40 orion Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.42 2003/04/23 16:49:53 jhb Exp $"); MALLOC_DEFINE(M_AC97, "ac97", "ac97 codec"); @@ -84,8 +84,10 @@ [SOUND_MIXER_LINE] = { AC97_MIX_LINE, 5, 0, 1, 1, 5, 0, 1 }, [SOUND_MIXER_PHONEIN] = { AC97_MIX_PHONE, 5, 0, 0, 1, 8, 0, 0 }, [SOUND_MIXER_MIC] = { AC97_MIX_MIC, 5, 0, 0, 1, 1, 1, 1 }, +#if 0 /* use igain for the mic 20dB boost */ [SOUND_MIXER_IGAIN] = { -AC97_MIX_MIC, 1, 6, 0, 0, 0, 1, 1 }, +#endif [SOUND_MIXER_CD] = { AC97_MIX_CD, 5, 0, 1, 1, 2, 0, 1 }, [SOUND_MIXER_LINE1] = { AC97_MIX_AUX, 5, 0, 1, 1, 4, 0, 0 }, [SOUND_MIXER_VIDEO] = { AC97_MIX_VIDEO, 5, 0, 1, 1, 3, 0, 0 }, ==== //depot/projects/smpng/sys/geom/geom.h#25 (text+ko) ==== @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/geom/geom.h,v 1.56 2003/04/13 09:02:05 phk Exp $ + * $FreeBSD: src/sys/geom/geom.h,v 1.59 2003/04/23 07:50:01 phk Exp $ */ #ifndef _GEOM_GEOM_H_ @@ -49,7 +49,6 @@ struct g_geom; struct g_consumer; struct g_provider; -struct g_event; struct g_stat; struct thread; struct bio; @@ -60,6 +59,7 @@ typedef int g_config_t (struct g_configargs *ca); typedef int g_ctl_create_geom_t (struct gctl_req *, struct g_class *cp, struct g_provider *pp); typedef int g_ctl_destroy_geom_t (struct gctl_req *, struct g_class *cp, struct g_geom *gp); +typedef int g_ctl_config_geom_t (struct gctl_req *, struct g_geom *gp, const char *verb); typedef struct g_geom * g_taste_t (struct g_class *, struct g_provider *, int flags); #define G_TF_NORMAL 0 @@ -87,20 +87,19 @@ g_config_t *config; g_ctl_create_geom_t *create_geom; g_ctl_destroy_geom_t *destroy_geom; + g_ctl_config_geom_t *config_geom; /* * The remaning elements are private and classes should use * the G_CLASS_INITIALIZER macro to initialize them. */ LIST_ENTRY(g_class) class; LIST_HEAD(,g_geom) geom; - struct g_event *event; u_int protect; }; #define G_CLASS_INITIALIZER \ .class = { 0, 0 }, \ .geom = { 0 }, \ - .event = 0, \ .protect = 0 /* @@ -121,7 +120,6 @@ g_access_t *access; g_orphan_t *orphan; void *softc; - struct g_event *event; unsigned flags; #define G_GEOM_WITHER 1 }; @@ -150,7 +148,6 @@ struct g_provider *provider; LIST_ENTRY(g_consumer) consumers; /* XXX: better name */ int acr, acw, ace; - struct g_event *event; int spoiled; struct devstat *stat; u_int nstart, nend; @@ -167,7 +164,6 @@ LIST_HEAD(,g_consumer) consumers; int acr, acw, ace; int error; - struct g_event *event; TAILQ_ENTRY(g_provider) orphan; u_int index; off_t mediasize; @@ -338,6 +334,7 @@ /* geom_ctl.c */ void *gctl_get_param(struct gctl_req *req, const char *param, int *len); -int gctl_error(struct gctl_req *req, const char *errtxt); +void *gctl_get_paraml(struct gctl_req *req, const char *param, int len); +int gctl_error(struct gctl_req *req, const char *fmt, ...); #endif /* _GEOM_GEOM_H_ */ ==== //depot/projects/smpng/sys/geom/geom_ctl.c#9 (text+ko) ==== @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/geom/geom_ctl.c,v 1.15 2003/04/22 19:42:05 phk Exp $ + * $FreeBSD: src/sys/geom/geom_ctl.c,v 1.18 2003/04/23 08:03:47 phk Exp $ */ #include "opt_geom.h" @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -59,6 +60,8 @@ #include #include +#include + static d_ioctl_t g_ctl_ioctl; static struct cdevsw g_ctl_cdevsw = { @@ -87,16 +90,28 @@ * XXX: should take printf like args. */ int -gctl_error(struct gctl_req *req, const char *errtxt) +gctl_error(struct gctl_req *req, const char *fmt, ...) { int error; + va_list ap; + struct sbuf *sb; - if (g_debugflags & G_F_CTLDUMP) - printf("gctl %p error \"%s\"\n", req, errtxt); - error = copyout(errtxt, req->error, - imin(req->lerror, strlen(errtxt) + 1)); + sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + if (sb == NULL) { + error = copyout(fmt, req->error, + imin(req->lerror, strlen(fmt) + 1)); + } else { + va_start(ap, fmt); + sbuf_vprintf(sb, fmt, ap); + sbuf_finish(sb); + if (g_debugflags & G_F_CTLDUMP) + printf("gctl %p error \"%s\"\n", req, sbuf_data(sb)); + error = copyout(sbuf_data(sb), req->error, + imin(req->lerror, sbuf_len(sb) + 1)); + } if (!error) error = EINVAL; + sbuf_delete(sb); return (error); } @@ -253,6 +268,23 @@ return (NULL); } +void * +gctl_get_paraml(struct gctl_req *req, const char *param, int len) +{ + int i; + void *p; + + p = gctl_get_param(req, param, &i); + if (p == NULL) + gctl_error(req, "Missing %s argument", param); + else if (i != len) { + g_free(p); + p = NULL; + gctl_error(req, "Wrong length %s argument", param); + } + return (p); +} + static struct g_class* gctl_get_class(struct gctl_req *req) { @@ -381,6 +413,42 @@ return (error); } +static int +gctl_config_geom(struct gctl_req *req) +{ + struct g_class *mp; + struct g_geom *gp; + char *verb; + int error, vlen; + + g_topology_assert(); + mp = gctl_get_class(req); + if (mp == NULL) + return (gctl_error(req, "Class not found")); + if (mp->config_geom == NULL) + return (gctl_error(req, "Class has no config_geom method")); + gp = gctl_get_geom(req, mp); + if (gp == NULL) + return (gctl_error(req, "Geom not specified")); + if (gp->class != mp) + return (gctl_error(req, "Geom not of specificed class")); + verb = gctl_get_param(req, "verb", &vlen); + if (verb == NULL) + return (gctl_error(req, "Missing verb parameter")); + if (vlen < 2) { + g_free(verb); + return (gctl_error(req, "Too short verb parameter")); + } + if (verb[vlen - 1] != '\0') { + g_free(verb); + return (gctl_error(req, "Unterminated verb parameter")); + } + error = mp->config_geom(req, gp, verb); + g_free(verb); + g_topology_assert(); + return (error); +} + /* * Handle ioctl from libgeom::geom_ctl.c */ @@ -426,6 +494,9 @@ case GCTL_DESTROY_GEOM: error = gctl_destroy_geom(req); break; + case GCTL_CONFIG_GEOM: + error = gctl_config_geom(req); + break; default: error = gctl_error(req, "XXX: TBD"); break; ==== //depot/projects/smpng/sys/geom/geom_ctl.h#4 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/geom/geom_ctl.h,v 1.3 2003/04/22 19:42:05 phk Exp $ + * $FreeBSD: src/sys/geom/geom_ctl.h,v 1.4 2003/04/22 21:00:49 phk Exp $ */ #ifndef _GEOM_GEOM_CTL_H_ @@ -42,14 +42,20 @@ */ enum gctl_request { GCTL_INVALID_REQUEST = 0, + GCTL_CREATE_GEOM, GCTL_DESTROY_GEOM, + GCTL_ATTACH, GCTL_DETACH, + GCTL_CREATE_PROVIDER, GCTL_DESTROY_PROVIDER, + GCTL_INSERT_GEOM, GCTL_ELIMINATE_GEOM, + + GCTL_CONFIG_GEOM, }; #ifdef GCTL_TABLE @@ -71,6 +77,7 @@ { 0, 1, 1, 0, 1, "destroy provider", GCTL_DESTROY_PROVIDER }, { 1, 1, 1, 0, 1, "insert geom", GCTL_INSERT_GEOM }, { 0, 1, 0, 0, 1, "eliminate geom", GCTL_ELIMINATE_GEOM }, + { 0, 1, 0, 0, 1, "config geom", GCTL_CONFIG_GEOM }, /* Terminator entry */ { 1, 1, 1, 1, 1, "*INVALID*", GCTL_INVALID_REQUEST } ==== //depot/projects/smpng/sys/geom/geom_slice.c#19 (text+ko) ==== @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/geom/geom_slice.c,v 1.43 2003/04/19 10:14:39 phk Exp $ + * $FreeBSD: src/sys/geom/geom_slice.c,v 1.44 2003/04/22 21:19:17 phk Exp $ */ @@ -230,7 +230,7 @@ return; case BIO_GETATTR: /* Give the real method a chance to override */ - if (gsp->start(bp)) + if (gsp->start != NULL && gsp->start(bp)) return; if (!strcmp("GEOM::kerneldump", bp->bio_attribute)) { struct g_kerneldump *gkd; @@ -394,6 +394,9 @@ } gsl[idx].offset = offset; gsl[idx].length = length; + KASSERT(!((ract | dact | wact) & G_SLICE_HOT_START) + || gsp->start != NULL, ("G_SLICE_HOT_START but no slice->start")); + /* XXX: check that we _have_ a start function if HOT_START specified */ gsl[idx].ract = ract; gsl[idx].dact = dact; gsl[idx].wact = wact; ==== //depot/projects/smpng/sys/geom/geom_subr.c#24 (text+ko) ==== @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/geom/geom_subr.c,v 1.42 2003/04/13 09:02:06 phk Exp $ + * $FreeBSD: src/sys/geom/geom_subr.c,v 1.43 2003/04/23 06:54:44 phk Exp $ */ @@ -110,7 +110,6 @@ g_trace(G_T_TOPOLOGY, "g_destroy_geom(%p(%s))", gp, gp->name); g_topology_assert(); - KASSERT(gp->event == NULL, ("g_destroy_geom() with event")); KASSERT(LIST_EMPTY(&gp->consumer), ("g_destroy_geom(%s) with consumer(s) [%p]", gp->name, LIST_FIRST(&gp->consumer))); @@ -149,7 +148,6 @@ g_trace(G_T_TOPOLOGY, "g_destroy_consumer(%p)", cp); g_topology_assert(); - KASSERT(cp->event == NULL, ("g_destroy_consumer() with event")); KASSERT (cp->provider == NULL, ("g_destroy_consumer but attached")); KASSERT (cp->acr == 0, ("g_destroy_consumer with acr")); KASSERT (cp->acw == 0, ("g_destroy_consumer with acw")); >>> TRUNCATED FOR MAIL (1000 lines) <<<