pdiag_pcicfg_write
Purpose
Writes to a PCI Configuration register.
Syntax
#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;
Description
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.
Execution Environment
The pdiag_pcicfg_write() function can be called from the process environment only.
Parameters
Parameter | Description |
---|---|
device_instance | Pointer to the string name of the specific device to write. |
reg_offset | Contains the offset within the PCI configuration table register to be written. |
datasize | The data size will be specified as follows:
|
data | Contains the value to be written to a specific PCI register.
Note: The size of the value must be specified in the datasize parameter
and must be IOCHAR8, IOSHORT16, or IOLONG32.
|
Return Value
The pdiag_pcicfg_write function returns one of the following values:
Return Value | Description |
---|---|
0 | Successful return |
-1 | Software error |