vbos/include/drivers/pci.h
Michael Shaw f0a9ff299b gitignore: add .cpio
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
2026-06-28 17:13:41 +02:00

41 lines
757 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _PCI_H_
#define _PCI_H_
#include <kernel/common.h>
#include <lib/list.h>
struct pci_host {
vaddr_t base;
u16 segment_group;
u8 start_bus;
u8 end_bus;
};
struct pci_device {
struct pci_host *host;
u16 class_major;
u16 class_minor;
u16 vendor;
u16 device_id;
u8 bus;
u8 slot;
u8 func;
paddr_t bar0;
paddr_t bar1;
paddr_t bar2;
paddr_t bar3;
paddr_t bar4;
paddr_t bar5;
};
void pci_register_host(struct pci_host *host);
u32 pci_config_read(struct pci_host *host, u32 bus, u32 slot, u32 func, u32 offset);
void pci_config_write(struct pci_host *host, u32 bus, u32 slot, u32 func, u32 offset, u32 val);
size_t pci_find_device(u16 minor, u16 major, list_t *out);
#endif /* _PCI_H_ */