summaryrefslogtreecommitdiff
path: root/drivers/pci.h
blob: 855a7dee21d61dcf932095e259de6dbce2e96598 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdint.h>

struct PCI_DEVICE {
  uint16_t vendor;
  uint16_t device;
  uint8_t bus;
  uint8_t slot;
};

uint32_t pci_config_read32(const struct PCI_DEVICE *device, uint8_t func,
                           uint8_t offset);
void pci_config_write32(const struct PCI_DEVICE *device, uint8_t func,
                            uint8_t offset, uint32_t data);

int pci_populate_device_struct(uint16_t vendor, uint16_t device,
                               struct PCI_DEVICE *pci_device);