device_addressing(3K) DG/UX R4.11MU05 device_addressing(3K)
NAME
deviceaddressing: iocheckdevicespec, ioforgetdevicespec,
iotranslatedeviceclassaddress,
ioincrementdeviceclassrefcount,
iodecrementdeviceclassrefcount - manage device addresses
SYNOPSIS
#include "/usr/src/uts/aviion/ii/iuc.h"
#include "/usr/src/uts/aviion/ii/iio.h"
statustype iocheckdevicespec (
opaqueptrtype deviceaddress, /*READONLY*/
ucdeviceclassenumtype deviceclass, /*READONLY*/
iodevicecodetype devicecode /*READONLY*/
)
statustype ioforgetdevicespec (
opaqueptrtype deviceaddress, /*READONLY*/
ucdeviceclassenumtype deviceclass, /*READONLY*/
iodevicecodetype devicecode /*READONLY*/
)
statustype iotranslatedeviceclassaddress (
ucdeviceclassenumtype deviceclass, /*READONLY*/
physicaladdresstype physicaladdress, /*READONLY*/
physicaladdressptrtype xlatedaddressptr /*WRITEONLY*/
)
void ioincrementdeviceclassrefcount (
ucdeviceclassenumtype deviceclass /*READONLY*/
)
void iodecrementdeviceclassrefcount (
ucdeviceclassenumtype deviceclass /*READONLY*/
)
where:
deviceclass The device class of a particular device.
devicecode The device code of a particular device.
deviceaddress Address of the primary registers for a particular
device.
physicaladdress A physical address jumpered onto a VME controller.
xlatedaddressptr Pointer to a physical address to be filled in with
the device-class-specific translation of the
jumpered physical address parameter.
DESCRIPTION
The following routines are described in this man page:
iocheckdevicespec
Check if the address and device code are being used within a
device class
ioforgetdevicespec
Release a device specification
iotranslatedeviceclassaddress
Translate a jumpered physical address to the physical address
that it maps to under the given device class
ioincrementdeviceclassrefcount
Tell a device class that it now has one more device configured
in it
iodecrementdeviceclassrefcount
Tell a device class that it now has one fewer device config
ured in it
Once a device driver's driverconfigure routine has verified that the
device being configured really does exist, the driver can use
iocheckdevicespec to check that the device's address and device
code are not already in use within the given device class. If both
the address and device code are not in use in that device class,
iocheckdevicespec will reserve them for the current driver. Such
address and device code validation will not prevent hardware overlap
of registers or RAM areas, but it does help avoid the most common us
er errors in device naming.
The ioforgetdevicespec routine releases (that is, forgets) a de
vice specification that was claimed as the result of a previous call
to the iocheckdevicespec routine. When a device is deconfigured,
the deviceaddress claimed for the device must be freed by calling
this routine. If you do not free the device address, future calls to
iocheckdevicespec using this device address will fail.
The iotranslatedeviceclassaddress routine translates a jumpered
physical address to the physical address that it maps to under the
given device class. This routine is needed for determining the ad
dress of control registers of VME devices on secondary VME channels.
The ioincrementdeviceclassrefcount and
iodecrementdeviceclassrefcount routines control the number of
references (i.e., configured child devices) to a device class device
(such as a VME channel). Such a parent device cannot be deconfigured
until its reference count drops to zero.
DIAGNOSTICS
Return Value
For iocheckdevicespec:
OK The address and device code are not already in use.
IOENXIODEVICEISALREADYCONFIGURED
The address or device code are already in use.
For ioforgetdevicespec:
OK The address/device code pair is freed.
IOENXIODEVICEISNOTCONFIGURED
The address/device code to be freed was not found.
For iotranslatedeviceclassaddress:
OK The physical address was successfully translated.
IOENXIOINVALIDDEVICECLASS
An invalid or unregistered device class was passed in
as input.
For the other routines: none.
Errors
None.
Abort Conditions
None.
SEE ALSO
deviceconfiguration(3K).
Programming in the DG/UX Kernel Environment.
Licensed material--property of copyright holder(s)