Reads a PCI Configuration register.
#include <sys/pdiagex_dds.h> #include <sys/pdiag_def.h> int32 pdiag_pcicfg_read( device_instance, reg_offset, datasize, data ) pdiag_addr_t device_instance; ulong reg_offset; int datasize; uchar *data;
The pdiag_pcicfg_read() function reads 8, 16, or 32 bits of a PCI Configuration register for this particular resource. The reg_offset parameter contains the register offset into the device's PCI configuration table. The calling application must provide a valid register offset before calling pdiag_pcicfg_read. The returned data is the 8, 16, or 32 bit value read from the PCI register configuration table. All the byte swapping required is performed internally by this function; the calling application must not alter the byte positioning of the data.
The pdiag_pcicfg_read() function can be called from the process environment only.
The pdiag_pcicfg_read function returns one of the following values:
Return Value | Description |
---|---|
0 | Successful return |
-1 | Software error |
The pdiag_pcicfg_write() function.