PCI devices contain three addressable regions: configuration space, I/O ports, and device memory
pci_read_config_[byte|word|dword](struct pci_dev *pdev, int offset, int *value);
and
pci_write_config_[byte|word|dword](struct pci_dev *pdev, int offset, int value);
Only the first 64 bytes of the configuration space are standardized. The device manufacturer defines desired semantics to the rest.
PCI cards have up to six I/O or memory regions. I/O regions contain registers, and memory regions hold data. Video cards, for example, have I/O spaces that accommodate control registers and memory regions that map to frame buffers.
unsigned long pci_resource_[start|len|end|flags] (struct pci_dev *pdev, int bar);
1. Get the I/O base address from the appropriate base address register (bar) in the configuration space:
unsigned long io_base = pci_resource_start(pdev, bar);