- Check for an invalid device (vendor is invalid) before reading the header type register when examining function 0 of a possible device.
- When iterating over functions of a device, reject any device whose 16-bit vendor is invalid rather than requiring the full 32-bit vendor+device to be all 1's. In practice the latter check is probably fine, but checking the vendor is what the PCI spec recommends.
Details
Details
- have booted this in some VMs
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
this is fine as it is, but would be better with a centralized function...
sys/dev/acpica/acpi_pci_link.c | ||
---|---|---|
583 โ | (On Diff #60413) | Would it make sense to create a function to do this since we recite this same code over and over. And we've changed this several times over the history of this code... |
sys/dev/acpica/acpi_pci_link.c | ||
---|---|---|
583 โ | (On Diff #60413) | It's hard to make a centralized version as different places use different methods to read the config register (e.g. the PCI bus invokes a kobj method on the parent PCI bridge whereas this is doing an end-run around new-bus (which it perhaps shouldn't be, but I didn't think to (ab)use the pcib_if.m interface of the parent nexus at the time I first wrote this)). We did at least gain the PCIV_INVALID constant in the last year or so which replaces the 0xffff magic number. |