add a driver event handler
int sdi_addevent(struct sdi_event *event);
is used with the
functions and the
structure to implement
a driver-to-driver communication mechanism
for SDI SCSI drivers
based on event codes and SCSI device types.
adds event to an internal list of driver events,
effectively registering the driver event handler,
which may later be called by the
structure that defines
the parameters of the driver event,
including the event code, SCSI device address,
SCSI inquiry string, event-handling routine,
and SCSI device type to which the driver event applies.
On success, SDI_RET_OK.
On failure SDI_RET_ERR.
is typically called from the driver's
entry point routine
by a driver wanting to be notified of the occurrence of an event
through the use of its event handler.
An example of such an interaction is
when the driver must to be notified
of the first open on a given disk.
It will do so by setting up an sdi_event structure
that points to its SDI_FIRSTOPEN event handler,
with event_pdtype set to ID_RANDOM (disk device)
and calling the
To receive events for all devices of a certain type,
in the event structure to the desired string;
null string values for
event_inquiry match any device.
To receive events for devices
with certain SCSI address patterns
(for example, on a particular controller
or with a given target ID),
event_scsi_adr members accordingly;
values of -1 for
event_scsi_adr members match any device.
Any event handler registered with
must be unregistered with
before unloading the driver.
Context and synchronization
x86/Pentium compatible architectures
2, 3, 4
``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