Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 May 2006 18:09:15 +0800
From:      "william wallace" <avalonwallace@gmail.com>
To:        "John-Mark Gurney" <gurney_j@resnet.uoregon.edu>,  "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>,  "Warner Losh" <imp@bsdimp.com>
Subject:   Re: misc questions about the device&driver arch
Message-ID:  <87ab37ab0605280309s15a31cb4yc8a54be1af5472dd@mail.gmail.com>
In-Reply-To: <20060524153153.GF49081@funkthat.com>
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> <20060524075946.GE49081@funkthat.com> <87ab37ab0605240613n594c566q844b754043c2c10@mail.gmail.com> <20060524153153.GF49081@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
sir , i am reading /writing  directly to a pcib 's configure space
,but i found it difficult to decide which function to use and how to
get the bus ,device and function from the device structure
shall i use PCI_READ_CONFIG(bus, devlist[numdevs] ,xx, 2)
or shall i use PCIB_READ_CONFIG(device_t dev, int b, int s, int f, int
reg, int width) ?
and how can i get int b, int s, int f?
 thank u
On 5/24/06, John-Mark Gurney <gurney_j@resnet.uoregon.edu> wrote:
> william wallace wrote this message on Wed, May 24, 2006 at 21:13 +0800:
> > roger really good tips :)
> > and so far as i know ,
> > the PCI configure space is accessed by  pci_read_config,and so on
> > the PCI IO           space is accessed by
> bus_space_read_1 and friends...
>
> > the PCI memory  space is accessed by   bus_space_read_1 and so on
> > am i right sir?
>
> Yep...
>
> > On 5/24/06, John-Mark Gurney <gurney_j@resnet.uoregon.edu> wrote:
> > >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 <scottl@samsco.org> 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."
>


-- 
we who r about to die,salute u!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87ab37ab0605280309s15a31cb4yc8a54be1af5472dd>