From owner-freebsd-hackers@FreeBSD.ORG Wed May 24 07:59:53 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1BC3516A451 for ; Wed, 24 May 2006 07:59:53 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 976B743D46 for ; Wed, 24 May 2006 07:59:52 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (glidy82uko4njbl0@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.4/8.13.3) with ESMTP id k4O7xnqm070062; Wed, 24 May 2006 00:59:49 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.4/8.13.3/Submit) id k4O7xkBg070061; Wed, 24 May 2006 00:59:46 -0700 (PDT) (envelope-from jmg) Date: Wed, 24 May 2006 00:59:46 -0700 From: John-Mark Gurney To: william wallace Message-ID: <20060524075946.GE49081@funkthat.com> Mail-Followup-To: william wallace , Scott Long , imp@bsdimp.com, "freebsd-hackers@freebsd.org" References: <87ab37ab0605210108w127a235bue281428f52bbc784@mail.gmail.com> <20060521.114807.74702188.imp@bsdimp.com> <87ab37ab0605212328ue7c70fcu49c5fec8921ae229@mail.gmail.com> <20060522.005010.104089663.imp@bsdimp.com> <87ab37ab0605221816y6cca5387sc43fa1e1116f55cc@mail.gmail.com> <44729B81.8010909@samsco.org> <87ab37ab0605240048g224218a5s87cfe1b1ed5cc8c9@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ab37ab0605240048g224218a5s87cfe1b1ed5cc8c9@mail.gmail.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: "freebsd-hackers@freebsd.org" , Scott Long Subject: Re: misc questions about the device&driver arch X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 May 2006 07:59:54 -0000 william wallace wrote this message on Wed, May 24, 2006 at 15:48 +0800: > IN static device_method_t pci_methods[] = { > what is the freeBSD's magic to connect pci_read_config_method wtih > PCI_READ_CONFIG? awk script?and so on? > which > DEVMETHOD(pci_read_config, pci_read_config_method), in pci.c > command = PCI_READ_CONFIG(dev, child, PCIR_COMMAND, 2); in > pci_enable_io_method in pci.c > > and what if i create a new method in pci method interface ? > such as DEVMETHOD(pci_have_rest , pci_have_rest_method) > what else should i do when i want to use PCI_HAVE_REST(dev ) point to > pci_have_rest_method These are handled by the _if.m files... look at sys/dev/pci/pci_if.m... There is an awk script in sys/tools/makeobjops.awk that converts the _if.m to the appropriate .h and .c files... Please read: http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/kernel-objects-using.html http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/newbus-overview.html The device methods are implemented using kobj... > On 5/23/06, Scott Long wrote: > >william wallace wrote: > > > >[...] > > > >> MSI: > >> I've bantered around different suggestions for an API that will support > >> this. The basic thing that a driver needs from this is to know > >> exactly how many message interrupt vectors are available to it. It > >> can't just register vectors and handlers blindly since the purpose of > >> MSI is to assign special meanings to each vector and allow the driver to > >> handle each one in specifically. > > > >[...] > > > >I just wanted to briefly say that an MSI implementation has been done > >recently, and that it should start getting wider circulation and review > >soon. That's not to say that more work and design can't be done in this > >area, but we should probably wait a bit and see what has been done > >already. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."