[haiku-development] RFC PCI config access API change

  • From: Jérôme Duval <jerome.duval@xxxxxxxxx>
  • To: haiku-development <haiku-development@xxxxxxxxxxxxx>
  • Date: Fri, 21 Jun 2013 21:18:05 +0200

Hi,

to support offsets bigger than 255, I'd like to change the API to
access the PCI configuration space in PCI.h and others.

ATM it is:
uint32 (*read_pci_config)(pci_device *device, uint8 offset, uint8 size);
void (*write_pci_config)(pci_device *device, uint8 offset, uint8 size,
uint32 value);

and would become:
uint32 (*read_pci_config)(pci_device *device, uint16 offset, uint8 size);
void (*write_pci_config)(pci_device *device, uint16 offset, uint8
size, uint32 value);

The main goal is to be able to access the extended config space
available on PCI Express with the same API. We can then read extended
capabilities for each device.

For compatibility, we could also introduce a new bus_managers/pci/v2
interface, or extend the current with new functions.
A function find_pci_extended_capability would be added anyway.

I'd like to hear your comments.

Bye,
Jérôme

Other related posts: