DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_event(D4sdi)


sdi_event -- driver event definition structure

Synopsis

   #include <sys/sdi.h>

Description

The sdi_event structure defines the parameters of a driver event, including the event-handling routine, used in driver-to-driver communication.

Structure definition

The sdi_event structure contains the following members:
   int              event_type;         /* event type code */
   int              (*event_handler)(); /* address of handler routine */
   void             *event_info;        /* event-specific info */
   int              event_pdtype;       /* device type */
   char             event_inquiry[INQ_EXLEN]; /* device inquiry string */
   struct scsi_adr  event_scsi_adr;     /* device's SCSI address */

Structure members


event
Indicates the type of driver event being manipulated. The following events are currently defined:

SDI_FIRSTOPEN First open of a particular device SDI_LASTCLOSE Last close of a device, with no errors SDI_LASTCLOSE_ERR Last close of a device, with errors

Note that the sdi_event mechanism as implemented allows communicating drivers to define their own private event code values outside of this set: the event codes need only be unique to the driver reporting the event and the driver handling it.


event_handler
Points to the event handler routine. This function is called as follows:
   (*event_handler) (struct sdi_event *event, struct scsi_adr *scsi_adr,
                     struct sb *sbp)

event_info
Provided as optional private data for the driver handling the event.

event_pdtype
SCSI device type of the device for which a driver event is being reported.

event_inquiry and event_scsi_adr
Specify the devices to which the event will apply. A zero-length event_inquiry string and -1 values for the event_scsi_adr member act as wild cards. Specific values can be provided to narrow the range of devices applicable.

Usage

This structure is passed to sdi_addevent(D3sdi) and sdi_rmevent(D3sdi) to register and unregister event handlers. The sdi_notifyevent(D3sdi) routine obtains information about which event handlers to call from the list of registered sdi_event structures.

sdi_event structures must be allocated with sdi_event_alloc(D3sdi) and freed with sdi_event_free(D3sdi). Drivers must not allocate them statically or as automatic variables.

Applicable hardware

All.

Version applicability

sdi: 2, 3, 4

Diferences between versions

Future directions

The SDI_FIRSTOPEN, SDI_LASTCLOSE, and SDI_LASTCLOSE_ERR event types are currently only generated for ID_RANDOM type devices (random-access disks) by the sd01 target driver. In the future, these events will also be supported for other device types.

References

sb(D4sdi), scsi_adr(D4sdi), sd01, sdi_addevent(D3sdi), sdi_event_free(D3sdi), sdi_event_alloc(D3sdi), sdi_notifyevent(D3sdi), sdi_rmevent(D3sdi)

``SDI event handling'' in HDK Technical Reference


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