sdi_icmd(D3I) sdi_icmd(D3I)
NAME
sdi_icmd - perform requested operation immediately
SYNOPSIS
#include <sys/sdi.h>
int sdi_icmd(struct sb *pt, int flag);
Arguments
pt Pointer to the sb (command block) structure; the sb_type
member of the sb structure must be set to either
SFB_TYPE or ISCB_TYPE.
flag Indicates whether the allocation may sleep or not, and
is set to either KM_SLEEP or KM_NOSLEEP.
DESCRIPTION
sdi_icmd sends an immediate sb to a device. Immediate means
that this function bypasses queued scb's and immediately
accesses the device to perform the requested operation.
Return Values
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.
USAGE
The sdi_icmd function typically is used during error handling.
In contrast to an operation using an sfb, 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
sdi_translate(D3I) function.
Copyright 1994 Novell, Inc. Page 1
sdi_icmd(D3I) sdi_icmd(D3I)
Level
Base or Interrupt.
Examples
The following example shows how an sb is re-sent using
sdi_icmd when the completion code indicates that a retry
(SDI_RETRY) is requested. diskint is an example of a disk
target driver interrupt routine.
void
diskint(sb_ptr)
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_icmd */
if (sdi_icmd(sb_ptr, flag) != SDI_RET_OK)
{
/* If the return value of sdi_icmd is not OK,
* print an error message.
*/
cmn_err(CE_WARN, "DISK: Bad SB type to SDI.");
}
return;
}
...
REFERENCES
sb(D4I), scb(D4I), sdi_translate(D3I), sfb(D4I)
NOTICES
Applicability
sdi: 1, 2
Copyright 1994 Novell, Inc. Page 2