DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_device_prep(D3sdi)


sdi_device_prep -- prepare an SDI layered device description structure for use

Synopsis

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

boolean_t sdi_device_prep(sdi_device_t *driver_p, int flag);

Description

sdi_device_prep( ) prepares an sdi_device(D4sdi) structure for use. The sdi_device structure is used by layered I/O drivers to describe themselves to SDI.

Arguments


driver_p
Pointer to a previously allocated sdi_device(D4sdi) structure.

flag
Set to KM_SLEEP or KM_NOSLEEP to indicate whether the function may block.

Return Values

On success, sdi_device_prep( ) returns B_TRUE.

On failure, this function returns B_FALSE, either due to allocation failure in the KM_NOSLEEP case or due to invalid values specified in driver_p.

Usage

The sdi_device_prep( ) function must be called after all necessary members in the structure pointed to by driver_p have been set, but before the structure is passed to any other SDI function such as sdi_device_add(D3sdi) or sdi_device_rm(D3sdi).

This routine can be called multiple times on the same sdi_device structure.

If the driver modifies the members of the sdi_device structure after it has been prepped, then the driver must call sdi_device_prep( ) again before actually using it.

Context and synchronization

Non-blockable context.

Driver-defined basic locks and read/write locks may be held across calls to this function if flag is KM_NOSLEEP, but may not be held if flag is KM_SLEEP.

Driver-defined sleep locks may be held across calls to this function regardless of the value of flag .

Hardware applicability

All

Version applicability

sdi: 4 layered drivers

References

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