From owner-freebsd-new-bus Sun Mar 19 9:37:28 2000 Delivered-To: freebsd-new-bus@freebsd.org Received: from finch-post-11.mail.demon.net (finch-post-11.mail.demon.net [194.217.242.39]) by hub.freebsd.org (Postfix) with ESMTP id 774BA37B63F for ; Sun, 19 Mar 2000 09:37:25 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by finch-post-11.mail.demon.net with esmtp (Exim 2.12 #1) id 12Wjdk-000P3W-0B; Sun, 19 Mar 2000 17:37:24 +0000 Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id RAA24058; Sun, 19 Mar 2000 17:38:53 GMT (envelope-from dfr@nlsystems.com) Date: Sun, 19 Mar 2000 17:44:34 +0000 (GMT) From: Doug Rabson To: "David E. Cross" Cc: freebsd-new-bus@freebsd.org Subject: Re: when is dinfo instantiated? In-Reply-To: <200003190753.CAA56296@cs.rpi.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 19 Mar 2000, David E. Cross wrote: > I am writing resource reservation and allocation code for PCI buses. > > What I am currently doing is hooking into pci_attach() in sys/pci/pci.c > (new function by my creation). It gets the softc for this instance of the > pci bus (again, my modification). In this softc it stores a resource list > of all of the resources that are allocated to the bridge. This currently > is membase, memlimit, iobase, iolimit, secondary bus, and subordinate > bus. Then as each child on the bus is probed its resource allocations > are marked 'in use' in the parent's softc, any children with invalid, or > unallocated resources may then be filled in dynamically. > > The problem that I am having is that 'device_get_ivars(dev);' in the > 'pci_attach()' function is returning NULL. Going through the code it > appears that pci_new_probe() should take care of this. That is, the > parent of the current bus (and all buses have parents, right?) should set > that structure correctly? Apparently not. What am I missing? This structure should be created by pci_readcfg which is called from pci_add_children. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message