Changeset View
Changeset View
Standalone View
Standalone View
share/man/man4/pci.4
Show All 18 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd July 27, 2021 | .Dd August 13, 2021 | ||||
.Dt PCI 4 | .Dt PCI 4 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm pci | .Nm pci | ||||
.Nd generic PCI/PCIe bus driver | .Nd generic PCI/PCIe bus driver | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
To compile the PCI bus driver into the kernel, | To compile the PCI bus driver into the kernel, | ||||
place the following line in your | place the following line in your | ||||
▲ Show 20 Lines • Show All 388 Lines • ▼ Show 20 Lines | |||||
The requested mapping allows both reading and writing. | The requested mapping allows both reading and writing. | ||||
Without the flag, read-only mapping is established. | Without the flag, read-only mapping is established. | ||||
Note that it is common for the device registers to have side-effects | Note that it is common for the device registers to have side-effects | ||||
even on reads. | even on reads. | ||||
.It PCIIO_BAR_MMAP_ACTIVATE | .It PCIIO_BAR_MMAP_ACTIVATE | ||||
(Unimplemented) If the BAR is not activated, activate it in the course | (Unimplemented) If the BAR is not activated, activate it in the course | ||||
of mapping. | of mapping. | ||||
Currently attempt to mmap an inactive BAR results in error. | Currently attempt to mmap an inactive BAR results in error. | ||||
.El | |||||
.It PCIOCBARIO | |||||
This | |||||
.Xr ioctl 2 | |||||
command allows users to read from and write to BARs. | |||||
The I/O request parameters are passed in a | |||||
.Va struct pci_bar_ioreq | |||||
structure, which has the following fields: | |||||
.Bl -tag | |||||
.It Vt struct pcisel pbi_sel | |||||
Describes the device to operate on. | |||||
.It Vt int pbi_op | |||||
The operation to perform. | |||||
Currently supported values are | |||||
.Dv PCIBARIO_READ | |||||
and | |||||
.Dv PCIBARIO_WRITE . | |||||
.It Vt uint32_t pbi_bar | |||||
The index of the BAR on which to operate. | |||||
.It Vt uint32_t pbi_offset | |||||
The offset into the BAR at which to operate. | |||||
.It Vt uint32_t pbi_width | |||||
The size, in bytes, of the I/O operation. | |||||
imp: I'd be tempted to add 'in bytes' here to make it clear the units. And why aren't 8-byte I/Os… | |||||
1-byte, 2-byte, 4-byte and 8-byte perations are supported. | |||||
.It Vt uint32_t pbi_value | |||||
For reads, the value is returned in this field. | |||||
For writes, the caller specifies the value to be written in this field. | |||||
.Pp | |||||
Note that this operation maps and unmaps the corresponding resource and | |||||
so is relatively expensive for memory BARs. | |||||
The | |||||
.Va PCIOCBARMMAP | |||||
.Xr ioctl 2 | |||||
can be used to create a persistent userspace mapping for such BARs instead. | |||||
.El | .El | ||||
.El | .El | ||||
.Sh LOADER TUNABLES | .Sh LOADER TUNABLES | ||||
Tunables can be set at the | Tunables can be set at the | ||||
.Xr loader 8 | .Xr loader 8 | ||||
prompt before booting the kernel, or stored in | prompt before booting the kernel, or stored in | ||||
.Xr loader.conf 5 . | .Xr loader.conf 5 . | ||||
The current value of these tunables can be examined at runtime via | The current value of these tunables can be examined at runtime via | ||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |
I'd be tempted to add 'in bytes' here to make it clear the units. And why aren't 8-byte I/Os supported?