2 * Copyright 2006, Marcus Overhagen. All rights reserved.
4 * Distributed under the terms of the MIT License.
6 #ifndef __PCI_CONTROLLER_H
7 #define __PCI_CONTROLLER_H
9 #include <SupportDefs.h>
11 typedef struct pci_controller
13 // read PCI config space
14 status_t (*read_pci_config
)(void *cookie
,
15 uint8 bus
, uint8 device
, uint8 function
,
16 uint16 offset
, uint8 size
, uint32
*value
);
18 // write PCI config space
19 status_t (*write_pci_config
)(void *cookie
,
20 uint8 bus
, uint8 device
, uint8 function
,
21 uint16 offset
, uint8 size
, uint32 value
);
23 status_t (*get_max_bus_devices
)(void *cookie
, int32
*count
);
25 status_t (*read_pci_irq
)(void *cookie
,
26 uint8 bus
, uint8 device
, uint8 function
,
27 uint8 pin
, uint8
*irq
);
29 status_t (*write_pci_irq
)(void *cookie
,
30 uint8 bus
, uint8 device
, uint8 function
,
31 uint8 pin
, uint8 irq
);
40 status_t
pci_controller_init(void);
41 status_t
pci_controller_add(pci_controller
*controller
, void *cookie
);