From owner-svn-src-head@FreeBSD.ORG Wed May 20 17:55:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 947D0106566C; Wed, 20 May 2009 17:55:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 2611E8FC0A; Wed, 20 May 2009 17:55:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AE53346B2D; Wed, 20 May 2009 13:55:32 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 725A58A025; Wed, 20 May 2009 13:55:31 -0400 (EDT) From: John Baldwin To: Warner Losh Date: Wed, 20 May 2009 13:55:24 -0400 User-Agent: KMail/1.9.7 References: <200905201729.n4KHTLQL038297@svn.freebsd.org> In-Reply-To: <200905201729.n4KHTLQL038297@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200905201355.24483.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 20 May 2009 13:55:31 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r192450 - in head/sys/dev: aac acpica amr arcmsr ata ciss cxgb iir mfi mpt pci twa twe wi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2009 17:55:34 -0000 On Wednesday 20 May 2009 1:29:21 pm Warner Losh wrote: > Author: imp > Date: Wed May 20 17:29:21 2009 > New Revision: 192450 > URL: http://svn.freebsd.org/changeset/base/192450 > > Log: > We no longer need to use d_thread_t, migrate to struct thread *. > > Modified: head/sys/dev/ata/ata-all.c > ============================================================================== > --- head/sys/dev/ata/ata-all.c Wed May 20 17:19:30 2009 (r192449) > +++ head/sys/dev/ata/ata-all.c Wed May 20 17:29:21 2009 (r192450) > @@ -663,7 +663,7 @@ ata_getparam(struct ata_device *atadev, > btrim(atacap->serial, sizeof(atacap->serial)); > bpack(atacap->serial, atacap->serial, sizeof(atacap->serial)); > > - if (bootverbose) > + if (bootverbose || 1) > printf("ata%d-%s: pio=%s wdma=%s udma=%s cable=%s wire\n", > device_get_unit(ch->dev), > ata_unit2str(atadev), > Oops? > Modified: head/sys/dev/pci/pci.c > ============================================================================== > --- head/sys/dev/pci/pci.c Wed May 20 17:19:30 2009 (r192449) > +++ head/sys/dev/pci/pci.c Wed May 20 17:29:21 2009 (r192450) > @@ -418,6 +418,38 @@ pci_hdrtypedata(device_t pcib, int b, in > #undef REG > } > > +/* > + * This is a lame example: we should have some way of managing this table > + * from userland. The user should be able to tell us from the boot loader > + * or at runtime what mapping to do. > + */ > +static struct pci_remap_entry > +{ > + uint16_t vendor; > + uint16_t device; > + uint16_t mapped_vendor; > + uint16_t mapped_device; > +} pci_remap[] = > +{ > + { 0x1039, 0x0901, 0x1039, 0x0900 } /* Map sis 901 to sis 900 */ > +}; > +static int pci_remap_entries = 1; > + > +static void > +pci_apply_remap_table(pcicfgregs *cfg) > +{ > + int i; > + > + for (i = 0; i < pci_remap_entries; i++) { > + if (cfg->vendor == pci_remap[i].vendor && > + cfg->device == pci_remap[i].device) { > + cfg->vendor = pci_remap[i].mapped_vendor; > + cfg->device = pci_remap[i].mapped_device; > + return; > + } > + } > +} > + > /* read configuration header into pcicfgregs structure */ > struct pci_devinfo * > pci_read_device(device_t pcib, int d, int b, int s, int f, size_t size) > @@ -464,6 +496,7 @@ pci_read_device(device_t pcib, int d, in > > pci_fixancient(cfg); > pci_hdrtypedata(pcib, b, s, f, cfg); > + pci_apply_remap_table(cfg); > > if (REG(PCIR_STATUS, 2) & PCIM_STATUS_CAPPRESENT) > pci_read_extcap(pcib, cfg); > @@ -2619,6 +2652,59 @@ pci_add_resources(device_t bus, device_t > } > } > > +/* > + * After we've added the children to the pci bus device, we need to fixup > + * the children in various ways. This function fixes things that require > + * multiple passes to get right, such as bus number and some resource > + * things (although the latter hasn't been implemented yet). This must be > + * done before the children are probe/attached, sicne by that point these > + * things must be fixed. > + */ > +static void > +pci_fix_bridges(device_t dev) > +{ > + int i, numdevs, error, secbus, subbus; > + device_t child, *devlist; > + > + if ((error = device_get_children(dev, &devlist, &numdevs))) > + return; > + /* > + * First pass, get the bus numbers that are in use > + */ > + for (i = 0; i < numdevs; i++) { > + child = devlist[i]; > + switch (pci_read_config(child, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) { > + default: > + continue; > + case 1: /* PCI-PCI bridge */ > + case 2: /* CardBus bridge -- offsets are the same */ > + secbus = pci_read_config(child, PCIR_SECBUS_1, 1); > + subbus = pci_read_config(child, PCIR_SUBBUS_1, 1); > + break; > + } > + printf("%d:%d:%d:%d sec %d sub %d\n", pcib_get_domain(dev), > + pci_get_bus(child), pci_get_slot(child), > + pci_get_function(child), secbus, subbus); > + } > +#if 0 > + /* > + * Second pass, Fix the bus numbers, as needed > + */ > + for (i = 0; i < numdevs; i++) { > + child = devlist[i]; > + switch (pci_read_config(dev, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) { > + case 1: /* PCI-PCI bridge */ > + break; > + case 2: /* CardBus bridge */ > + break; > + default: > + continue; > + } > + } > +#endif > + free(devlist, M_TEMP); > +} > + > void > pci_add_children(device_t dev, int domain, int busno, size_t dinfo_size) > { > @@ -2650,6 +2736,7 @@ pci_add_children(device_t dev, int domai > } > } > #undef REG > + pci_fix_bridges(dev); > } > > void > > Modified: head/sys/dev/pci/pci_pci.c > ============================================================================== > --- head/sys/dev/pci/pci_pci.c Wed May 20 17:19:30 2009 (r192449) > +++ head/sys/dev/pci/pci_pci.c Wed May 20 17:29:21 2009 (r192450) > @@ -52,6 +52,13 @@ __FBSDID("$FreeBSD$"); > > #include "pcib_if.h" > > +// #define KLUDGE_O_MATIC > +#ifdef KLUDGE_O_MATIC > +int hack_unit = 1; > +u_long mem_base = 0xc0400000ul; > +u_long mem_limit = 0x00100000ul; > +#endif > + > static int pcib_probe(device_t dev); > > static device_method_t pcib_methods[] = { > @@ -324,6 +331,14 @@ pcib_attach(device_t dev) > struct pcib_softc *sc; > device_t child; > > +#ifdef KLUDGE_O_MATIC > + if (device_get_unit(dev) == hack_unit) { > + pci_write_config(dev, PCIR_COMMAND, > + PCIM_CMD_MEMEN | pci_read_config(dev, PCIR_COMMAND, 1), 1); > + pci_write_config(dev, PCIR_MEMBASE_1, mem_base >> 16, 2); > + pci_write_config(dev, PCIR_MEMLIMIT_1, mem_limit >> 16, 2); > + } > +#endif > pcib_attach_common(dev); > sc = device_get_softc(dev); > if (sc->secbus != 0) { > > Modified: head/sys/dev/pci/pcib_if.m > ============================================================================== > --- head/sys/dev/pci/pcib_if.m Wed May 20 17:19:30 2009 (r192449) > +++ head/sys/dev/pci/pcib_if.m Wed May 20 17:29:21 2009 (r192450) > @@ -144,3 +144,17 @@ METHOD int map_msi { > uint64_t *addr; > uint32_t *data; > }; > + > +# > +# Return the range of busses passed through this bridge. For normal > +# pci-pci bridges (and compatible things like pci-x and pcie), this will > +# just be the secbus and subbus configuration registers. For non-standard > +# bridges, or for host bridges which have no standard, this will be the > +# same data read from either device specific registers of from "perfect > +# knowledge" of what they must be. > +# > +METHOD int bus_range { > + device_t pcib; > + u_int *secbus; > + u_int *subbus; > +}; > More oops? > Modified: head/sys/dev/wi/if_wavelan_ieee.h > ============================================================================== > --- head/sys/dev/wi/if_wavelan_ieee.h Wed May 20 17:19:30 2009 (r192449) > +++ head/sys/dev/wi/if_wavelan_ieee.h Wed May 20 17:29:21 2009 (r192450) > @@ -58,14 +58,11 @@ > * value. > */ > #define WI_MAX_DATALEN 512 > - > -#if 0 > struct wi_req { > u_int16_t wi_len; > u_int16_t wi_type; > u_int16_t wi_val[WI_MAX_DATALEN]; > }; > -#endif > > /* > * Private LTV records (interpreted only by the driver). This is > > Modified: head/sys/dev/wi/if_wi.c > ============================================================================== > --- head/sys/dev/wi/if_wi.c Wed May 20 17:19:30 2009 (r192449) > +++ head/sys/dev/wi/if_wi.c Wed May 20 17:29:21 2009 (r192450) > @@ -143,7 +143,6 @@ static int wi_alloc_fid(struct wi_softc > static void wi_read_nicid(struct wi_softc *); > static int wi_write_ssid(struct wi_softc *, int, u_int8_t *, int); > > -static int wi_cmd(struct wi_softc *, int, int, int, int); > static int wi_seek_bap(struct wi_softc *, int, int); > static int wi_read_bap(struct wi_softc *, int, int, void *, int); > static int wi_write_bap(struct wi_softc *, int, int, void *, int); > @@ -1801,7 +1800,7 @@ wi_write_wep(struct wi_softc *sc, struct > return error; > } > > -static int > +int > wi_cmd(struct wi_softc *sc, int cmd, int val0, int val1, int val2) > { > int i, s = 0; > @@ -2120,3 +2119,5 @@ wi_free(device_t dev) > sc->mem = NULL; > } > } > + > +MODULE_VERSION(wi, 1); > > Modified: head/sys/dev/wi/if_wivar.h > ============================================================================== > --- head/sys/dev/wi/if_wivar.h Wed May 20 17:19:30 2009 (r192449) > +++ head/sys/dev/wi/if_wivar.h Wed May 20 17:29:21 2009 (r192450) > @@ -186,3 +186,6 @@ void wi_init(void *); > void wi_intr(void *); > int wi_mgmt_xmit(struct wi_softc *, caddr_t, int); > void wi_stop(struct wi_softc *, int); > + > +/* KLUDGE */ > +int wi_cmd(struct wi_softc *, int, int, int, int); Also oops? -- John Baldwin