DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_driver_add(D3sdi)


sdi_driver_add -- register a layered I/O driver with SDI

Synopsis

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

sdi_layer_t sdi_driver_add(sdi_driver_desc_t *infop, int flag);

Description

sdi_driver_add( ) registers a stackable I/O driver with SDI.

This routine causes SDI to be aware of the driver, the level the driver is logically at, and the classes of devices the driver is interested in. It also registers a config(D2sdi) entry point routine for this driver.

Arguments


infop
Pointer to the driver's sdi_driver_desc(D4sdi) description structure.

flag
Set to KM_SLEEP or KM_NOSLEEP to indicate whether or not the function can block if resources are not available to register the layered I/O driver.

Return values

Upon successful completion, sdi_driver_add( ) returns a pointer to the handle that the driver must use whenever referencing itself to SDI. If any of the values contained in the driver description structure are in error, the sdi_driver_add( ) fails and a value of NULL is returned.

Usage

This function is typically called by the driver's _load(D2sdi) entry point routine that will exist in the SDI I/O stack. It makes SDI aware of the driver. Once this function is called, the driver can expect invocations of its config(D2sdi) entry point from SDI, notifying it of new devices of interest. Thus, care must be taken that the driver is indeed prepared for these invocations before this function is called.

The structure pointed to by infop must have been obtained from the sdi_driver_desc_alloc(D3sdi) function and validated by the sdi_driver_desc_prep(D3sdi) function.

Context and synchronizataion

If flag is set to KM_NOSLEEP, non-blockable, initialization, or interrupt context.

If flag is set to KM_SLEEP, user context.

Hardware applicability

All

Version applicability

sdi: 4 layered drivers

References

sdi_driver_desc(D4sdi), sdi_driver_desc_alloc(D3sdi), sdi_driver_desc_prep(D3sdi), config(D2sdi),
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005