Searched hist:306469 (Results 1 - 2 of 2) sorted by relevance

/freebsd-11-stable/share/man/man4/
H A Dpci.4diff 306469 Thu Sep 29 19:17:20 MDT 2016 jhb 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
/freebsd-11-stable/sys/dev/pci/
H A Dpci_user.cdiff 306469 Thu Sep 29 19:17:20 MDT 2016 jhb 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

Completed in 61 milliseconds