Writes to a PCI Configuration register.
#include <sys/pdiagex_dds.h> #include <sys/pdiag_def.h> int32 pdiag_pcicfg_write( device_instance, reg_offset, datasize, data ) pdiag_addr_t device_instance; ulong reg_offset; int datasize; uchar data;
The pdiag_pcicfg_write() function writes 8, 16, or 32 bits to a PCI Configuration register for this particular resource. The reg_offset parameter contains the register offset into the device's PCI configuration table. The Test Unit code must provide a valid register offset when calling pdiag_pcicfg_write. The data value is the 8, 16, or 32 bit value to be written to the PCI register configuration table depending on the data size specified in the datasize parameter. 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_write() function can be called from the process environment only.
The pdiag_pcicfg_write function returns one of the following values:
Return Value | Description |
---|---|
0 | Successful return |
-1 | Software error |
The pdiag_pcicfg_read subroutine.