Remove kernel specific macro out of the VirtIO PCI header file

The eventual goal is to share this file with userland, so
remove the macro that is only specific for virtio_pci(4).
Instead, add the VIRTIO_PCI_CONFIG_OFF macro from Linux to
get the config size whether MSIX is enabled or not.

MFC after:	1 week
This commit is contained in:
Bryan Venteicher 2014-06-16 04:16:31 +00:00
parent add526c613
commit e026de111e
2 changed files with 4 additions and 2 deletions

View File

@ -170,6 +170,9 @@ static void vtpci_config_intr(void *);
#define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt
#define VIRTIO_PCI_CONFIG(_sc) \
VIRTIO_PCI_CONFIG_OFF((((_sc)->vtpci_flags & VTPCI_FLAG_MSIX)) != 0)
/*
* I/O port read/write wrappers.
*/

View File

@ -72,8 +72,7 @@
* The remaining space is defined by each driver as the per-driver
* configuration space.
*/
#define VIRTIO_PCI_CONFIG(sc) \
(((sc)->vtpci_flags & VTPCI_FLAG_MSIX) ? 24 : 20)
#define VIRTIO_PCI_CONFIG_OFF(msix_enabled) ((msix_enabled) ? 24 : 20)
/*
* How many bits to shift physical queue address written to QUEUE_PFN.