From: Zhao, Yu Date: Thu, 3 Jul 2008 09:39:41 +0000 (+0800) Subject: Alternative Routing-ID Interpretation capability support X-Git-Tag: v3.0.1~9 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=38190363b8577e656e92d1360c08faaf776b575c;p=pciutils.git Alternative Routing-ID Interpretation capability support Signed-off-by: Yu Zhao lib/header.h | 11 +++++++++++ lspci.c | 22 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) --- diff --git a/lib/header.h b/lib/header.h index d2ad400..209e60f 100644 --- a/lib/header.h +++ b/lib/header.h @@ -219,6 +219,7 @@ #define PCI_EXT_CAP_ID_RBCB 0x0a /* Root Bridge Control Block */ #define PCI_EXT_CAP_ID_VNDR 0x0b /* Vendor specific */ #define PCI_EXT_CAP_ID_ACS 0x0d /* Access Controls */ +#define PCI_EXT_CAP_ID_ARI 0x0e /* Alternative Routing-ID Interpretation */ /* Power Management Registers */ @@ -941,6 +942,16 @@ #define PCI_ACS_CTRL_TRANS 0x0040 /* ACS Direct Translated P2P Enable */ #define PCI_ACS_EGRESS_CTRL 0x08 /* Egress Control Vector */ +/* Alternative Routing-ID Interpretation */ +#define PCI_ARI_CAP 0x04 /* ARI Capability Register */ +#define PCI_ARI_CAP_MFVC 0x0001 /* MFVC Function Groups Capability */ +#define PCI_ARI_CAP_ACS 0x0002 /* ACS Function Groups Capability */ +#define PCI_ARI_CAP_NFN(x) (((x) >> 8) & 0xff) /* Next Function Number */ +#define PCI_ARI_CTRL 0x06 /* ARI Control Register */ +#define PCI_ARI_CTRL_MFVC 0x0001 /* MFVC Function Groups Enable */ +#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ +#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ + /* * The PCI interface treats multi-function devices as independent * devices. The slot/function address of each device is encoded diff --git a/lspci.c b/lspci.c index ce6d54a..3f29474 100644 --- a/lspci.c +++ b/lspci.c @@ -1558,6 +1558,25 @@ cap_acs(struct device *d, int where) FLAG(w, PCI_ACS_CTRL_TRANS)); } +static void +cap_ari(struct device *d, int where) +{ + u16 w; + + printf("Alternative Routing-ID Interpretation (ARI)\n"); + if (!config_fetch(d, where + PCI_ARI_CAP, 4)) + return; + + w = get_conf_word(d, where + PCI_ARI_CAP); + printf("\t\tARICap:\tMFVC%c ACS%c, Next Function: %d\n", + FLAG(w, PCI_ARI_CAP_MFVC), FLAG(w, PCI_ARI_CAP_ACS), + PCI_ARI_CAP_NFN(w)); + w = get_conf_word(d, where + PCI_ARI_CTRL); + printf("\t\tARICtl:\tMFVC%c ACS%c, Function Group: %d\n", + FLAG(w, PCI_ARI_CTRL_MFVC), FLAG(w, PCI_ARI_CTRL_ACS), + PCI_ARI_CTRL_FG(w)); +} + static void show_ext_caps(struct device *d) { @@ -1616,6 +1635,9 @@ show_ext_caps(struct device *d) case PCI_EXT_CAP_ID_ACS: cap_acs(d, where); break; + case PCI_EXT_CAP_ID_ARI: + cap_ari(d, where); + break; default: printf("#%02x\n", id); break;