diff options
author | Roger Pau Monné <royger@FreeBSD.org> | 2014-08-20 14:57:20 +0000 |
---|---|---|
committer | Roger Pau Monné <royger@FreeBSD.org> | 2014-08-20 14:57:20 +0000 |
commit | 073bf9dd70498b8e703307fcc1c677e4fa0717dd (patch) | |
tree | 6a6c6e2e764442ee07d40e322ef0884e4229db26 /sys/dev/pci/pcivar.h | |
parent | 5e8c3d974e888fa617417c5738346c45764e1d7e (diff) | |
download | src-073bf9dd70498b8e703307fcc1c677e4fa0717dd.tar.gz src-073bf9dd70498b8e703307fcc1c677e4fa0717dd.zip |
pci: make MSI(-X) enable and disable methods of the PCI bus
Make the functions pci_disable_msi, pci_enable_msi and pci_enable_msix
methods of the newbus PCI bus. This code should not include any
functional change.
Sponsored by: Citrix Systems R&D
Reviewed by: imp, jhb
Differential Revision: https://reviews.freebsd.org/D354
dev/pci/pci.c:
- Convert the mentioned functions to newbus methods.
- Fix the callers of the converted functions.
sys/dev/pci/pci_private.h:
dev/pci/pci_if.m:
- Declare the new methods.
dev/pci/pcivar.h:
- Add helpers to call the newbus methods.
ofed/include/linux/pci.h:
- Add define to prevent the ofed version of pci_enable_msix from
clashing with the FreeBSD native version.
Notes
Notes:
svn path=/head/; revision=270212
Diffstat (limited to 'sys/dev/pci/pcivar.h')
-rw-r--r-- | sys/dev/pci/pcivar.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h index 0157ee7be46f..328197018a16 100644 --- a/sys/dev/pci/pcivar.h +++ b/sys/dev/pci/pcivar.h @@ -458,6 +458,24 @@ pci_alloc_msix(device_t dev, int *count) return (PCI_ALLOC_MSIX(device_get_parent(dev), dev, count)); } +static __inline void +pci_enable_msi(device_t dev, uint64_t address, uint16_t data) +{ + PCI_ENABLE_MSI(device_get_parent(dev), dev, address, data); +} + +static __inline void +pci_enable_msix(device_t dev, u_int index, uint64_t address, uint32_t data) +{ + PCI_ENABLE_MSIX(device_get_parent(dev), dev, index, address, data); +} + +static __inline void +pci_disable_msi(device_t dev) +{ + PCI_DISABLE_MSI(device_get_parent(dev), dev); +} + static __inline int pci_remap_msix(device_t dev, int count, const u_int *vectors) { |