DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_device_rm(D3sdi)


sdi_device_rm -- de-register a layered device with SDI

Synopsis

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

boolean_t sdi_device_rm(rm_key_t *device_key, int flag);

Description

sdi_device_rm( ) deregisters a storage device with SDI.

When this routine is invoked, SDI notifies any drivers that have registered an interest in the device that it is being removed from the stack. At this point, I/O requests to the device will no longer occur.

Arguments


device_key
Device's resource manager key.

flag
Set to KM_SLEEP or KM_NOSLEEP to indicate whether the driver can block to await the resources required to deregister the layered device.

Return values

On success, sdi_device_rm( ) returns B_TRUE.

On failure, sdi_device_rm( ) returns B_FALSE. Failure can only occur if the device is still busy, if device_key is not a valid resource manager key, or if the KM_NOSLEEP flag is set and there is inadequate memory available to deregister the device.

Usage

This function is typically called during the normal operation of a driver when a device is to be removed from the SDI I/O stack. Once this function is called, the driver can expect no further invocations of the entry points it has specified in the device's description structure from SDI.

The structure pointed to by the device_key argument must have been obtained from sdi_device_alloc(D3sdi) and processed by sdi_device_prep(D3sdi).

Context and synchronization

Non-blockable context.

Hardware applicability

All

Version applicability

sdi: 4 layered drivers

References

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