summaryrefslogtreecommitdiffstats
path: root/share/man/man9
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-25 08:56:15 -0200
committerRenato Botelho <renato@netgate.com>2016-01-25 08:56:15 -0200
commiteb84e0723f3b4bc5e40024f66fe21c14b09e9ec4 (patch)
treefec6b99d018e13f1fccbe31478aaf29a28a55642 /share/man/man9
parentc50df8e1b90c4f9b8bbffa592477c129854776ce (diff)
parent94b1bbbd44bd88b6db1c00d795cdf7675b3ae254 (diff)
downloadFreeBSD-src-eb84e0723f3b4bc5e40024f66fe21c14b09e9ec4.zip
FreeBSD-src-eb84e0723f3b4bc5e40024f66fe21c14b09e9ec4.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/Makefile2
-rw-r--r--share/man/man9/devfs_set_cdevpriv.99
-rw-r--r--share/man/man9/pci.955
3 files changed, 58 insertions, 8 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index a6a13fd..53e0753 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1022,6 +1022,8 @@ MLINKS+=pci.9 pci_alloc_msi.9 \
pci.9 pci_get_vpd_readonly.9 \
pci.9 pci_msi_count.9 \
pci.9 pci_msix_count.9 \
+ pci.9 pci_msix_pba_bar.9 \
+ pci.9 pci_msix_table_bar.9 \
pci.9 pci_pending_msix.9 \
pci.9 pci_read_config.9 \
pci.9 pci_release_msi.9 \
diff --git a/share/man/man9/devfs_set_cdevpriv.9 b/share/man/man9/devfs_set_cdevpriv.9
index 736a007..c33c175 100644
--- a/share/man/man9/devfs_set_cdevpriv.9
+++ b/share/man/man9/devfs_set_cdevpriv.9
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 15, 2012
+.Dd December 2, 2015
.Dt DEVFS_CDEVPRIV 9
.Os
.Sh NAME
@@ -36,12 +36,12 @@
.In sys/param.h
.In sys/conf.h
.Bd -literal
-typedef void (*cdevpriv_dtr_t)(void *data);
+typedef void d_priv_dtor_t(void *data);
.Ed
.Ft int
.Fn devfs_get_cdevpriv "void **datap"
.Ft int
-.Fn devfs_set_cdevpriv "void *priv" "cdevpriv_dtr_t dtr"
+.Fn devfs_set_cdevpriv "void *priv" "d_priv_dtor_t *dtr"
.Ft void
.Fn devfs_clear_cdevpriv "void"
.Sh DESCRIPTION
@@ -116,8 +116,7 @@ was called.
.Sh SEE ALSO
.Xr open 2 ,
.Xr close 2 ,
-.Xr devfs 5 ,
-.Xr kern_openat 9
+.Xr devfs 5
.Sh HISTORY
The
.Fn devfs_cdevpriv
diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9
index 6599e28..108ddc4 100644
--- a/share/man/man9/pci.9
+++ b/share/man/man9/pci.9
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 5, 2015
+.Dd December 23, 2015
.Dt PCI 9
.Os
.Sh NAME
@@ -49,6 +49,8 @@
.Nm pci_get_vpd_readonly ,
.Nm pci_msi_count ,
.Nm pci_msix_count ,
+.Nm pci_msix_pba_bar ,
+.Nm pci_msix_table_bar ,
.Nm pci_pending_msix ,
.Nm pci_read_config ,
.Nm pci_release_msi ,
@@ -105,6 +107,10 @@
.Ft int
.Fn pci_msix_count "device_t dev"
.Ft int
+.Fn pci_msix_pba_bar "device_t dev"
+.Ft int
+.Fn pci_msix_table_bar "device_t dev"
+.Ft int
.Fn pci_pending_msix "device_t dev" "u_int index"
.Ft uint32_t
.Fn pci_read_config "device_t dev" "int reg" "int width"
@@ -618,6 +624,37 @@ then
returns zero.
.Pp
The
+.Fn pci_msix_pba_bar
+function returns the offset in configuration space of the Base Address Register
+.Pq BAR
+containing the MSI-X Pending Bit Array (PBA) for device
+.Fa dev .
+The returned value can be used as the resource ID with
+.Xr bus_alloc_resource 9
+and
+.Xr bus_release_resource 9
+to allocate the BAR.
+If the device does not support MSI-X,
+then
+.Fn pci_msix_pba_bar
+returns -1.
+.Pp
+The
+.Fn pci_msix_table_bar
+function returns the offset in configuration space of the BAR
+containing the MSI-X vector table for device
+.Fa dev .
+The returned value can be used as the resource ID with
+.Xr bus_alloc_resource 9
+and
+.Xr bus_release_resource 9
+to allocate the BAR.
+If the device does not support MSI-X,
+then
+.Fn pci_msix_table_bar
+returns -1.
+.Pp
+The
.Fn pci_alloc_msix
function attempts to allocate
.Fa *count
@@ -656,12 +693,21 @@ it returns an error.
Unlike MSI,
MSI-X does not require message counts that are powers of two.
.Pp
+The BARs containing the MSI-X vector table and PBA must be
+allocated via
+.Xr bus_alloc_resource 9
+before calling
+.Fn pci_alloc_msix
+and must not be released until after calling
+.Fn pci_release_msi .
+Note that the vector table and PBA may be stored in the same BAR or in
+different BARs.
+.Pp
The
.Fn pci_pending_msix
function examines the
.Fa dev
-device's Pending Bit Array
-.Pq PBA
+device's PBA
to determine the pending status of the MSI-X message at table index
.Fa index .
If the indicated message is pending,
@@ -776,3 +822,6 @@ These do not refer to the geographic location of PCI devices,
but to the device number assigned by the combination of the PCI IDSEL
mechanism and the platform firmware.
This should be taken note of when working with the kernel PCI code.
+.Pp
+The PCI bus driver should allocate the MSI-X vector table and PBA internally
+as necessary rather than requiring the caller to do so.
OpenPOWER on IntegriCloud