[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Understanding the Diagnostic Subsystem for AIX

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:
Size
Type
8 bits
IOCHAR8
16 bits
IOSHORT16
32 bits
IOLONG32
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

Related Information

The pdiag_pcicfg_read subroutine.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]