Chapter 6. PCI/PCI-X Configuration Space

Each PCI/PCI-X device has 256 bytes of configuration address space. Sixty-four bytes of this area are standardized as shown in Figure 6-1. For more details regarding these registers, see PCI-X System Architecture or PCI System Architecture.

Figure 6-1. PCI-X Configuration Space

PCI-X Configuration Space

On SGI Altix systems, the following registers in the PCI configuration space should not be used directly by device drivers:

Device drivers have to use the addresses and values provided in the pci_dev structure. For methods of programmatically finding your device pci_dev information, see Chapter 5, “Finding Your PCI Device”.

You can read and write PCI/PCI-X configuration space for your device by using the following PCI configuration space routines:

/usr/include/linux/pci.h:

        int pci_read_config_byte(struct pci_dev *dev,int where,u8 *ptr);
        
        int pci_read_config_word(struct pci_dev *dev,int where,u16 *ptr);

        int pci_read_config_dword(struct pci_dev *dev,int where, u32 *ptr);

        int pci_write_config_byte (struct pci_dev *dev,int where, u8 val);

        int pci_write_config_word (struct pci_dev *dev,int where, u16 val);

        int pci_write_config_word (struct pci_dev *, int where, u32 val);

        int pci_write_config_dword (struct pci_dev *dev,int where, u32 val);

Variables are as follows:
Variable 

Description

*dev 

Pointer to your device pci_dev structure

where 

Byte offset into the PCI configuration space of your device

*ptr 

Address of the location to store the byte read

val 

Value to write into the PCI configuration space of your device