Skip to content
Permalink
Browse files

drivers/pcie/shell: add basic probe for MSI-X capability

This trivial patch extends the PCIe shell to check for and report
on a device's ability to use MSI-X interrupt signaling.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
  • Loading branch information...
Charles E. Youse authored and nashif committed Jun 4, 2019
1 parent baa8e61 commit ea1e19107cfb82c9c1ef1e280cb059431be70f51
Showing with 9 additions and 2 deletions.
  1. +6 −0 drivers/pcie/shell.c
  2. +3 −2 include/drivers/pcie/msi.h
@@ -29,6 +29,12 @@ static void show_msi(const struct shell *shell, pcie_bdf_t bdf)
(data & PCIE_MSI_MCR_64) ? ", 64-bit" : "",
(data & PCIE_MSI_MCR_EN) ? ", enabled" : "");
}

msi = pcie_get_cap(bdf, PCIE_MSIX_CAP_ID);

if (msi) {
shell_fprintf(shell, SHELL_NORMAL, " MSI-X support\n");
}
#endif
}

@@ -73,10 +73,11 @@ extern u16_t pcie_msi_mdr(unsigned int irq);
extern bool pcie_set_msi(pcie_bdf_t bdf, unsigned int irq);

/*
* MSI capability ID in the PCI configuration capability list.
* MSI capability IDs in the PCI configuration capability list.
*/

#define PCIE_MSI_CAP_ID 05U
#define PCIE_MSI_CAP_ID 0x05U
#define PCIE_MSIX_CAP_ID 0x11U

/*
* The first word of the MSI capability is shared with the

0 comments on commit ea1e191

Please sign in to comment.
You can’t perform that action at this time.