icmd(D2sdi)
icmd --
perform a request immediately on a Host Bus Adapter
Synopsis
#include <sys/sdi.h>
#include <sys/ddi.h>
long prefixicmd(struct hbadata *hbap, int flag);
Description
icmd(D2sdi)
is a special case of the Host Bus
Adapter (HBA)
send(D2sdi)
routine.
It sends the request directly to the controller, bypassing the queue
mechanism used by
send( ).
Arguments
hbap-
a pointer to the device-specific request block
defining the request to be performed
flag-
indicates whether subsequent allocation requests, if any,
can sleep or not, and is set
to either KM_SLEEP or KM_NOSLEEP
Return values
On success, icmd returns SDI_RET_OK.
On failure, it returns
SDI_RET_ERR.
Usage
The
icmd( )
this routine is used most frequently when
the HBA controller is in some bad state
and flushing the jobs from the queue is required
to return the controller to a normal state.
The caller, typically the target driver,
expects immediate service for calls to
icmd( )
and will suspend all other processing
until the callback for the immediate command occurs.
See
sfb(D4sdi)
for a list of commands that must be supported
by all HBA drivers
and commands that are required only when
the hot add/remove feature is supported
for the attached target drivers.
In addition to these SCSI SFB commands,
the HBA's
icmd( )
routine should accept and pass to the controller
all supported SCSI SCB commands.
The HBA driver should not autosuspend operations,
but must wait for an SFB_SUSPEND
immediate command from the target.
This synchronization between the target driver
and HBA driver is
necessary to avoid deadlock.
A suspend command can be expected by the HBA when a
CHECK CONDITION occurs.
After the sequence of commands to get sense data have been
executed, the target driver will follow up with the
SFB_RESUME command.
An HBA driver should never suspend the queue,
unless requested by the target driver.
Only target drivers should issue suspend/resume requests.
Context and synchronization
If flag is KM_SLEEP,
blockable
context.
If flag is KM_NOSLEEP,
non-blockable
context.
Applicable hardware
All
Version applicability
sdi:
1, 2, 3, 4
HBA drivers.
See Also
sb(D4sdi),
scb(D4sdi),
sdi_icmd(D3sdi),
sdi_xicmd(D3sdi),
sfb(D4sdi),
send(D2sdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005