write individual bytes to the configuration space of a
device
#include <sys/pci.h>
int _CA_PCI_Write_Config_Byte( unsigned busnum,
unsigned devfuncnum,
unsigned offset,
unsigned cnt,
char *bufptr );
This function writes individual bytes to the configuration space of
the specified device.
The arguments are as follows:
- busnum
- the bus number
- devfuncnum
- the device or function ID
The device number is in bits 7 through 3, and the function number
in bits 2 through 0.
- offset
- the register offset into the configuration space, in the range
0 through 255
- cnt
- the number of bytes to write
- bufptr
- a pointer to a buffer containing the data to be written into the
configuration space
- PCI_SUCCESS
- the device or function was found
- PCI_BAD_REGISTER_NUMBER
- an invalid offset register number was given
Intel
Safety: | |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
When you use the _CA_PCI_... functions:
- Your program must be linked for
privity level 1, and the process must be run by the superuser
(root) or a
setuid program that's owned by the superuser but started by a
regular user.
For more information on privity, see
the cc
-T option or the Linker
PRIVILEGE
option.
- The stack size must be less than 64K.
_CA_PCI_BIOS_Present(),
_CA_PCI_Find_Class(),
_CA_PCI_Find_Device(),
_CA_PCI_GenerateSpecialCycle(),
_CA_PCI_Read_Config_Byte(),
_CA_PCI_Read_Config_DWord(),
_CA_PCI_Read_Config_Word(),
_CA_PCI_Write_Config_DWord(),
_CA_PCI_Write_Config_Word()