Our current approach to dealing with PCI devices is not good enough.
PCI Device after listing does not know it's own device number and at which bus it is present. This leads to problems with reading device configuration space later in drivers.
Also PCI configuration space is divided into two blocks - 64 bytes are mandatory for all devices, but later additional 192 bytes are available for devices. This additional space is used for device specific configuration. (For example: PCI ATA controller will use some of this space to configure timings).
Things to change:
[x] - Change current pci_device to pci_configuration_space or something similar.
[x] - Add new PCI Device that will also contain bus and device numbers.
[x] - Change current code to use new changes.
[x] - Possibly retain backwards compatibility with previous functions (W.I.P stage, still figuring out who used what and where).
[x] - Add configuration space read/write functions for better management.
Our current approach to dealing with PCI devices is not good enough. PCI Device after listing does not know it's own device number and at which bus it is present. This leads to problems with reading device configuration space later in drivers.
Also PCI configuration space is divided into two blocks - 64 bytes are mandatory for all devices, but later additional 192 bytes are available for devices. This additional space is used for device specific configuration. (For example: PCI ATA controller will use some of this space to configure timings).
Things to change: