+static void
+cap_acs(struct device *d, int where)
+{
+ u16 w;
+
+ printf("Access Control Services\n");
+ if (!config_fetch(d, where + PCI_ACS_CAP, 4))
+ return;
+
+ w = get_conf_word(d, where + PCI_ACS_CAP);
+ printf("\t\tACSCap:\tSrcValid%c TransBlk%c ReqRedir%c CmpltRedir%c UpstreamFwd%c EgressCtrl%c "
+ "DirectTrans%c\n",
+ FLAG(w, PCI_ACS_CAP_VALID), FLAG(w, PCI_ACS_CAP_BLOCK), FLAG(w, PCI_ACS_CAP_REQ_RED),
+ FLAG(w, PCI_ACS_CAP_CMPLT_RED), FLAG(w, PCI_ACS_CAP_FORWARD), FLAG(w, PCI_ACS_CAP_EGRESS),
+ FLAG(w, PCI_ACS_CAP_TRANS));
+ w = get_conf_word(d, where + PCI_ACS_CTRL);
+ printf("\t\tACSCtl:\tSrcValid%c TransBlk%c ReqRedir%c CmpltRedir%c UpstreamFwd%c EgressCtrl%c "
+ "DirectTrans%c\n",
+ FLAG(w, PCI_ACS_CTRL_VALID), FLAG(w, PCI_ACS_CTRL_BLOCK), FLAG(w, PCI_ACS_CTRL_REQ_RED),
+ FLAG(w, PCI_ACS_CTRL_CMPLT_RED), FLAG(w, PCI_ACS_CTRL_FORWARD), FLAG(w, PCI_ACS_CTRL_EGRESS),
+ 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
+cap_ats(struct device *d, int where)
+{
+ u16 w;
+
+ printf("Address Translation Service (ATS)\n");
+ if (!config_fetch(d, where + PCI_ATS_CAP, 4))
+ return;
+
+ w = get_conf_word(d, where + PCI_ATS_CAP);
+ printf("\t\tATSCap:\tInvalidate Queue Depth: %02x\n", PCI_ATS_CAP_IQD(w));
+ w = get_conf_word(d, where + PCI_ATS_CTRL);
+ printf("\t\tATSCtl:\tEnable%c, Smallest Translation Unit: %02x\n",
+ FLAG(w, PCI_ATS_CTRL_ENABLE), PCI_ATS_CTRL_STU(w));
+}
+
+static void
+cap_sriov(struct device *d, int where)
+{
+ u16 b;
+ u16 w;
+ u32 l;
+
+ printf("Single Root I/O Virtualization (SR-IOV)\n");
+ if (!config_fetch(d, where + PCI_IOV_CAP, 0x3c))
+ return;
+
+ l = get_conf_long(d, where + PCI_IOV_CAP);
+ printf("\t\tIOVCap:\tMigration%c, Interrupt Message Number: %03x\n",
+ FLAG(l, PCI_IOV_CAP_VFM), PCI_IOV_CAP_IMN(l));
+ w = get_conf_word(d, where + PCI_IOV_CTRL);
+ printf("\t\tIOVCtl:\tEnable%c Migration%c Interrupt%c MSE%c ARIHierarchy%c\n",
+ FLAG(w, PCI_IOV_CTRL_VFE), FLAG(w, PCI_IOV_CTRL_VFME),
+ FLAG(w, PCI_IOV_CTRL_VFMIE), FLAG(w, PCI_IOV_CTRL_MSE),
+ FLAG(w, PCI_IOV_CTRL_ARI));
+ w = get_conf_word(d, where + PCI_IOV_STATUS);
+ printf("\t\tIOVSta:\tMigration%c\n", FLAG(w, PCI_IOV_STATUS_MS));
+ w = get_conf_word(d, where + PCI_IOV_INITIALVF);
+ printf("\t\tInitial VFs: %d, ", w);
+ w = get_conf_word(d, where + PCI_IOV_TOTALVF);
+ printf("Total VFs: %d, ", w);
+ w = get_conf_word(d, where + PCI_IOV_NUMVF);
+ printf("Number of VFs: %d, ", w);
+ b = get_conf_byte(d, where + PCI_IOV_FDL);
+ printf("Function Dependency Link: %02x\n", b);
+ w = get_conf_word(d, where + PCI_IOV_OFFSET);
+ printf("\t\tVF offset: %d, ", w);
+ w = get_conf_word(d, where + PCI_IOV_STRIDE);
+ printf("stride: %d, ", w);
+ w = get_conf_word(d, where + PCI_IOV_DID);
+ printf("Device ID: %04x\n", w);
+ l = get_conf_long(d, where + PCI_IOV_SUPPS);
+ printf("\t\tSupported Page Size: %08x, ", l);
+ l = get_conf_long(d, where + PCI_IOV_SYSPS);
+ printf("System Page Size: %08x\n", l);
+ printf("\t\tVF Migration: offset: %08x, BIR: %x\n", PCI_IOV_MSA_OFFSET(l),
+ PCI_IOV_MSA_BIR(l));
+}
+