DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_device_add(D3sdi)


sdi_device_add -- 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_add(sdi_device_t *infop, int flag);

Description

sdi_device_add( ) registers a storage device with SDI.

After this routine is invoked, SDI is free to advertise this device to the rest of the SDI I/O stack. At that point, I/O requests to the device can occur.

Arguments


infop
Pointer to the device's description structure, sdi_device(D4sdi).

flag
Set to KM_SLEEP or KM_NOSLEEP to indicate whether the allocation can block.

Return values

sdi_device_add( ) always returns B_TRUE.

Usage

This function is typically called during the normal operation of a driver as it becomes aware of new devices that it wishes to advertise to SDI. This is usually in the CFG_ADD subfunction of the config(D2sdi) entry point routine. Once this function is called, the driver can expect invocations of the entry points it has specified in the device's description structure from SDI. 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 with the sdi_device_alloc(D3sdi) function and processed by the sdi_device_prep(D3sdi) function.

Context and synchronization

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_device(D4sdi), sdi_device_alloc(D3sdi), sdi_device_free(D3sdi), sdi_device_prep(D3sdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005