DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_getdev(D3sdi)


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);

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.

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

Return values

None

Usage

A target driver uses the pass-through device number when logging non-buffer related errors.

Context and synchronization

Non-blockable context.

Applicable hardware

x86/Pentium compatible architectures

Version applicability

sdi: 1, 2, 3, 4 target drivers.

References

sb(D4sdi), scsi_ad(D4sdi), sdi_getdev(D3sdi), sdi_icmd(D3sdi)

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.
          */
          cmn_err(CE_WARN, "DISK: Bad SB type to SDI. ");
          sdi_getdev(&disk_addr, &pt_dev);
      }
      ...

19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005