Reads and writes PCI bus slot configuration registers.
#include <sys/mdio.h>
int pci_cfgrw(bid, md, write_flag) int bid; struct mdio *md; int write_flag;
The pci_cfgrw kernel service provides serialized access to the configuration registers for a PCI bus. To ensure data integrity in a multi-processor environment, a lock is required before accessing the configuration registers. Depending on the value of the write_flag parameter, a read or write to the configuration register is performed at offset md_addr for the device identified by md_sla.
The pci_cfgrw kernel service provides for kernel extensions the same services as the MIOPCFGET and MIOPCFPUT ioctls provides for applications. The pci_cfgrw kernel service can be called from either the process or the interrupt environment.
Returns 0 for successful completion.
ENOMEM | Indicates no memory could be allocated. |
EINVAL | Indicated that the bus, device/function, or size is not valid. |
The pci_cfgrw kernel service is part of the Base Operating System (BOS) Runtime.
Machine Device Driver in AIX Version 4.3 Technical Reference: Kernel and Subsystems Volume 2