Fixed printf's so that they announce them selfs correctly (ie aha%d: before
[unix-history] / sys / scsi / scsi_tape.h
index f4a26d7..96d14a6 100644 (file)
@@ -1,22 +1,3 @@
-/*
- * HISTORY
- * $Log:       scsi_tape.h,v $
- * 
- * julian - added some special stuff for some OLD scsi tapes (CIPHER
- *          ST150S)
- *
- * Revision 1.1.1.1  1993/06/12  14:57:27  rgrimes
- * Initial import, 0.1 + pk 0.2.4-B1
- *
- * 
- * Revision 1.2  1993/01/26  18:39:08  julian
- * add the 'write protected' bit in the device status struct.
- *
- * Revision 1.1  1992/09/26  22:10:21  julian
- * Initial revision
- *
- */
-
 /*
  * SCSI tape interface description
  */
 /*
  * SCSI tape interface description
  */
  * on the understanding that TFS is not responsible for the correct
  * functioning of this software in any circumstances.
  *
  * on the understanding that TFS is not responsible for the correct
  * functioning of this software in any circumstances.
  *
- */
-
-/*
  * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
  * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
+ *
+ *     $Id$
  */
 
 /*
  * SCSI command format
  */
 
  */
 
 /*
  * SCSI command format
  */
 
-
 struct scsi_rw_tape
 {
        u_char  op_code;
 struct scsi_rw_tape
 {
        u_char  op_code;
-       u_char  fixed:1;
-       u_char  :4;     
-       u_char  lun:3;
+       u_char  byte2;
+#define        SRWT_FIXED      0x01
        u_char  len[3];
        u_char  len[3];
-       u_char  link:1;
-       u_char  flag:1;
-       u_char  :6;
+       u_char  control;
 } rw_tape;
 
 struct scsi_space
 {
        u_char  op_code;
 } rw_tape;
 
 struct scsi_space
 {
        u_char  op_code;
-       u_char  code:2;
-       u_char  :3;
-       u_char  lun:3;
+       u_char  byte2;
+#define        SS_CODE 0x03
        u_char  number[3];
        u_char  number[3];
-       u_char  link:1;
-       u_char  flag:1;
-       u_char  :6;
+       u_char  control;
 } space;
 #define SP_BLKS        0
 #define SP_FILEMARKS 1
 } space;
 #define SP_BLKS        0
 #define SP_FILEMARKS 1
@@ -77,52 +50,40 @@ struct scsi_space
 struct scsi_write_filemarks
 {
        u_char  op_code;
 struct scsi_write_filemarks
 {
        u_char  op_code;
-       u_char  :5;
-       u_char  lun:3;
+       u_char  byte2;
        u_char  number[3];
        u_char  number[3];
-       u_char  link:1;
-       u_char  flag:1;
-       u_char  :6;
+       u_char  control;
 } write_filemarks;
 
 struct scsi_rewind
 {
        u_char  op_code;
 } write_filemarks;
 
 struct scsi_rewind
 {
        u_char  op_code;
-       u_char  immed:1;
-       u_char  :4;
-       u_char  lun:3;
+       u_char  byte2;
+#define        SR_IMMED        0x01
        u_char  unused[3];
        u_char  unused[3];
-       u_char  link:1;
-       u_char  flag:1;
-       u_char  :6;
+       u_char  control;
 } rewind;
 
 struct scsi_load
 {
        u_char  op_code;
 } rewind;
 
 struct scsi_load
 {
        u_char  op_code;
-       u_char  immed:1;
-       u_char  :4;
-       u_char  lun:3;
+       u_char  byte2;
+#define        SL_IMMED        0x01
        u_char  unused[2];
        u_char  unused[2];
-       u_char  load:1;
-       u_char  reten:1;
-       u_char  :6;
-       u_char  link:1;
-       u_char  flag:1;
-       u_char  :6;
+       u_char  how;
+       u_char  control;
 } load;
 #define LD_UNLOAD 0
 #define LD_LOAD 1
 } load;
 #define LD_UNLOAD 0
 #define LD_LOAD 1
+#define LD_RETEN 2
+
 
 struct scsi_blk_limits
 {
        u_char  op_code;
 
 struct scsi_blk_limits
 {
        u_char  op_code;
-       u_char  :5;
-       u_char  lun:3;
+       u_char  byte2;
        u_char  unused[3];
        u_char  unused[3];
-       u_char  link:1;
-       u_char  flag:1;
-       u_char  :6;
+       u_char  control;
 } blk_limits;
 
 /*
 } blk_limits;
 
 /*
@@ -149,15 +110,13 @@ struct scsi_blk_limits_data
        u_char  min_length_0;   /* Least significant */
 };
 
        u_char  min_length_0;   /* Least significant */
 };
 
-struct scsi_mode_header_tape
-{
-       u_char  data_length;    /* Sense data length */
-       u_char  medium_type;
-       u_char  speed:4;
-       u_char  buf_mode:3;
-       u_char  write_protected:1;
-       u_char  blk_desc_len;
-};
+/* defines for the device specific byte in the mode select/sense header */
+#define        SMH_DSP_SPEED           0x0F
+#define        SMH_DSP_BUFF_MODE       0x70
+#define        SMH_DSP_BUFF_MODE_OFF   0x00
+#define        SMH_DSP_BUFF_MODE_ON    0x10
+#define        SMH_DSP_BUFF_MODE_MLTI  0x20
+#define        SMH_DSP_WRITE_PROT      0x80
 
 /* A special for the CIPHER ST150S(old drive) */
 struct blk_desc_cipher
 
 /* A special for the CIPHER ST150S(old drive) */
 struct blk_desc_cipher
@@ -166,9 +125,9 @@ struct      blk_desc_cipher
        u_char  nblocks[3];
        u_char  reserved;
        u_char  blklen[3];
        u_char  nblocks[3];
        u_char  reserved;
        u_char  blklen[3];
-       u_char  sec:1;          /* soft error count */
-       u_char  aui:1;          /* autoload inhibit */
-       u_char  :6;
+       u_char  other;
+#define ST150_SEC      0x01    /* soft error count */
+#define        SR150_AUI       0x02    /* autoload inhibit */
 };
 
 
 };