sdi_send(D3I) sdi_send(D3I)
NAME
sdi_send - send a command to a PDI HBA driver
SYNOPSIS
#include <sys/sdi.h>
long sdi_send(struct sb *pt, int flag);
Arguments
pt Pointer to the sb structure.
flag Indicates whether the command may sleep or not, and is
set to either KM_SLEEP or KM_NOSLEEP.
DESCRIPTION
sdi_send accepts a pointer to an sb command block structure,
and sends the command to the controller for routing to a
specific device.
Return Values
The return value SDI_RET_OK indicates that the request is in
progress and the target driver interrupt handler will be
called. The value SDI_RET_RETRY indicates that PDI cannot
accept the job at this time, and that it should be retried
later. SDI_RET_ERR indicates the sb_type is invalid. When a
device is opened for pass-through, SDI_RET_RETRY is returned.
USAGE
The command block must be allocated from the host adapter pool
of command blocks, and the addresses translated using the
sdi_translate function. The type field must be SCB_TYPE.
Commands sent through this function are executed in the order
they are received.
Level
Base or Interrupt.
Examples
This example shows how sdi_send is used. disksend is an
example disk target driver routine, called internally within
the target driver to send a command to a device. It is passed
a pointer to a command block.
disksend(sb_ptr)
struct sb *sb_ptr;
{
int sendret; /* sdi_send return value */
Copyright 1994 Novell, Inc. Page 1
sdi_send(D3I) sdi_send(D3I)
extern int sendid; /* timeout ID for retry */
/* Call sdi_send with the SB pointer for the job */
if ((sendret = sdi_send(sb_ptr, flag)) != SDI_RET_OK)
{
/* If sdi_send returned retry, set up a timeout to
* submit the job later
*/
if (sendret == SDI_RET_RETRY)
{
/* Call timeout and save the ID */
sendid = timeout(disksendt, sb_ptr, LATER);
return;
}
else
{
/* The Host Adapter driver could not process the job.
* Print an error message.
*/
cmn_err(CE_WARN, "DISK: Bad SB type to SDI. ");
continue;
}
}
...
REFERENCES
sb(D4I), sdi_icmd(D3I), sdi_translate(D3I)
NOTICES
Applicability
sdi: 1, 2
Copyright 1994 Novell, Inc. Page 2