1 HDIO(7I)                        Ioctl Requests                        HDIO(7I)
   2 
   3 NAME
   4      hdio - SMD and IPI disk control operations
   5 
   6 SYNOPSIS
   7      #include <sys/hdio.h>
   8 
   9 DESCRIPTION
  10      Note -- the SMC and IPI drivers have been discontinued.  dkio(7I) is now
  11      the preferred method for retrieving disk information.
  12 
  13      The SMD and IPI disk drivers supplied with this release support a set of
  14      ioctl(2) requests for diagnostics and bad sector information.  Basic to
  15      these ioctl(2) requests are the definitions in <sys/hdio.h>.
  16 
  17 IOCTLS
  18      HDKIOCGTYPE  The argument is a pointer to a hdk_type structure (described
  19                   below).  This ioctl(2) gets specific information from the
  20                   hard disk.
  21 
  22      HDKIOCSTYPE  The argument is a pointer to a hdk_type structure (described
  23                   below).  This ioctl(2) sets specific information about the
  24                   hard disk.
  25 
  26        /*
  27         * Used for drive info
  28         */
  29        struct hdk_type {
  30                ushort_t  hdkt_hsect;    /* hard sector count (read only) */
  31                ushort_t  hdkt_promrev;  /* prom revision (read only) */
  32                uchar_t   hdkt_drtype;   /* drive type (ctlr specific) */
  33                uchar_t   hdkt_drstat;   /* drive status (ctlr specific, ro) */
  34        };
  35 
  36      HDKIOCGBAD  The argument is a pointer to a hdk_badmap structure
  37                  (described below).  This ioctl(2) is used to get the bad
  38                  sector map from the disk.
  39 
  40      HDKIOCSBAD  The argument is a pointer to a hdk_badmap structure
  41                  (described below).  This ioctl(2) is used to set the bad
  42                  sector map on the disk.
  43 
  44        /*
  45         * Used for bad sector map
  46         */
  47        struct hdk_badmap {
  48                caddr_t hdkb_bufaddr;   /* address of user's map buffer */
  49        };
  50 
  51      HDKIOCGDIAG  The argument is a pointer to a hdk_diag structure (described
  52                   below).  This ioctl(2) gets the most recent command that
  53                   failed along with the sector and error number from the hard
  54                   disk.
  55 
  56        /*
  57         * Used for disk diagnostics
  58         */
  59        struct hdk_diag {
  60                ushort_t hdkd_errcmd; /* most recent command in error */
  61                daddr_t hdkd_errsect; /* most recent sector in error */
  62                uchar_t hdkd_errno;   /* most recent error number */
  63                uchar_t hdkd_severe;  /* severity of most recent error */
  64        };
  65 
  66 SEE ALSO
  67      ioctl(2), dkio(7I)
  68 
  69 illumos                        October 23, 2017                        illumos