pci_write_config()

Write to the configuration space of a PCI device

Synopsis:

#include <hw/pci.h>

int pci_write_config( void* handle,
                      unsigned offset,
                      unsigned count,
                      size_t size,
                      const void* buff );

Arguments:

handle
The handle returned by pci_attach_device() .
offset
The offset into the configuration space where you want to write the data.
count
The number of objects that you want to write.
size
The size of each object.
buff
A pointer to the data that you want to write.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The pci_write_config() function writes count objects of the specified size from buff at the given offset to the configuration space of the PCI device specified by handle.

You must successfully call pci_attach() before calling any of the other PCI functions.

Returns:

PCI_BAD_REGISTER_NUMBER
The offset specified is invalid.
PCI_BUFFER_TOO_SMALL
The size argument is too large.
PCI_SET_FAILED
An error occurred writing to the configuration space of the device.
PCI_SUCCESS
Success.
PCI_UNSUPPORTED_FUNCT
This device doesn't support writing to its configuration space.
-1
You haven't called pci_attach() , or the call to it failed.

Classification:

QNX Neutrino

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes