io_nodevice(3K) DG/UX 5.4R3.00 io_nodevice(3K)
NAME
ionodevice: ionodeviceopen, ionodeviceclose,
ionodevicereadwrite, ionodeviceselect, ionodeviceioctl,
ionodevicestartio, ionodeviceconfigure, ionodevicedeconfigure,
ionodevicenametodevice, ionodevicedevicetoname,
ionodeviceopendump, ionodevicewritedump, ionodevicereaddump,
ionodeviceclosedump, ionodevicepowerfail, ionodevicemmap,
ionodevicemunmap, ionodevicemaddmap,
ionodeviceserviceinterrupt - prewritten stub routines for driver
interface routines
SYNOPSIS
#include "/usr/src/uts/aviion/ii/iio.h"
statustype ionodeviceclose (devicehandle, channelflags)
iodevicehandletype devicehandle; /*READ ONLY*/
iochannelflagstype channelflags; /*READ ONLY*/
statustype ionodeviceclosedump {
iodevicehandletype devicehandle READONLY }
statustype ionodeviceconfigure (devicenameptr, majornumber)
charptrtype devicenameptr; /*READ ONLY*/
iomajordevicenumbertype majornumber; /*READ ONLY*/
statustype ionodevicedeconfigure (devicenameptr)
charptrtype devicenameptr; /*READ ONLY*/
statustype ionodevicedevicetoname (devicenumber, nameptr,
size)
iodevicenumbertype devicenumber; /*READ ONLY*/
charptrtype nameptr; /*WRITE ONLY*/
uint32type size; /*READ ONLY*/
statustype ionodeviceioctl (devicehandle, command, parameter,
returnvalueptr)
iodevicehandletype devicehandle; /*READ ONLY*/
bit32etype command; /*READ ONLY*/
bit32etype parameter; /*READ/WRITE*/
int32eptrtype parameter; /*WRITE ONLY*/
statustype ionodevicemaddmap ()
statustype ionodevicemmap ()
statustype ionodevicemunmap ()
statustype ionodevicenametodevice (devicenameptr, numberptr)
charptrtype devicenameptr; /*READ ONLY*/
iodevicenumberptrtype numberptr; /*WRITE ONLY*/
Licensed material--property of copyright holder(s) 1
io_nodevice(3K) DG/UX 5.4R3.00 io_nodevice(3K)
statustype ionodeviceopen (devicenumber, channelflags,
devicehandleptr)
iodevicenumbertype devicenumber; /*READ ONLY*/
iochannelflagstype channelflags; /*READ ONLY*/
iodevicehandleptrtype devicehandleptr; /*WRITE ONLY*/
statustype ionodeviceopendump {
charptrtype devicename, READONLY
iodevicehandleptrtype devicehandleptr, READONLY }
statustype ionodevicepowerfail ()
statustype ionodevicereaddump {
iodumprequestinfoptrtype dumprbptr READONLY }
statustype ionodevicereadwrite (requestinfoptr)
iorequestinfoptrtype requestinfoptr; /*READ ONLY*/
void ionodeviceselect (devicehandle, select, ecptr, intentptr)
iodevicehandletype devicehandle; /*READ ONLY*/
booleantype select; /*READ ONLY*/
vpecptrtype ecptr; /*READ ONLY*/
ioselectintentptrtype intentptr; /*READ WRITE*/
void ionodeviceserviceinterrupt (devicecode, deviceclass)
iodevicecodetype devicecode; /*READ ONLY*/
ucdeviceclassenumtype deviceclass; /*READ ONLY*/
statustype ionodevicestartio (oprecordptr)
iooperationrecordptrtype oprecordptr; /*READ ONLY*/
statustype ionodevicewritedump {
iodumprequestinfoptrtype dumprbptr READ ONLY }
where:
channelflags A set of flags specifying whether the I/O to the
device will be reads, writes, or both; or the flags
with which the device was opened.
command A command to the device. The interpretation of the
command is specific to the driver.
deviceclass The device class of the interrupting device.
devicecode The device code of the interrupting device.
devicehandle A device's device handle.
devicehandleptr A pointer to the location where the device handle
is to be returned.
devicename The character string name of the device to which
the dump is being written.
devicenameptr A pointer to a null-terminated string specifying a
device name.
devicenumber The major and minor device numbers of a device.
dumprbptr Pointer to the dump request information structure.
ecptr A pointer to the eventcounter to be advanced by the
driver when the select is satisfied if it is not
immediately satisfied.
Licensed material--property of copyright holder(s) 2
io_nodevice(3K) DG/UX 5.4R3.00 io_nodevice(3K)
intentptr On input, a specifier indicating whether a select
is to be instituted for a combination of read,
write, or exceptional conditions.
majornumber The major device number on which the device is to
be configured.
nameptr A pointer to where the null-terminated character
string name is to be written.
numberptr A pointer to where the corresponding device number
is to be written.
oprecordptr A pointer to the operation record for the
asynchronous request. The operation record
contains fields indicating the minor device that is
the target of the operation, the operation to be
performed, the offset on the device from which the
operation is to commence, the size of the transfer,
the address of the main memory buffer, and the
address of the routine that is to be called when
the operation completes.
parameter An argument to the command. The interpretation of
the parameter is specific to the driver and the
command. The parameter may be used to transfer
information in either direction between the caller
and the device. In particular, it may be a pointer
to a buffer supplied by the caller.
requestinfoptr A pointer to a packet containing the information
necessary to specify a read or write request.
returnvalueptr A pointer to the value to be returned to the user.
select A boolean value, TRUE, if this is the start of a
select operation (conditions that are not
immediately TRUE should be recorded so that the
eventcounter can be advanced when they become
TRUE), FALSE if this is the end of a select
operation (any previously remembered conditions
should be forgotten).
size The maximum number of bytes, including the
terminating null, that is to be written to
nameptr.
DESCRIPTION
This man page describes pre-written stub routines that drivers can
use for required driver interface routines. The following routines
are described:
Name Handle attempt to ...
ionodeviceopen Open a nonexistent device
ionodeviceclose Close a device for which no driver exists
ionodevicereadwrite Read from or write to a driverless device
ionodeviceselect Do a select operation on driverless device
ionodeviceioctl Do an ioctl operation on driverless device
ionodevicestartio Do startio operation on driverless device
ionodeviceconfigure Configure a nonexistent device
ionodevicedeconfigure Deconfigure a nonexistent driver
ionodevicenametodevice Convert name to device for nonexistent
device
ionodevicedevicetoname Convert device to name for nonexistent
Licensed material--property of copyright holder(s) 3
io_nodevice(3K) DG/UX 5.4R3.00 io_nodevice(3K)
device
ionodeviceopendump Dump to an undumpable device
ionodevicewritedump Dump to a nonexistent device
ionodevicereaddump Read dump data from a nonexistent device
ionodeviceclosedump Close a nonexistent dump device
ionodevicepowerfail Restart a nonexistent device
ionodevicemmap Call mmap on inappropriate device
ionodevicemunmap Call munmap on inappropriate device
ionodevicemaddmap Call maddmap on inappropriate device
ionodeviceserviceinterrupt
Send interrupt from unconfigured device
This man page lists pre-written stub routines that drivers may use
for required driver interface routines. Instead of writing your own
routine, you can use one of the routines listed anytime your driver
does not process the I/O operation indicated in the routine's name.
For example, if your device cannot be used as a dump device, you can
use the ionodeviceopendump routine instead of supplying your own
open dump stub. To use the nodevice stub, you simply supply the
nodevice routine's name in the driver's routines vector structure.
The nodevice routines support both block and character operations so
they can serve as stubs for both types of requests. The routines in
this section generally return at least an error and, in some cases, a
panic. Before you use one of these routines, make sure its error
return is acceptable and appropriate for your device.
Constants and Data Structures
These routines do not require special constants or data structures.
ionodeviceclose
This routine handles erroneous I/O operations. Either the driver
does not support this operation or the device does not exist.
Calling this routine will cause a system fatal error.
Panic is invoked.
ionodeviceclosedump
This routine handles devices that do not exist. It is a system fatal
error to call this routine.
This routine should never be called, because ionodeviceopendump
always fails.
ionodeviceconfigure
This routine returns an error if an attempt is made to configure a
nonexistent device.
This routine always returns an error.
ionodevicedeconfigure
This routine returns an error if an attempt is made to deconfigure a
nonexistent device.
Licensed material--property of copyright holder(s) 4
io_nodevice(3K) DG/UX 5.4R3.00 io_nodevice(3K)
This routine always returns an error.
ionodevicedevicetoname
This routine returns an error if an attempt is made to do device-to-
name conversion on a nonexistent device.
This routine always returns an error.
ionodeviceioctl
This routine handles erroneous I/O operations. Either the driver
does not support this operation or the device does not exist.
Calling this routine will cause a system fatal error.
This routine causes a system panic.
ionodevicemaddmap
This routine increments reference counts to memory-mapped sections.
The errno EINVAL is returned.
EINVAL is returned.
ionodevicemmap
This routine handles the mmap system call. The errno EINVAL is
returned.
This routine always returns an error.
ionodevicemunmap
This routine handles the munmap system call. The errno EINVAL is
returned.
This routine always returns an error.
ionodevicenametodevice
This routine returns an error if an attempt is made to do name-to-
device conversion on a nonexistent device.
This routine always returns an error.
ionodeviceopen
This routine returns an error if an attempt is made to open a
nonexistent device.
This routine returns a status indicating that the device does not
exist. Because ionodeviceopen always fails, no device handle is
ever returned.
ionodeviceopendump
This routine returns an error if an attempt is made to dump to a
nonexistent device or to a device that does not support dumps.
This routine always returns an error.
Licensed material--property of copyright holder(s) 5
io_nodevice(3K) DG/UX 5.4R3.00 io_nodevice(3K)
ionodevicepowerfail
This routine simply returns OK, because there is nothing to do in
order to perform powerfail restart on nodevice.
The status OK is returned.
ionodevicereaddump
This routine handles devices that do not exist. It is a system fatal
error to call this function.
This routine should never be called, because ionodeviceopendump
always fails.
ionodevicereadwrite
This routine handles erroneous I/O operations. Either the driver
does not support this operation or the device does not exist.
Calling this routine will cause a system fatal error.
Panic is invoked.
ionodeviceselect
This routine handles erroneous I/O operations. Either the driver
does not support this operation or the device does not exist.
Calling this routine will cause a system fatal error.
Panic is invoked.
ionodeviceserviceinterrupt
This routine handles unexpected interrupts from devices that are not
configured into the kernel.
This routine runs at interrupt level. It handles interrupts from
devices that are not configured and, therefore, which should not be
generating interrupts. This routine does not obey the standard
interface for service interrupt routines. Because it must service
interrupts from all devices, it uses a device code as the argument
instead of a device information structure pointer.
ionodevicestartio
This routine handles erroneous I/O operations. Either the driver
does not support this operation or the device does not exist.
Calling this routine will cause a system fatal error.
This routine causes a system panic.
ionodevicewritedump
This routine handles devices that do not exist. It is a system fatal
error to call this routine.
This routine should never be called, because ionodeviceopendump
always fails.
DIAGNOSTICS
Licensed material--property of copyright holder(s) 6
io_nodevice(3K) DG/UX 5.4R3.00 io_nodevice(3K)
Return Value
For ionodeviceconfigure:
IOENXIODEVICENAMENOTRECOGNIZED
This status is always returned.
For ionodevicedeconfigure:
IOENXIODEVICENAMENOTRECOGNIZED
This status is always returned.
For ionodevicedevicetoname:
IOENXIODEVICEISNOTCONFIGURED
This status is always returned.
For ionodevicemaddmap:
IOEINVALMMAPNOTSUPPORTED
The maddmap operation is not supported for this device.
For ionodevicemmap:
IOEINVALMMAPNOTSUPPORTED
The mmap operation is not supported for this device.
For ionodevicemunmap:
IOEINVALMUNMAPNOTSUPPORTED
The munmap operation is not supported for this device.
For ionodevicenametodevice:
IOENXIODEVICENAMENOTRECOGNIZED
This status is always returned.
For ionodeviceopen:
IOENXIODEVICEDOESNOTEXIST
This value is always returned.
For ionodeviceopendump:
IOSTATUSDUMPNOTSUPPORTED
This status indicates that the device does not support
dumps. This status is always returned.
For ionodevicepowerfail:
OK This value is always returned.
For the other routines: none.
Errors
None.
Abort Conditions
The ionodeviceclose routine always panics with the following panic
code:
IOPANICNODEVICECLOSE An attempt was made to close a
major device number for which no driver exists.
For ionodevicereadwrite, panic is always called with the following
panic code:
Licensed material--property of copyright holder(s) 7
io_nodevice(3K) DG/UX 5.4R3.00 io_nodevice(3K)
IOPANICNODEVICEREADWRITE
An attempt was made to do a read or write operation on
a major device number for which no driver exists.
For ionodeviceselect, panic is always invoked with the following
panic code:
IOPANICNODEVICESELECT
An attempt was made to do a select operation on a
device for which no driver exists.
For ionodeviceioctl, panic is always invoked with the following
panic code:
IOPANICNODEVICEIOCTL
An attempt was made to do an ioctl operation on a
device for which no driver exists.
For ionodevicestartio, panic is always invoked with the following
panic code:
IOPANICNODEVICESTARTIO
An attempt was made to do a start_io operation on a
device for which no driver exists.
For ionodevicewritedump, panic may be invoked with the following
error code:
IOPANICNODEVICEWRITEDUMP An attempt was made to
write dump information to a nonexistent device.
For ionodevicereaddump, panic may be invoked with the following
error code:
IOPANICNODEVICEREADDUMP
An attempt was made to read dump information from a
nonexistent device.
For ionodeviceclosedump, panic may be invoked with the following
error code:
IOPANICNODEVICECLOSEDUMP
An attempt was made to close a nonexistent dump device.
For ionodeviceserviceinterrupt, panic may be invoked with the
following error code:
IOPANICNODEVICEINTERRUPTOVERRUN
Too many unexpected interrupts were received in too
short a time. This panic probably indicates the
existence of a hardware problem that is generating
spurious interrupts.
For the other routines: none.
SEE ALSO
devicedriver(3K).
Programming in the DG/UX Kernel Environment.
Licensed material--property of copyright holder(s) 8