freebsd-dev/sys/dev/pci
Kornel Duleba 68cbe189fd pci: Don't try to read cfg registers of non-existing devices
Instead of returning 0xffs some controllers, such as Layerscape generate
an external exception when someone attempts to read any register
of config space of a non-existing device other than PCIR_VENDOR.
This causes a kernel panic.
Fix it by bailing during device enumeration if a device vendor register
returns invalid value. (0xffff)
Use this opportunity to replace some hardcoded values with a macro.

I believe that this change won't have any unintended side-effects since
it is safe to assume that vendor == 0xffff -> hdr_type == 0xffff.

Sponsored by:		Alstom
Obtained from:		Semihalf
Reviewed by:		jhb
MFC after:		2 weeks
Differential revision:	https://reviews.freebsd.org/D33059
2021-11-25 09:53:40 +01:00
..
controller Use pmap_qenter in the N1SDP PCIe driver 2021-02-25 12:38:05 +00:00
fixup_pci.c
hostb_pci.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00
ignore_pci.c
isa_pci.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00
pci_dw_if.m
pci_dw_mv.c pci_dw_mv: Don't enable unhandled interrupts. 2021-03-01 14:03:34 +01:00
pci_dw.c pci_dw: Drop unconditional explicit DEBUG define 2021-08-07 21:25:36 +01:00
pci_dw.h pci_dw: Detect number of outbound regions automatically 2021-07-21 05:51:20 +01:00
pci_host_generic_acpi.c pci_host_generic: update Synopsys device description for ACPI 2021-09-16 16:53:11 +02:00
pci_host_generic_acpi.h
pci_host_generic_fdt.c pci_host_generic: Add Synopsys Designware PCIe controller quirk 2021-09-15 15:17:40 +02:00
pci_host_generic_fdt.h pci_host_generic_fdt.c: Add support for mapping dts nodes to PCI devices 2021-06-08 17:51:40 +02:00
pci_host_generic.c bus: Make BUS_TRANSLATE_RESOURCE behave more like other bus methods 2021-11-15 13:01:30 -05:00
pci_host_generic.h pci_host_generic: Add Synopsys Designware PCIe controller quirk 2021-09-15 15:17:40 +02:00
pci_if.m
pci_iov_if.m
pci_iov_private.h pci: Implement pci_bar_enabled() for SR-IOV VFs 2021-11-09 13:13:36 -05:00
pci_iov_schema.c
pci_iov.c pci: Implement pci_bar_enabled() for SR-IOV VFs 2021-11-09 13:13:36 -05:00
pci_iov.h
pci_pci.c pci_pci: Support growing bus ranges in bus_adjust_resource for NEW_PCIB 2021-10-03 19:35:26 +01:00
pci_private.h LinuxKPI: Support lazy BAR allocation 2021-10-17 15:32:35 +01:00
pci_subr.c
pci_user.c bus: Make BUS_TRANSLATE_RESOURCE behave more like other bus methods 2021-11-15 13:01:30 -05:00
pci.c pci: Don't try to read cfg registers of non-existing devices 2021-11-25 09:53:40 +01:00
pcib_if.m
pcib_private.h pcib(4): Switch from callout to timeout_task. 2021-09-03 15:03:44 -04:00
pcib_support.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00
pcireg.h
pcivar.h Implement pci_get_relaxed_ordering_enabled() helper function. 2021-03-17 13:48:04 +01:00
schema_private.h
vga_pci.c pci: clean up empty lines in .c and .h files 2020-09-01 22:00:07 +00:00