perform requested operation immediately
int sdi_xicmd(int hbaflag, struct sb *pt,
sends an immediate
structure to a device.
Immediate means that this function bypasses
queued scb requests
and immediately accesses the
device to perform the requested operation.
Initialize to HBA_EXT_ADDRESS
for drivers that understand extended SCSI addressing,
or to 0 for drivers that only understand
conventional SCSI addressing.
Pointer to the
command block structure;
sb_type member of the sb structure
must be set to either SFB_TYPE or SCB_TYPE.
Indicates whether the allocation may block or not.
Valid values are KM_SLEEP or KM_NOSLEEP.
A return code of SDI_RET_OK indicates
that the request is in progress
and the target driver interrupt routine will be called
after command completion.
A return code of SDI_RET_ERR indicates
that the type field is invalid.
After a logical unit queue is resumed,
all outstanding immediate control
and function blocks are processed,
followed by the next normal command.
is typically used during error handling.
In contrast to an operation using an
operations using an scb send the job
to the requested logical unit.
Coming in at immediate-priority,
operations using an sfb are executed
in the order submitted and take priority
over scb operations.
Only one instance of each immediate command
type (SFB_TYPE or ISCB_TYPE) may be
outstanding to a particular logical unit.
The command block must be allocated from
the host adapter pool of command blocks,
and the addresses translated using the
Context and synchronization
If flag is set to KM_NOSLEEP,
non-blockable, initialization, or interrupt
If flag is set to KM_SLEEP,
Differences between versions
SDI versions prior to SDI version 4
function, which cannot be used with
extended SCSI addresses,
The syntax is:
int sdi_icmd(struct sb *pt, int flag);
requests are translated with the
function rather than
``Extended SCSI addressing scheme'' in HDK Technical Reference
The following example shows how an sb
is re-sent using
is set to SDI_RETRY to indicate
that a retry is requested.
is an example of a disk target driver interrupt routine.
struct sb *sb_ptr;
/* Check the completion code of the SCB to see if the
* command needs to be retried.
if (sb_ptr->SCB.sc_comp_code & SDI_RETRY )
/* Retry the command request using sdi_xicmd */
if (sdi_xicmd(HBA_EXT_ADDRESS, sb_ptr, flag) != SDI_RET_OK)
/* If the return value of sdi_xicmd is not OK,
* print an error message.
cmn_err(CE_WARN, "DISK: Bad SB type to SDI.");
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005