DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_device(D4sdi)


sdi_device -- SDI layered device description structure

Syntax

   #include <sys/types.h>
   #include <sys/kmem.h>
   #include <sys/sdi.h>
   #include <sys/ddi.h>

Description

The sdi_device structure used by routines to characterize a device advertised for use in an SDI I/O stack.

Structure definitions

The sdi_device structure is defined as type sdi_device_t and contains the following members:
   rm_key_t     sdv_logical_device;
   ulong_t               sdv_state;
   struct bdevsw        *sdv_block;
   struct cdevsw         *sdv_char;
   sdi_layer_t           sdv_handle;
   rm_key_t    sdv_physical_device;

Structure members

The members are defined as:

sdv_logical_device
Resource manager key for this device instance, which specifies the handle provided for this device by the sdi_device_add(D3sdi) function. Its value can be set after calling the sdi_device_add( ) function.

sdv_state
Specifies the state of this device instance. Valid values for sdv_state are:

SDI_DVS_EMPTY
The device is not yet initialized.

SDI_DVS_EXISTS
The device is available for use.

SDI_DVS_ONLINE
The device is initialized and functioning.

SDI_DVS_OFFLINE
The device is not functioning.

SDI_DVS_FAULT
The device has a fault.

SDI_DVS_RCVR
The device is in fault recovery.

These values are defined in the sdi.h header file.


sdv_block
Points to a structure of type struct bdevsw. The driver must initialize the function pointer elements of this structure to point to its own appropriate block I/O entry points. This list of entry points, along with the list in cdevsw, are the avenue by which drivers above this driver in the SDI I/O stack gain access to the devices exposed by this driver.

sdv_char
Points to a structure of type struct cdevsw. The driver must initialize the function pointer elements of this structure to point to its own appropriate raw I/O entry points. This list of entry points, along with the list in bdevsw, are the avenue by which drivers above this driver in the SDI I/O stack gain access to the devices exposed by this driver.

sdv_handle
Must be set to contain the handle provided to this driver by the sdi_driver_add(D3sdi) function. It can be used by any other driver in the I/O stack to access specifics about this driver.


sdv_physical_device
Resource manager key that specifies a handle that points to the actual physical device behind this logical device instance. Its value can be obtained from the sdi_device structure passed into the driver's config(D2sdi) entry point routine. Drivers defined as SDI_STACK_BASE must supply this value themselves.

Usage

Whenever a driver wishes to register export a device to SDI, this structure must be initialized to describe the characteristics of the device. It can then be passed to the sdi_device_add(D3sdi) function.

Before this structure can be passed to any routine other than sdi_device_free(D3sdi), it first must be passed to the sdi_device_prep(D3sdi) function. After calling sdi_device_prep( ), no members in this structure should be changed.

Always allocate sdi_device structures by calling the sdi_device_alloc(D3sdi) function. Never create these structures statically.

Hardware applicability

All

Version applicability

sdi: 4 layered devices

Differences between versions

References

config(D2sdi), sdi_device_alloc(D3sdi), sdi_device_free(D3sdi), sdi_device_prep(D3sdi), sdi_device_add(D3sdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005