Skip to content

Commit

Permalink
pcie: msi: add generic MSI vector entry
Browse files Browse the repository at this point in the history
Define a generic MSI vector entry to be used with the Generic PCIe
Controller API.

Signed-off-by: Neil Armstrong <[email protected]>
  • Loading branch information
superna9999 authored and carlescufi committed Mar 25, 2022
1 parent 318999d commit 4321547
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions include/drivers/pcie/msi.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@
extern "C" {
#endif

#ifdef CONFIG_PCIE_CONTROLLER
struct msi_vector_generic {
unsigned int irq;
uint32_t address;
uint16_t eventid;
unsigned int priority;
};

typedef struct msi_vector_generic arch_msi_vector_t;

#define PCI_DEVID(bus, dev, fn) ((((bus) & 0xff) << 8) | (((dev) & 0x1f) << 3) | ((fn) & 0x07))
#define PCI_BDF_TO_DEVID(bdf) PCI_DEVID(PCIE_BDF_TO_BUS(bdf), \
PCIE_BDF_TO_DEV(bdf), \
PCIE_BDF_TO_FUNC(bdf))

#endif

struct msix_vector {
uint32_t msg_addr;
uint32_t msg_up_addr;
Expand Down

0 comments on commit 4321547

Please sign in to comment.