linuxkpi: Add pci_device_is_present()

This calls bus_child_present(9) internally.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38148
This commit is contained in:
Jean-Sébastien Pédron 2023-01-19 18:46:37 +01:00
parent bbff0400c1
commit 49b6d5ed14
No known key found for this signature in database
GPG Key ID: 39E99761A5FD94CC
2 changed files with 19 additions and 0 deletions

View File

@ -1672,4 +1672,13 @@ pci_is_enabled(struct pci_dev *pdev)
PCIM_CMD_BUSMASTEREN) != 0);
}
static inline int
pci_wait_for_pending_transaction(struct pci_dev *pdev)
{
return (0);
}
bool pci_device_is_present(struct pci_dev *pdev);
#endif /* _LINUXKPI_LINUX_PCI_H_ */

View File

@ -996,6 +996,16 @@ lkpi_pci_msi_desc_alloc(int irq)
return (desc);
}
bool
pci_device_is_present(struct pci_dev *pdev)
{
device_t dev;
dev = pdev->dev.bsddev;
return (bus_child_present(dev));
}
CTASSERT(sizeof(dma_addr_t) <= sizeof(uint64_t));
struct linux_dma_obj {