DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
HDK Technical Reference

SDI event handling

The SDI event handling mechanism allows SDI drivers to communicate with each other when certain events occur. An example of users of this mechanism would be where a SDI driver (for example, sx01) needs sd01 to notify it upon the first open, last close, and last close with error conditions on a disk drive so it can then manipulate some internal status/statistics, and so on.

The SDI event handling functionality is implemented with the following:


sdi_event(D4sdi)
the main repository of the information needed for manipulating driver events. It must be used by SDI drivers to define the events they wish to handle. The linkage between the driver reporting the event and the driver handling the event is done through the pdtype value, which indicates the SCSI target device type. An internal table is kept of linked lists of sdi_event structures. This table is accessed by the event_pdtype member of the device associated with the event.

sdi_addevent(D3sdi)
called by the driver handling the event (for example, sx01). This driver can advertise its handling of events for all devices of a given type (event_pdtype) or further restrict the range by setting the event_inquiry and scsi_adr members. It can, for instance, add event entries with the SCSI controller number set to handle only a particular host adapter.

sdi_rmevent(D3sdi)
removes the event from the event list, so that future events of that type will not invoke the driver's event handling routine. It must be called by the event-handling target driver in its halt(D2sdi) or _unload(D2sdi) routines, if not called at an earlier point.

sdi_notifyevent(D3sdi)
called by the target driver reporting the event. It checks all the events in the event list indexed by the target driver's device type, looking for a match against each of the driver's claimed EDT entries, and calls the registered event_handler routine.

sdi_event_free(D3sdi)
called from a target driver to release an sdi_event structure that was previously allocated with sdi_event_alloc( ).


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