device_probing(3K) DG/UX R4.11MU05 device_probing(3K)
NAME
deviceprobing: iodofirstshortboardaccess,
iodofirstlongboardaccess, ioperformreset - probe for and reset
devices
SYNOPSIS
#include "/usr/src/uts/aviion/ii/iuc.h"
#include "/usr/src/uts/aviion/ii/iio.h"
statustype iodofirstshortboardaccess (
bit16eptrtype registerptr, /*READWRITE*/
bit16eptrtype registercontentsptr, /*READWRITE*/
booleantype writetoregister /*READONLY*/
)
statustype iodofirstlongboardaccess (
bit32eptrtype registerptr, /*READWRITE*/
bit32eptrtype registercontentsptr, /*READWRITE*/
booleantype writetoregister /*READONLY*/
)
void ioperformreset (
ucresetenumtype resettype /*READONLY*/
)
where:
registercontentsptr
A pointer to a 16- or 32-bit read/write buffer.
For a write operation, the routine writes the con
tents of this buffer to the register. For a read
operation, the routine stores in this buffer the
data read from the register.
registerptr Pointer to register on the board to be accessed.
writetoregister A boolean value indicating whether a routine is
reading from or writing to a register. TRUE indi
cates write; FALSE indicates read.
resetvariety An enumeration specifying which type of reset is
to be done.
DESCRIPTION
The following routines are described in this man page:
iodofirstshortboardaccess
Check 16-bit-register board's presence
iodofirstlongboardaccess
Check 32-bit-register board's presence
ioperformreset
Perform specified type of reset
A device driver's driverconfigure routine is responsible for verify
ing that the named device is attached and working. Often, the only
way to verify a device is to read various memory-mapped device con
trol registers that will contain known values if the device in ques
tion is present, but will generate a memory fault otherwise. Since
such a fault will cause a system panic or hang, it is important to
use the kernel-supplied routines for the first such register access.
These two routines are iodofirstlongboardaccess (for 32-bit reg
isters) and iodofirstshortboardaccess (for 16-bit registers).
Both return the error IOENXIODEVICEDOESNOTEXIST if the register
(and thus, the device) does not exist. Note that if you must map the
device registers (as described in memoryallocation(3K)), the mapping
must be in effect before trying to access the device.
Some types of integrated devices also need to be reinitialized to a
known state before making them available to the rest of the system.
The ioperformreset routine performs the specified type of device
reset. It uses the clock and await mechanisms, so it should not be
used in an environment where they are unavailable (for example, dur
ing shutdown). Reset is only supported for certain types of inte
grated devices; see the enumerated type ucresetenumtype in
/usr/src/uts/aviion/ii/iuc.h for details.
DIAGNOSTICS
Return Value
For iodofirstlongboardaccess:
OK The register was accessed successfully.
IOENXIODEVICEDOESNOTEXIST
The board is not accessible.
For iodofirstshortboardaccess:
OK The register was accessed successfully.
IOENXIODEVICEDOESNOTEXIST
The board is not accessible.
For ioperformreset:
None.
Errors
None.
Abort Conditions
For ioperformreset, panic may be invoked with the following error
codes:
IOPANICBADRESETTYPE
The parameter passed is not recognizable.
For the other routines: none.
SEE ALSO
deviceconfiguration(3K), memoryallocation(3K).
Programming in the DG/UX Kernel Environment.
Licensed material--property of copyright holder(s)