|
|
#include <sys/types.h> #include <sys/sdi.h> #include <sys/ddi.h>int sdi_xsend(int hbaflag, struct sb *pt, int sleepflag);
sb_type member of the sb structure
is invalid.
When a device is opened for pass-through access,
SDI_RET_ENTRY is returned.
sb_type member of the sb structure
must be SCB_TYPE.
Commands sent throgh this function
are executed in the order they are received.
If flag is set to KM_SLEEP, user context.
long sdi_send(struct sb *pt, int flag);The address for sdi_send( ) requests must be translated with the sdi_translate(D3sdi) function.
disksend( ) is an example disk target driver routine, called interinally within the target driver to send a command to a device. It is passed a pointer to an sb(D4sdi) command block.
disksend(sb_ptr)
struct sb *sb_ptr;
{
int sendret; /* sdi_send return value */
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;
}
}
...