DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
HDK Technical Reference

Layered device drivers

DDI 8 provides facilities that enable one driver to invoke another driver's entry points. Layered drivers, such as volume managers, require this functionality. In earlier releases of the operating system, drivers implemented this functionality by stepping outside the bounds of DDI.

The DDI 8 implementation is based on an opaque ``channel handle''. The driver whose entry points will be called creates a channel handle for itself with the drv_open(D3) function, then registers itself and its entry points by calling the drv_attach(D3) function. The corresponding drv_detach(D3) function can be called to deregister the driver when appropriate.

The layered driver can then access that driver's entry points using the do_biostart(D3), do_devinfo(D3), do_ioctl(D3), do_drvctl(D3), and uiobuf(D3) functions.

In DDI 8, this functionality is available only for SDI and non-SDI storage drivers.

SDI 4 provides the following structures and functions for use in layered drivers.

SDI devices are managed with the following:


sdi_device(D4sdi)
SDI layered device descriptor structure.

sdi_device_add(D3sdi)
Register a layered driver with SDI.

sdi_device_alloc(D3sdi)
Allocate an sdi_device structure.

sdi_device_free(D3sdi)
Free an sdi_device structure.

sdi_device_prep(D3sdi)
Prepare an sdi_device structure.

sdi_device_copy(D3sdi)
Copy members of one sdi_device structure to another.

sdi_enable_instance(D3sdi)

SDI drivers are managed with the following:


sdi_driver_desc(D4sdi)
SDI layered driver descriptor structure.

sdi_driver_add(D3sdi)
Register a layered I/O driver with SDI.

sdi_driver_desc_alloc(D3sdi)
Allocate an sdi_driver_desc structure.

sdi_driver_desc_free(D3sdi)
Free an sdi_driver_desc structure.

sdi_driver_desc_prep(D3sdi)
Prepare an sdi_driver_desc structure.

SDI also provides functions for the special buf(D4) manipulation that is required for layered drivers:


sdi_buf_store(D3sdi)
Store the value of the b_iodone and (optionally) the b_blkno members of the buf structure.

sdi_buf_restore(D3sdi)
Restore the values of the buf structure that were saved with the sdi_buf_store( ) function.

sdi_get_blkno(D3sdi)
Get the currently active value of the b_blkno member of the buf structure.

© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005