sdi_getdev(D3I) sdi_getdev(D3I)
NAME
sdi_getdev - convert device number to SCSI pass-through device
number
SYNOPSIS
#include <sys/sdi.h>
void sdi_getdev(struct scsi_ad *addr, dev_t *dev);
Arguments
addr Pointer to the scsi_ad (device address) structure; the
pass-through device number is returned in the sa_major
and sa_minor members of the structure.
dev Device major/minor number pair.
DESCRIPTION
sdi_getdev translates a device major/minor number pair into
the pass-through interface major/minor number pair for that
device. The pass-through major/ minor number is returned in
the addr structure.
Return Values
None.
USAGE
A target driver uses the pass-through device number when
logging non-buffer related errors.
Level
Base or Interrupt.
Examples
The following example shows how sdi_getdev can be used after
an unsuccessful call to sdi_icmd:
struct sb *sb_ptr;
struct scsi_ad dk_addr;
dev_t pt_dev;
...
/* Call sdi_icmd to send an immediate command */
if (sdi_icmd(sb_ptr, flag) != SDI_RET_OK)
{
/* The call was unsuccessful. Print an error message,
* get the pass-through device number, and log an error
* against the device.
Copyright 1994 Novell, Inc. Page 1
sdi_getdev(D3I) sdi_getdev(D3I)
*/
cmn_err(CE_WARN, "DISK: Bad SB type to SDI. ");
sdi_getdev(&disk_addr, &pt_dev);
}
...
REFERENCES
sb(D4I), scsi_ad(D4I), sdi_getdev(D3I), sdi_icmd(D3I)
NOTICES
Applicability
sdi: 1, 2
Copyright 1994 Novell, Inc. Page 2