lkml.org 
[lkml]   [2004]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] pciutils: Support for MSI-X capability
From
Date
    Martin> Applied and will appear in -test6 soon.

Martin> Could you please add a couple of comments to the
Martin> capability defines in header.h?

Thanks, sorry about leaving out the comments. Here is a patch. I
also added _CAP_ to the capability register defines so that I match
the naming convention better.

Best,
Roland

Index: pciutils-2.1.99-test6/lib/header.h
===================================================================
--- pciutils-2.1.99-test6.orig/lib/header.h 2004-06-27 04:38:42.000000000 -0700
+++ pciutils-2.1.99-test6/lib/header.h 2004-06-27 10:01:04.000000000 -0700
@@ -727,12 +727,12 @@
#define PCI_EXP_RTSTA 0x20 /* Root Status */

/* MSI-X */
-#define PCI_MSIX_ENABLE 0x8000
-#define PCI_MSIX_MASK 0x4000
-#define PCI_MSIX_TABSIZE 0x03ff
-#define PCI_MSIX_TABLE 4
-#define PCI_MSIX_PBA 8
-#define PCI_MSIX_BIR 0x7
+#define PCI_MSIX_CAP_ENABLE 0x8000 /* MSI-X enabled */
+#define PCI_MSIX_CAP_MASK 0x4000 /* All vectors masked */
+#define PCI_MSIX_CAP_TABSIZE 0x03ff /* Mask for (table_size - 1) */
+#define PCI_MSIX_TABLE 4 /* Vector table offset/BAR register */
+#define PCI_MSIX_PBA 8 /* PBA offset/BAR register */
+#define PCI_MSIX_BIR_MASK 0x7 /* Mask of BAR index for table/PBA */

/*
* The PCI interface treats multi-function devices as independent
Index: pciutils-2.1.99-test6/lspci.c
===================================================================
--- pciutils-2.1.99-test6.orig/lspci.c 2004-06-27 04:41:39.000000000 -0700
+++ pciutils-2.1.99-test6/lspci.c 2004-06-27 10:01:13.000000000 -0700
@@ -990,18 +990,18 @@
u32 off;

printf("MSI-X: Enable%c Mask%c TabSize=%d\n",
- FLAG(cap, PCI_MSIX_ENABLE),
- FLAG(cap, PCI_MSIX_MASK),
- (cap & PCI_MSIX_TABSIZE) + 1);
+ FLAG(cap, PCI_MSIX_CAP_ENABLE),
+ FLAG(cap, PCI_MSIX_CAP_MASK),
+ (cap & PCI_MSIX_CAP_TABSIZE) + 1);
if (verbose < 2 || !config_fetch(d, where + PCI_MSIX_TABLE, 8))
return;

off = get_conf_long(d, where + PCI_MSIX_TABLE);
printf("\t\tVector table: BAR=%d offset=%08x\n",
- off & PCI_MSIX_BIR, off & ~PCI_MSIX_BIR);
+ off & PCI_MSIX_BIR_MASK, off & ~PCI_MSIX_BIR_MASK);
off = get_conf_long(d, where + PCI_MSIX_PBA);
printf("\t\tPBA: BAR=%d offset=%08x\n",
- off & PCI_MSIX_BIR, off & ~PCI_MSIX_BIR);
+ off & PCI_MSIX_BIR_MASK, off & ~PCI_MSIX_BIR_MASK);
}

static void
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site