Annotation of researchv9/sys/sundev/streg.h, revision 1.1.1.1

1.1       root        1: /*     @(#)streg.h 1.1 86/02/03 SMI    */
                      2: 
                      3: /*
                      4:  * Copyright (c) 1985 by Sun Microsystems, Inc.
                      5:  */
                      6: 
                      7: /*
                      8:  * Defines for SCSI tape.
                      9:  */
                     10: #define        DEV_BSIZE       512
                     11: #define        SENSE_LENGTH    16
                     12: 
                     13: /*
                     14:  * Open flag codes
                     15:  */
                     16: #define        CLOSED          0
                     17: #define        OPENING         1
                     18: #define        OPEN_FAILED     2
                     19: #define        OPEN            3
                     20: #define        CLOSING         4
                     21: 
                     22: /*
                     23:  * Operation codes.
                     24:  */
                     25: #define        SC_REWIND               SC_REZERO_UNIT
                     26: #define        SC_WRITE_FILE_MARK      0x10
                     27: #define SC_SPACE               0x11
                     28: #define SC_MODE_SELECT         0x15
                     29: #define SC_ERASE_CARTRIDGE     0x19
                     30: #define SC_LOAD                        0x1b
                     31: #define SC_SPACE_FILE          0x81    /* phony - for internal use only */
                     32: #define SC_SPACE_REC           0x82    /* phony - for internal use only */
                     33: 
                     34: #define ST_TYPE_INVALID                0x00
                     35: 
                     36: /*
                     37:  * Parameter list for the MODE_SELECT command.
                     38:  * The parameter list contains a header, followed by zero or more
                     39:  * block descriptors, followed by vendor unique parameters, if any.
                     40:  */
                     41: struct st_ms_hdr {
                     42:        u_char  reserved1;      /* reserved */
                     43:        u_char  reserved2;      /* reserved */
                     44:        u_char            :1;   /* reserved */
                     45:        u_char  bufm      :3;   /* buffered mode */
                     46:        u_char  speed     :4;   /* speed */
                     47:        u_char  bd_len;         /* length in bytes of all block descs */
                     48: };
                     49: 
                     50: struct st_ms_bd {
                     51:        u_char  density;        /* density code */
                     52:        u_char  high_nb;        /* num of logical blocks on the medium that */
                     53:        u_char  mid_nb;         /* are to be formatted with the density code */
                     54:        u_char  low_nb;         /* and block length in block desc */
                     55:        u_char  reserved;       /* reserved */
                     56:        u_char  high_bl;        /* block length */
                     57:        u_char  mid_bl;         /* block length */
                     58:        u_char  low_bl;         /* block length */
                     59: };
                     60: 
                     61: /*
                     62:  * Mode Select Parameter List expected by emulex controllers.
                     63:  */
                     64: struct st_emulex_mspl {
                     65:        struct st_ms_hdr hdr;   /* mode select header */
                     66:        struct st_ms_bd  bd;    /* block descriptor */
                     67:        u_char            :5;   /* unused */
                     68:        u_char  dea       :1;   /* disable erase ahead */
                     69:        u_char  aui       :1;   /* auto-load inhibit */
                     70:        u_char  sec       :1;   /* soft error count */
                     71: };
                     72: #define EM_MS_PL_LEN   13      /* length of mode select param list */
                     73: #define EM_MS_BD_LEN   8       /* length of block descriptors */
                     74: 
                     75: /*
                     76:  * Sense info returned by Archive controllers.
                     77:  */
                     78: struct st_archive_sense {
                     79:        struct scsi_ext_sense ext_sense; /* generic extended sense format */
                     80: /*     u_char  rserved[4];
                     81:        u_char  retries_msb;            /* retry count, most signif byte */
                     82: /*     u_char  retries_lsb;            /* retry count, most signif byte */
                     83: };
                     84: 
                     85: /* number of emulex sense bytes in addition to generic extended sense */
                     86: #define AR_ES_ADD_LEN                  0
                     87: 
                     88: /*
                     89:  * Macros for getting information from the sense data returned
                     90:  * by the tape controller.
                     91:  */
                     92: #define ST_FILE_MARK(dsi, sense) \
                     93:        (((struct scsi_ext_sense *)sense)->fil_mk)
                     94: 
                     95: #define ST_WRITE_PROT(dsi, sense) \
                     96:        (((struct scsi_ext_sense *)sense)->key == SC_DATA_PROTECT)
                     97: 
                     98: #define ST_EOT(dsi, sense) \
                     99:        (((struct scsi_ext_sense *)sense)->eom)
                    100: 
                    101: #define ST_ILLEGAL(dsi, sense) \
                    102:        (((struct scsi_ext_sense *)sense)->key == SC_ILLEGAL_REQUEST)
                    103: 
                    104: #define ST_NO_CART(dsi, sense) \
                    105:        (((struct scsi_ext_sense *)sense)->key == SC_NOT_READY)
                    106: 
                    107: #define ST_RESET(dsi, sense) \
                    108:        (((struct scsi_ext_sense *)sense)->key == SC_UNIT_ATTENTION)
                    109: 
                    110: #define ST_CORRECTABLE(dsi, sense) \
                    111:        (((struct scsi_ext_sense *)sense)->key == SC_RECOVERABLE_ERROR)
                    112: 
                    113: #define ST_EOD(dsi, sense) \
                    114:        (((struct scsi_ext_sense *)sense)->key == SC_BLANK_CHECK)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.