io_nodevice(3K) DG/UX R4.11MU05 io_nodevice(3K)
NAME
io_nodevice: io_nodevice_open, io_nodevice_close,
io_nodevice_read_write, io_nodevice_select, io_nodevice_ioctl,
io_nodevice_start_io, io_nodevice_configure, io_nodevice_deconfigure,
io_nodevice_name_to_device, io_nodevice_device_to_name,
io_nodevice_open_dump, io_nodevice_write_dump, io_nodevice_read_dump,
io_nodevice_close_dump, io_nodevice_powerfail, io_nodevice_mmap,
io_nodevice_munmap, io_nodevice_maddmap,
io_nodevice_service_interrupt - prewritten stub routines for driver
interface routines
SYNOPSIS
#include "/usr/src/uts/aviion/ii/i_io.h"
status_type io_nodevice_close (device_handle, channel_flags)
io_device_handle_type device_handle; /*READ ONLY*/
io_channel_flags_type channel_flags; /*READ ONLY*/
status_type io_nodevice_close_dump {
io_device_handle_type device_handle READ_ONLY }
status_type io_nodevice_configure (device_name_ptr, major_number)
char_ptr_type device_name_ptr; /*READ ONLY*/
io_major_device_number_type major_number; /*READ ONLY*/
status_type io_nodevice_deconfigure (device_name_ptr)
char_ptr_type device_name_ptr; /*READ ONLY*/
status_type io_nodevice_device_to_name (device_number, name_ptr,
size)
io_device_number_type device_number; /*READ ONLY*/
char_ptr_type name_ptr; /*WRITE ONLY*/
uint32_type size; /*READ ONLY*/
status_type io_nodevice_ioctl (device_handle, command, parameter,
return_value_ptr)
io_device_handle_type device_handle; /*READ ONLY*/
bit32e_type command; /*READ ONLY*/
bit32e_type parameter; /*READ/WRITE*/
int32e_ptr_type parameter; /*WRITE ONLY*/
status_type io_nodevice_maddmap ()
status_type io_nodevice_mmap ()
status_type io_nodevice_munmap ()
status_type io_nodevice_name_to_device (device_name_ptr, number_ptr)
char_ptr_type device_name_ptr; /*READ ONLY*/
io_device_number_ptr_type number_ptr; /*WRITE ONLY*/
status_type io_nodevice_open (device_number, channel_flags,
device_handle_ptr)
io_device_number_type device_number; /*READ ONLY*/
io_channel_flags_type channel_flags; /*READ ONLY*/
io_device_handle_ptr_type device_handle_ptr; /*WRITE ONLY*/
status_type io_nodevice_open_dump {
char_ptr_type device_name, READ_ONLY
io_device_handle_ptr_type device_handle_ptr, READ_ONLY }
status_type io_nodevice_powerfail ()
status_type io_nodevice_read_dump {
io_dump_request_info_ptr_type dump_rb_ptr READ_ONLY }
status_type io_nodevice_read_write (request_info_ptr)
io_request_info_ptr_type request_info_ptr; /*READ ONLY*/
void io_nodevice_select (device_handle, select, ec_ptr, intent_ptr)
io_device_handle_type device_handle; /*READ ONLY*/
boolean_type select; /*READ ONLY*/
vp_ec_ptr_type ec_ptr; /*READ ONLY*/
io_select_intent_ptr_type intent_ptr; /*READ WRITE*/
void io_nodevice_service_interrupt (device_code, device_class)
io_device_code_type device_code; /*READ ONLY*/
uc_device_class_enum_type device_class; /*READ ONLY*/
status_type io_nodevice_start_io (op_record_ptr)
io_operation_record_ptr_type op_record_ptr; /*READ ONLY*/
status_type io_nodevice_write_dump {
io_dump_request_info_ptr_type dump_rb_ptr READ ONLY }
where:
channel_flags 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.
device_class The device class of the interrupting device.
device_code The device code of the interrupting device.
device_handle A device's device handle.
device_handle_ptr A pointer to the location where the device handle
is to be returned.
device_name The character string name of the device to which
the dump is being written.
device_name_ptr A pointer to a null-terminated string specifying a
device name.
device_number The major and minor device numbers of a device.
dump_rb_ptr Pointer to the dump request information structure.
ec_ptr A pointer to the eventcounter to be advanced by the
driver when the select is satisfied if it is not
immediately satisfied.
intent_ptr On input, a specifier indicating whether a select
is to be instituted for a combination of read,
write, or exceptional conditions.
major_number The major device number on which the device is to
be configured.
name_ptr A pointer to where the null-terminated character
string name is to be written.
number_ptr A pointer to where the corresponding device number
is to be written.
op_record_ptr 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.
request_info_ptr A pointer to a packet containing the information
necessary to specify a read or write request.
return_value_ptr 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
name_ptr.
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 ...
io_nodevice_open Open a nonexistent device
io_nodevice_close Close a device for which no driver exists
io_nodevice_read_write Read from or write to a driverless device
io_nodevice_select Do a select operation on driverless device
io_nodevice_ioctl Do an ioctl operation on driverless device
io_nodevice_start_io Do start_io operation on driverless device
io_nodevice_configure Configure a nonexistent device
io_nodevice_deconfigure Deconfigure a nonexistent driver
io_nodevice_name_to_device Convert name to device for nonexistent
device
io_nodevice_device_to_name Convert device to name for nonexistent
device
io_nodevice_open_dump Dump to an undumpable device
io_nodevice_write_dump Dump to a nonexistent device
io_nodevice_read_dump Read dump data from a nonexistent device
io_nodevice_close_dump Close a nonexistent dump device
io_nodevice_powerfail Restart a nonexistent device
io_nodevice_mmap Call mmap on inappropriate device
io_nodevice_munmap Call munmap on inappropriate device
io_nodevice_maddmap Call maddmap on inappropriate device
io_nodevice_service_interrupt
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 io_nodevice_open_dump 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
system halt. 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.
io_nodevice_close
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.
Halt is invoked.
io_nodevice_close_dump
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 io_nodevice_open_dump
always fails.
io_nodevice_configure
This routine returns an error if an attempt is made to configure a
nonexistent device.
This routine always returns an error.
io_nodevice_deconfigure
This routine returns an error if an attempt is made to deconfigure a
nonexistent device.
This routine always returns an error.
io_nodevice_device_to_name
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.
io_nodevice_ioctl
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 halt.
io_nodevice_maddmap
This routine increments reference counts to memory-mapped sections.
The errno EINVAL is returned.
EINVAL is returned.
io_nodevice_mmap
This routine handles the mmap system call. The errno EINVAL is
returned.
This routine always returns an error.
io_nodevice_munmap
This routine handles the munmap system call. The errno EINVAL is
returned.
This routine always returns an error.
io_nodevice_name_to_device
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.
io_nodevice_open
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 io_nodevice_open always fails, no device handle is
ever returned.
io_nodevice_open_dump
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.
io_nodevice_powerfail
This routine simply returns OK, because there is nothing to do in
order to perform powerfail restart on nodevice.
The status OK is returned.
io_nodevice_read_dump
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 io_nodevice_open_dump
always fails.
io_nodevice_read_write
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.
Halt is invoked.
io_nodevice_select
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.
Halt is invoked.
io_nodevice_service_interrupt
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.
io_nodevice_start_io
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 halt.
io_nodevice_write_dump
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 io_nodevice_open_dump
always fails.
DIAGNOSTICS
Return Value
For io_nodevice_configure:
IO_ENXIO_DEVICE_NAME_NOT_RECOGNIZED
This status is always returned.
For io_nodevice_deconfigure:
IO_ENXIO_DEVICE_NAME_NOT_RECOGNIZED
This status is always returned.
For io_nodevice_device_to_name:
IO_ENXIO_DEVICE_IS_NOT_CONFIGURED
This status is always returned.
For io_nodevice_maddmap:
IO_EINVAL_MMAP_NOT_SUPPORTED
The maddmap operation is not supported for this device.
For io_nodevice_mmap:
IO_EINVAL_MMAP_NOT_SUPPORTED
The mmap operation is not supported for this device.
For io_nodevice_munmap:
IO_EINVAL_MUNMAP_NOT_SUPPORTED
The munmap operation is not supported for this device.
For io_nodevice_name_to_device:
IO_ENXIO_DEVICE_NAME_NOT_RECOGNIZED
This status is always returned.
For io_nodevice_open:
IO_ENXIO_DEVICE_DOES_NOT_EXIST
This value is always returned.
For io_nodevice_open_dump:
IO_STATUS_DUMP_NOT_SUPPORTED
This status indicates that the device does not support
dumps. This status is always returned.
For io_nodevice_powerfail:
OK This value is always returned.
For the other routines: none.
Errors
None.
Abort Conditions
The io_nodevice_close routine always halts with the following halt
code:
IO_PANIC_NODEVICE_CLOSE An attempt was made to close a
major device number for which no driver exists.
For io_nodevice_read_write, halt is always called with the following
halt code:
IO_PANIC_NODEVICE_READ_WRITE
An attempt was made to do a read or write operation on
a major device number for which no driver exists.
For io_nodevice_select, halt is always invoked with the following
halt code:
IO_PANIC_NODEVICE_SELECT
An attempt was made to do a select operation on a
device for which no driver exists.
For io_nodevice_ioctl, halt is always invoked with the following halt
code:
IO_PANIC_NODEVICE_IOCTL
An attempt was made to do an ioctl operation on a
device for which no driver exists.
For io_nodevice_start_io, halt is always invoked with the following
halt code:
IO_PANIC_NODEVICE_START_IO
An attempt was made to do a start_io operation on a
device for which no driver exists.
For io_nodevice_write_dump, halt may be invoked with the following
error code:
IO_PANIC_NODEVICE_WRITE_DUMP An attempt was made to
write dump information to a nonexistent device.
For io_nodevice_read_dump, halt may be invoked with the following
error code:
IO_PANIC_NODEVICE_READ_DUMP
An attempt was made to read dump information from a
nonexistent device.
For io_nodevice_close_dump, halt may be invoked with the following
error code:
IO_PANIC_NODEVICE_CLOSE_DUMP
An attempt was made to close a nonexistent dump device.
For io_nodevice_service_interrupt, halt may be invoked with the
following error code:
IO_PANIC_NODEVICE_INTERRUPT_OVERRUN
Too many unexpected interrupts were received in too
short a time. This halt probably indicates the
existence of a hardware problem that is generating
spurious interrupts.
For the other routines: none.
SEE ALSO
device_driver(3K).
Programming in the DG/UX Kernel Environment.
Licensed material--property of copyright holder(s)