Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Jun 2006 23:35:29 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        avg@icyb.net.ua
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: working with PCI config registers (extensively)
Message-ID:  <20060608.233529.1585998877.imp@bsdimp.com>
In-Reply-To: <4487045F.4000301@icyb.net.ua>
References:  <4487045F.4000301@icyb.net.ua>

index | next in thread | previous in thread | raw e-mail

In message: <4487045F.4000301@icyb.net.ua>
            Andriy Gapon <avg@icyb.net.ua> writes:
: 
: I am writing a driver for some PCI hardware that does not have any IO
: ports or IO memory (and thus does not have any useful BARs), but rather
: it is controlled and communicated with by writes and reads of certain
: vendor-specific PCI configuration registers.
: 
: I see that I can use pci_read_config() and pci_write_config() to do
: this, but I am not sure if there are any caveats that I should be aware
: of, any precautions that I should take and any conventions/rules that I
: should follow.
: 
: To explain my question - I am concerned about PCI configuration space
: resources ownership, concurrency, etc. Basically things that should not
: matter in practice :-)

The PCI bus will write to the standard TYPE 0 headers of a device on
the pci bus to manage it.  All other configuration registers are the
responsibility of the driver.  The driver can also access the
registers that the pci bus manages, but care must be taken.  Sounds
like there'd be no conflict for you.

Warner


help

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