All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: linux-pci@vger.kernel.org
Cc: Gavin Shan <shangw@linux.vnet.ibm.com>
Subject: [PATCH v4 07/22] PCI: Clean up MSI/MSI-X capability #defines
Date: Mon, 22 Apr 2013 17:11:00 -0600	[thread overview]
Message-ID: <20130422231100.32621.52374.stgit@bhelgaas-glaptop> (raw)
In-Reply-To: <20130422230012.32621.15224.stgit@bhelgaas-glaptop>

This doesn't change any existing symbols, but it puts them in logical
order and uses explicit masks instead of shifts, like the rest of the
file.

It also adds new symbols for PCI_MSIX_TABLE_BIR,
PCI_MSIX_TABLE_OFFSET, PCI_MSIX_PBA_BIR, and PCI_MSIX_PBA_OFFSET to
replace the mis-named PCI_MSIX_FLAGS_BIRMASK (the BAR index fields
are part of the Table and PBA registers, not the flags register).

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 include/uapi/linux/pci_regs.h |   30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index ebfadc5..864e324 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -292,12 +292,12 @@
 
 /* Message Signalled Interrupts registers */
 
-#define PCI_MSI_FLAGS		2	/* Various flags */
-#define  PCI_MSI_FLAGS_64BIT	0x80	/* 64-bit addresses allowed */
-#define  PCI_MSI_FLAGS_QSIZE	0x70	/* Message queue size configured */
-#define  PCI_MSI_FLAGS_QMASK	0x0e	/* Maximum queue size available */
-#define  PCI_MSI_FLAGS_ENABLE	0x01	/* MSI feature enabled */
-#define  PCI_MSI_FLAGS_MASKBIT	0x100	/* 64-bit mask bits allowed */
+#define PCI_MSI_FLAGS		2	/* Message Control */
+#define  PCI_MSI_FLAGS_ENABLE	0x0001	/* MSI feature enabled */
+#define  PCI_MSI_FLAGS_QMASK	0x000e	/* Maximum queue size available */
+#define  PCI_MSI_FLAGS_QSIZE	0x0070	/* Message queue size configured */
+#define  PCI_MSI_FLAGS_64BIT	0x0080	/* 64-bit addresses allowed */
+#define  PCI_MSI_FLAGS_MASKBIT	0x0100	/* Per-vector masking capable */
 #define PCI_MSI_RFU		3	/* Rest of capability flags */
 #define PCI_MSI_ADDRESS_LO	4	/* Lower 32 bits */
 #define PCI_MSI_ADDRESS_HI	8	/* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
@@ -309,13 +309,17 @@
 #define PCI_MSI_PENDING_64	20	/* Pending intrs for 64-bit devices */
 
 /* MSI-X registers */
-#define PCI_MSIX_FLAGS		2
-#define  PCI_MSIX_FLAGS_QSIZE	0x7FF
-#define  PCI_MSIX_FLAGS_ENABLE	(1 << 15)
-#define  PCI_MSIX_FLAGS_MASKALL	(1 << 14)
-#define PCI_MSIX_TABLE		4
-#define PCI_MSIX_PBA		8
-#define  PCI_MSIX_FLAGS_BIRMASK	(7 << 0)
+#define PCI_MSIX_FLAGS		2	/* Message Control */
+#define  PCI_MSIX_FLAGS_QSIZE	0x07FF	/* Table size */
+#define  PCI_MSIX_FLAGS_MASKALL	0x4000	/* Mask all vectors for this function */
+#define  PCI_MSIX_FLAGS_ENABLE	0x8000	/* MSI-X enable */
+#define PCI_MSIX_TABLE		4	/* Table offset */
+#define  PCI_MSIX_TABLE_BIR	0x00000007 /* BAR index */
+#define  PCI_MSIX_TABLE_OFFSET	0xfffffff8 /* Offset into specified BAR */
+#define PCI_MSIX_PBA		8	/* Pending Bit Array offset */
+#define  PCI_MSIX_PBA_BIR	0x00000007 /* BAR index */
+#define  PCI_MSIX_PBA_OFFSET	0xfffffff8 /* Offset into specified BAR */
+#define  PCI_MSIX_FLAGS_BIRMASK	(7 << 0)   /* deprecated */
 #define PCI_CAP_MSIX_SIZEOF	12	/* size of MSIX registers */
 
 /* MSI-X entry's format */


  parent reply	other threads:[~2013-04-22 23:11 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22 23:10 [PATCH v4 00/22] PCI: Cache MSI/MSI-X capability offsets, other cleanup Bjorn Helgaas
2013-04-22 23:10 ` [PATCH v4 01/22] [SCSI] megaraid_sas: Use correct #define for MSI-X capability Bjorn Helgaas
2013-04-22 23:52   ` Radford, Adam
2013-04-22 23:54   ` Fwd: " Bjorn Helgaas
2013-04-23  0:25     ` adam radford
2013-04-22 23:10 ` [PATCH v4 02/22] PCI: Use u8, not int, for PM capability offset Bjorn Helgaas
2013-04-22 23:32   ` Rafael J. Wysocki
2013-04-22 23:10 ` [PATCH v4 03/22] PCI: Cache MSI/MSI-X capability offsets in struct pci_dev Bjorn Helgaas
2013-04-22 23:10 ` [PATCH v4 04/22] PCI: Remove MSI/MSI-X cap check in pci_msi_check_device() Bjorn Helgaas
2013-04-22 23:10 ` [PATCH v4 05/22] PCI: Use cached MSI cap while enabling MSI interrupts Bjorn Helgaas
2013-04-22 23:10 ` [PATCH v4 06/22] PCI: Use cached MSI-X cap while enabling MSI-X Bjorn Helgaas
2013-04-22 23:11 ` Bjorn Helgaas [this message]
2013-04-22 23:11 ` [PATCH v4 08/22] PCI: Use cached MSI/MSI-X offsets from dev, not from msi_desc Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 09/22] PCI: Drop msi_control_reg() macro and use PCI_MSI_FLAGS directly Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 10/22] PCI: Drop msi_lower_address_reg() and msi_upper_address_reg() macros Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 11/22] PCI: Drop msi_data_reg() macro Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 12/22] PCI: Drop is_64bit_address() and is_mask_bit_support() macros Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 13/22] PCI: Drop msix_table_offset_reg() and msix_pba_offset_reg() macros Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 14/22] PCI: Use msix_table_size() directly, drop multi_msix_capable() Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 15/22] PCI: Drop msi_mask_reg() and remove drivers/pci/msi.h Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 16/22] PCI: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 17/22] PCI: Remove "extern" from function declarations Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 18/22] xen/pci: Pay attention to PCI_MSIX_TABLE_OFFSET Bjorn Helgaas
2013-04-24 16:34   ` Bjorn Helgaas
2013-04-25  9:40     ` [Xen-devel] " Jan Beulich
2013-04-25  9:40       ` Jan Beulich
2013-04-25 16:42       ` Bjorn Helgaas
2013-04-26  7:16         ` Jan Beulich
2013-04-26  7:16           ` Jan Beulich
2013-04-26 14:50           ` Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 19/22] xen/pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK Bjorn Helgaas
2013-04-24 16:35   ` Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 20/22] xen/pci: Used cached MSI-X capability offset Bjorn Helgaas
2013-04-24 16:35   ` Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 21/22] vfio-pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK Bjorn Helgaas
2013-04-23 20:12   ` Alex Williamson
2013-04-22 23:12 ` [PATCH v4 22/22] vfio-pci: Use cached MSI/MSI-X capabilities Bjorn Helgaas
2013-04-23 20:13   ` Alex Williamson
2013-04-24 17:48 ` [PATCH v4 00/22] PCI: Cache MSI/MSI-X capability offsets, other cleanup Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130422231100.32621.52374.stgit@bhelgaas-glaptop \
    --to=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=shangw@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.