summaryrefslogtreecommitdiffstats
path: root/share/man
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2016-09-30 01:13:57 +0000
committerjhb <jhb@FreeBSD.org>2016-09-30 01:13:57 +0000
commit5558dfd38bac6a6ad6408e1e8b52730465fd2188 (patch)
treeb51a8d4ed9970ae30d90a5df8238aa6441540d35 /share/man
parent5a4a1564f387144f717e729c81172f46f230ecab (diff)
downloadFreeBSD-src-5558dfd38bac6a6ad6408e1e8b52730465fd2188.zip
FreeBSD-src-5558dfd38bac6a6ad6408e1e8b52730465fd2188.tar.gz
MFC 303881: Reliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF.
Previously the loop in PCIIOCGETCONF would terminate as soon as it found enough matches. Now it will continue iterating through the PCI device list and only terminate if it finds another matching device for which it has no room to store a conf structure. This means that PCI_GETCONF_LAST_DEVICE is reliably returned when the number of matching devices is equal to the number of slots in the matches buffer. For example, if a program requests the conf structure for a single PCI function with a specified domain/bus/slot/function it will now get PCI_GETCONF_LAST_DEVICE instead of PCI_GETCONF_MORE_DEVS. While here, simplify the loop conditional a bit more by explicitly breaking out of the loop if copyout() fails and removing a redundant i < pci_numdevs check. Sponsored by: Chelsio Communications
Diffstat (limited to 'share/man')
-rw-r--r--share/man/man4/pci.49
1 files changed, 4 insertions, 5 deletions
diff --git a/share/man/man4/pci.4 b/share/man/man4/pci.4
index c79626f..578c365 100644
--- a/share/man/man4/pci.4
+++ b/share/man/man4/pci.4
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 3, 2008
+.Dd August 9, 2016
.Dt PCI 4
.Os
.Sh NAME
@@ -229,7 +229,8 @@ The status tells the user the disposition of his request for a device list.
The possible status values are:
.Bl -ohang
.It PCI_GETCONF_LAST_DEVICE
-This means that there are no more devices in the PCI device list after the
+This means that there are no more devices in the PCI device list matching
+the specified criteria after the
ones returned in the
.Va matches
buffer.
@@ -245,9 +246,7 @@ and
to zero to start over at the beginning of the list.
.It PCI_GETCONF_MORE_DEVS
This tells the user that his buffer was not large enough to hold all of the
-remaining devices in the device list that possibly match his criteria.
-It is possible for this status to be returned, even when none of the remaining
-devices in the list would match the user's criteria.
+remaining devices in the device list that match his criteria.
.It PCI_GETCONF_ERROR
This indicates a general error while servicing the user's request.
If the
OpenPOWER on IntegriCloud