From: Keir Fraser Date: Mon, 12 Jul 2010 09:48:34 +0000 (+0100) Subject: Consolidate MSI-X related definitions X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11801 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7d343d0e53c881bb6b78db2bf29d584eee467bbf;p=xen.git Consolidate MSI-X related definitions Eliminate redundant ones, fix names (where so far inappropriately referring to capability structure fields the don't really relate to), use symbolic names instead of raw numbers, and remove an unusable one. No functional change intended. Signed-off-by: Jan Beulich --- diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c index ec7e5c9c06..5ff709471a 100644 --- a/xen/arch/x86/msi.c +++ b/xen/arch/x86/msi.c @@ -560,8 +560,8 @@ static int msix_capability_init(struct pci_dev *dev, /* Request & Map MSI-X table region */ table_offset = pci_conf_read32(bus, slot, func, msix_table_offset_reg(pos)); - bir = (u8)(table_offset & PCI_MSIX_FLAGS_BIRMASK); - table_offset &= ~PCI_MSIX_FLAGS_BIRMASK; + bir = (u8)(table_offset & PCI_MSIX_BIRMASK); + table_offset &= ~PCI_MSIX_BIRMASK; entry_offset = msi->entry_nr * PCI_MSIX_ENTRY_SIZE; table_paddr = msi->table_base + table_offset; diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h index bc8ab0e870..0848616b29 100644 --- a/xen/include/asm-x86/msi.h +++ b/xen/include/asm-x86/msi.h @@ -119,14 +119,6 @@ int msi_free_irq(struct msi_desc *entry); extern const struct hw_interrupt_type pci_msi_type; -/* - * MSI-X Address Register - */ -#define PCI_MSIX_FLAGS_QSIZE 0x7FF -#define PCI_MSIX_FLAGS_ENABLE (1 << 15) -#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) -#define PCI_MSIX_FLAGS_BITMASK (1 << 0) - #define PCI_MSIX_ENTRY_SIZE 16 #define PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET 0 #define PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET 4 @@ -151,15 +143,14 @@ extern const struct hw_interrupt_type pci_msi_type; control |= PCI_MSI_FLAGS_ENABLE #define msix_control_reg(base) (base + PCI_MSIX_FLAGS) -#define msix_table_offset_reg(base) (base + 0x04) -#define msix_pba_offset_reg(base) (base + 0x08) +#define msix_table_offset_reg(base) (base + PCI_MSIX_TABLE) +#define msix_pba_offset_reg(base) (base + PCI_MSIX_PBA) #define msix_enable(control) control |= PCI_MSIX_FLAGS_ENABLE #define msix_disable(control) control &= ~PCI_MSIX_FLAGS_ENABLE #define msix_table_size(control) ((control & PCI_MSIX_FLAGS_QSIZE)+1) #define multi_msix_capable msix_table_size -#define msix_unmask(address) (address & ~PCI_MSIX_FLAGS_BITMASK) -#define msix_mask(address) (address | PCI_MSIX_FLAGS_BITMASK) -#define msix_is_pending(address) (address & PCI_MSIX_FLAGS_PENDMASK) +#define msix_unmask(address) (address & ~PCI_MSIX_VECTOR_BITMASK) +#define msix_mask(address) (address | PCI_MSIX_VECTOR_BITMASK) /* * MSI Defined Data Structures diff --git a/xen/include/xen/pci_regs.h b/xen/include/xen/pci_regs.h index b92a171052..dfeead1aca 100644 --- a/xen/include/xen/pci_regs.h +++ b/xen/include/xen/pci_regs.h @@ -301,8 +301,11 @@ #define PCI_MSIX_FLAGS_QSIZE 0x7FF #define PCI_MSIX_FLAGS_ENABLE (1 << 15) #define PCI_MSIX_FLAGS_MASKALL (1 << 14) -#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) -#define PCI_MSIX_FLAGS_BITMASK (1 << 0) +#define PCI_MSIX_TABLE 4 +#define PCI_MSIX_PBA 8 +#define PCI_MSIX_BIRMASK (7 << 0) + +#define PCI_MSIX_VECTOR_BITMASK (1 << 0) /* CompactPCI Hotswap Register */