freebsd-skq/sys/dev/pci
John Baldwin 10012d5309 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.

Reviewed by:	vangyzen, imp
MFC after:	1 month
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D7445
2016-08-09 17:57:11 +00:00
..
eisa_pci.c Revert previous change. The magical constants can't be changed 2015-06-06 17:04:36 +00:00
fixup_pci.c
hostb_pci.c sys/dev: minor spelling fixes. 2016-05-03 03:41:25 +00:00
ignore_pci.c Revert previous change. The magical constants can't be changed 2015-06-06 17:04:36 +00:00
isa_pci.c Convert rman to use rman_res_t instead of u_long 2016-01-27 02:23:54 +00:00
pci_host_generic.c Remove support for the arm64 pre-INTRNG interrupt framework from the PCI 2016-07-14 16:52:18 +00:00
pci_host_generic.h Mark the ThunderX and generic PCI drivers as cache-coherent when we know 2016-05-31 09:15:21 +00:00
pci_if.m Permit the name of the /dev/iov entry to be set by the driver. 2016-08-03 17:09:12 +00:00
pci_iov_if.m Create a separate kobj interface for leaf-driver PCI IOV methods. 2015-05-28 22:01:50 +00:00
pci_iov_private.h Save and restore SRIOV-related config registers. 2016-05-03 19:45:24 +00:00
pci_iov_schema.c Clean up repeated "All rights reserved" 2016-03-14 17:41:17 +00:00
pci_iov.c Permit the name of the /dev/iov entry to be set by the driver. 2016-08-03 17:09:12 +00:00
pci_iov.h Permit the name of the /dev/iov entry to be set by the driver. 2016-08-03 17:09:12 +00:00
pci_pci.c Fix some logic in PCIe HotPlug; display EI status 2016-08-05 23:23:48 +00:00
pci_private.h Permit the name of the /dev/iov entry to be set by the driver. 2016-08-03 17:09:12 +00:00
pci_subr.c Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. 2016-03-18 01:28:41 +00:00
pci_user.c Reliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF. 2016-08-09 17:57:11 +00:00
pci.c Add pci_get_max_payload() to fetch the PCI-express maximum payload size. 2016-06-24 17:26:42 +00:00
pcib_if.m Re-commit r299467 having fixed the build: 2016-05-16 09:15:50 +00:00
pcib_private.h Implement a proper detach method for the PCI-PCI bridge driver. 2016-05-20 00:03:22 +00:00
pcib_support.c Re-commit r299467 having fixed the build: 2016-05-16 09:15:50 +00:00
pcireg.h Native PCI-express HotPlug support. 2016-05-05 22:26:23 +00:00
pcivar.h Add pci_get_max_payload() to fetch the PCI-express maximum payload size. 2016-06-24 17:26:42 +00:00
schema_private.h Clean up repeated "All rights reserved" 2016-03-14 17:41:17 +00:00
vga_pci.c Replace all resource occurrences of '0UL/~0UL' with '0/~0'. 2016-03-03 05:07:35 +00:00