SCO OpenServer
pci_write(D3oddi)
pci_write: pci_writebyte, pci_writeword, pci_writedword --
write data to PCI configuration space
Synopsis
#include <sys/pci.h>
int pci_writebyte(struct pci_devinfo infptr, unsigned short reg,
unsigned char data);
int pci_writeword(struct pci_devinfo infptr, unsigned short reg,
unsigned short data);
int pci_writedword(struct pci_devinfo infptr, unsigned short reg,
unsigned long data);
Description
The
pci_writebyte( ),
pci_writeword "" ,
pci_writedword( )
functions write a byte, word, or 32-bit word (double word)
to a configuration space register.
Arguments
infptr)-
Pointer to a
pci_devinfo(D4oddi)
structure.
to locate a device, and a register offset
reg-
Register to which the data will be written.
data-
Data to be written.
Return Values
A return value of 1 indicates success. 0 indicates failure. A
failure could occur if the device was not found, or the register
offset was invalid or misaligned.
Usage
The register offset must be aligned to correspond with the size of
the data field being written.
In other words, the register offset for
pci_writeword( )
must be 2-byte aligned
and the register offset for
pci_writedword( )
must be 4-byte aligned.
Incorrect alignment will result in a failure.
Context and synchronization
Initialization
context
Hardware applicability
PCI bus
Version applicability
oddi:
3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp
SVR5 DDI compatibility
DDI drivers access PCI configuration information
through the resource manager database.
Use the
cm_getval(D3)
function to access information
supported by the parameters documented on the
cm_params(D5)
manual page and function such as
cm_read_devconfig(D3)
and
cm_write_devconfig(D3)
to access other configuration information.
Note that DDI drivers cannot access
all the PCI configuration information
that SCO OpenServer 5 drivers can access.
References
pci(D4oddi),
pci(HW),
pci_buspresent(D3oddi),
pci_read(D3oddi),
pci_search(D3oddi),
pci_specialcycle(D3oddi)
``PCI'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005