summaryrefslogtreecommitdiff
path: root/sys/include/dev/pci/pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include/dev/pci/pci.h')
-rw-r--r--sys/include/dev/pci/pci.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/include/dev/pci/pci.h b/sys/include/dev/pci/pci.h
index 497bfc7..144b500 100644
--- a/sys/include/dev/pci/pci.h
+++ b/sys/include/dev/pci/pci.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2023-2024 Ian Marco Moffett and the Osmora Team.
+ * Copyright (c) 2023-2025 Ian Marco Moffett and the Osmora Team.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -54,20 +54,29 @@ struct pci_device {
uint8_t slot;
uint8_t func;
+ uint16_t segment;
uint16_t msix_capoff;
uint16_t device_id;
uint16_t vendor_id;
uint8_t pci_class;
uint8_t pci_subclass;
uint8_t prog_if;
+ uint8_t hdr_type;
+ uint8_t pci_express : 1;
+
+ uint8_t pri_bus;
+ uint8_t sec_bus;
+ uint8_t sub_bus;
+
uintptr_t bar[6];
uint8_t irq_line;
+
TAILQ_ENTRY(pci_device) link;
};
struct msi_intr {
const char *name;
- void(*handler)(void *);
+ int(*handler)(void *);
};
pcireg_t pci_readl(struct pci_device *dev, uint32_t offset);
@@ -77,6 +86,9 @@ int pci_map_bar(struct pci_device *dev, uint8_t barno, void **vap);
void pci_writel(struct pci_device *dev, uint32_t offset, pcireg_t val);
int pci_enable_msix(struct pci_device *dev, const struct msi_intr *intr);
+void pci_add_device(struct pci_device *dev);
+
+void pci_msix_eoi(void);
int pci_init(void);
#endif /* !_PCI_H_ */