diff options
| author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2022-10-31 22:14:10 +0000 |
|---|---|---|
| committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2022-11-28 17:11:47 +0000 |
| commit | 5f2f582ccceec8729ee85bf191a2f7373c2994a4 (patch) | |
| tree | 111edd591515b6af3f17072297247288964be9f5 /sys/compat/linuxkpi/common/include/linux/pci.h | |
| parent | 4495b4eb510d87277ed2dd4d27f7cebc7a76b4a8 (diff) | |
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/pci.h')
| -rw-r--r-- | sys/compat/linuxkpi/common/include/linux/pci.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 72fe345a72a6..20f9b917fbdc 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -161,6 +161,11 @@ MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ #define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */ #define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */ +#define PCI_MSI_ADDRESS_LO PCIR_MSI_ADDR +#define PCI_MSI_ADDRESS_HI PCIR_MSI_ADDR_HIGH +#define PCI_MSI_FLAGS PCIR_MSI_CTRL +#define PCI_MSI_FLAGS_ENABLE PCIM_MSICTRL_MSI_ENABLE + #define PCI_EXP_LNKCAP_CLKPM 0x00040000 #define PCI_EXP_DEVSTA_TRPND 0x0020 @@ -1608,4 +1613,12 @@ pcie_get_readrq(struct pci_dev *dev) return (128 << ((ctl & PCI_EXP_DEVCTL_READRQ) >> 12)); } +static inline bool +pci_is_enabled(struct pci_dev *pdev) +{ + + return ((pci_read_config(pdev->dev.bsddev, PCIR_COMMAND, 2) & + PCIM_CMD_BUSMASTEREN) != 0); +} + #endif /* _LINUXKPI_LINUX_PCI_H_ */ |
