Subject: kern/2155: Exabyte 8505 read/write of compressed high density tapes
To: None <gnats-bugs@NetBSD.ORG>
From: Klaus Helbing <helbing@phop5.physik.uni-bonn.de>
List: netbsd-bugs
Date: 03/01/1996 20:44:03
>Number:         2155
>Category:       kern
>Synopsis:       Exabyte 8505 read/write of compressed high density tapes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar  1 15:05:02 1996
>Last-Modified:
>Originator:     Klaus Helbing
>Organization:
Physikalisches Institut Uni Bonn
>Release:        NetBSD-current Feb  7 13:00
>Environment:
System: NetBSD phop5.physik.uni-bonn.de 1.1A NetBSD 1.1A (PHOP) #0: Wed Feb 7 15:50:38 MET 1996 helbing@phop5.physik.uni-bonn.de:/usr/src/sys/arch/i386/compile/PHOP i386


>Description:
	Rewriting of Exabyte tapes -- previously inscribed (by e.g. a 
	DECstation) in compressed 8500-Exabyte format --- fails even when 
	trying to write uncompressed. 
	Writing of new Exabyte tapes in compressed 8500 format fails.

	Reason: According to device manual of my exabyte the various formats 
		correspond to the following density codes:
		8500 normal	:	0x00
		8500 compressed	:	0x8c
		8500 compressed	:	0x90
		8500 normal	:	0x14
		But /sys/scsi/st.c says
#define SCSI_2_MAX_DENSITY_CODE 0x17    /* maximum density code specified
                                         * in SCSI II spec. */

>How-To-Repeat:
	see description but repetition is not recommendable because of time 
	outs that lead to system crash!
>Fix:
Make the following devices where /dev/*st0l stands for 8500 normal, 
	/dev/*st0h 8500 compressed, /dev/*st0m EXB-8200 format compressed,
	/dev/*st0a 8200 normal.
crw-rw----  1 root  operator   14,   3 Nov 24 15:16 /dev/enrst0
crw-rw-r--  1 root  wheel      14,  15 Jan  9 18:19 /dev/enrst0a
crw-rw-r--  1 root  wheel      14,   7 Jan  9 18:18 /dev/enrst0h
crw-rw-r--  1 root  wheel      14,   3 Jan  9 18:18 /dev/enrst0l
crw-rw-r--  1 root  wheel      14,  11 Jan  9 18:19 /dev/enrst0m
brw-rw----  1 root  operator    5,   3 Nov 24 15:16 /dev/enst0
brw-rw-r--  1 root  wheel       5,  15 Jan  9 18:20 /dev/enst0a
brw-rw-r--  1 root  wheel       5,   7 Jan  9 18:19 /dev/enst0h
brw-rw-r--  1 root  wheel       5,   3 Jan  9 18:19 /dev/enst0l
brw-rw-r--  1 root  wheel       5,  11 Jan  9 18:19 /dev/enst0m
crw-rw----  1 root  operator   14,   2 Nov 24 15:16 /dev/erst0
crw-rw-r--  1 root  wheel      14,  14 Jan  9 18:24 /dev/erst0a
crw-rw-r--  1 root  wheel      14,   6 Jan  9 18:23 /dev/erst0h
crw-rw-r--  1 root  wheel      14,   2 Jan  9 18:23 /dev/erst0l
crw-rw-r--  1 root  wheel      14,  10 Jan  9 18:23 /dev/erst0m
brw-rw----  1 root  operator    5,   2 Nov 24 15:16 /dev/est0
brw-rw-r--  1 root  wheel       5,  14 Jan  9 18:24 /dev/est0a
brw-rw-r--  1 root  wheel       5,   6 Jan  9 18:24 /dev/est0h
brw-rw-r--  1 root  wheel       5,   2 Jan  9 18:24 /dev/est0l
brw-rw-r--  1 root  wheel       5,  10 Jan  9 18:24 /dev/est0m
crw-rw----  1 root  operator   14,   1 Nov 24 15:16 /dev/nrst0
crw-rw-r--  1 root  wheel      14,  13 Jan  9 20:53 /dev/nrst0a
crw-rw-r--  1 root  wheel      14,   5 Feb 29 15:39 /dev/nrst0h
crw-rw-r--  1 root  wheel      14,   1 Feb  1 11:05 /dev/nrst0l
crw-rw-r--  1 root  wheel      14,   9 Feb  1 11:19 /dev/nrst0m
brw-rw----  1 root  operator    5,   1 Nov 24 15:16 /dev/nst0
brw-rw-r--  1 root  wheel       5,  13 Jan  9 18:26 /dev/nst0a
brw-rw-r--  1 root  wheel       5,   5 Jan  9 18:25 /dev/nst0h
brw-rw-r--  1 root  wheel       5,   1 Jan  9 18:25 /dev/nst0l
brw-rw-r--  1 root  wheel       5,   9 Jan  9 18:26 /dev/nst0m
crw-rw----  1 root  operator   14,   0 Nov 24 15:16 /dev/rst0
crw-rw-r--  1 root  wheel      14,  12 Jan  9 18:26 /dev/rst0a
crw-rw-r--  1 root  wheel      14,   4 Jan  9 18:26 /dev/rst0h
crw-rw-r--  1 root  wheel      14,   0 Jan  9 18:26 /dev/rst0l
crw-rw-r--  1 root  wheel      14,   8 Jan  9 18:26 /dev/rst0m
brw-rw----  1 root  operator    5,   0 Nov 24 15:16 /dev/st0
brw-rw-r--  1 root  wheel       5,  12 Jan  9 18:27 /dev/st0a
brw-rw-r--  1 root  wheel       5,   4 Jan  9 18:27 /dev/st0h
brw-rw-r--  1 root  wheel       5,   0 Jan  9 18:27 /dev/st0l
brw-rw-r--  1 root  wheel       5,   8 Jan  9 18:27 /dev/st0m

and patch the source tree as follows (but replace EXB-85058SQANXR1 by 
something more universal (I did not understand the matching algorithm):

*** sys/scsi/scsiconf.c.orig	Fri Jan 12 13:28:18 1996
--- sys/scsi/scsiconf.c	Tue Feb  6 20:43:18 1996
***************
*** 337,342 ****
--- 337,344 ----
  	{T_SEQUENTIAL, T_REMOV,
  	 "EXABYTE ", "EXB-8200        ", "",     SDEV_NOLUNS},
  	{T_SEQUENTIAL, T_REMOV,
+ 	 "EXABYTE ", "EXB-85058SQANXR1", "",     SDEV_NOLUNS},
+ 	{T_SEQUENTIAL, T_REMOV,
  	 "SONY    ", "SDT-2000        ", "2.09", SDEV_NOLUNS},
  	{T_SEQUENTIAL, T_REMOV,
  	 "SONY    ", "SDT-5000        ", "3.",   SDEV_NOSYNCWIDE},
*** sys/scsi/st.c.orig	Fri Jan 12 13:28:20 1996
--- sys/scsi/st.c	Tue Feb  6 20:43:19 1996
***************
*** 79,86 ****
  #define STUNIT(z)	((minor(z) >> 4)       )
  #define CTLMODE	3
  
! #define SCSI_2_MAX_DENSITY_CODE	0x17	/* maximum density code specified
! 					 * in SCSI II spec. */
  /*
   * Define various devices that we know mis-behave in some way,
   * and note how they are bad, so we can correct for them
--- 79,86 ----
  #define STUNIT(z)	((minor(z) >> 4)       )
  #define CTLMODE	3
  
! #define SCSI_2_MAX_DENSITY_CODE	0xff
! 
  /*
   * Define various devices that we know mis-behave in some way,
   * and note how they are bad, so we can correct for them
***************
*** 200,214 ****
  		0, 0, 0,				/* minor 8-11 */
  		0, 0, 0					/* minor 12-15 */
  	}},
- #if 0
  	{T_SEQUENTIAL, T_REMOV,
! 	 "EXABYTE ", "EXB-8200        ", "",     0, 12, {
! 		0, 0, 0,				/* minor 0-3 */
! 		0, 0, 0,				/* minor 4-7 */
! 		0, 0, 0,				/* minor 8-11 */
! 		0, 0, 0					/* minor 12-15 */
  	}},
- #endif
  };
  
  #define NOEJECT 0
--- 200,212 ----
  		0, 0, 0,				/* minor 8-11 */
  		0, 0, 0					/* minor 12-15 */
  	}},
  	{T_SEQUENTIAL, T_REMOV,
! 	 "EXABYTE ", "EXB-85058SQANXR1", "",     0, 0, {
! 		0, 0, 0x00,				/* minor 0-3 */
! 		0, 0, 0x8c,				/* minor 4-7 */
! 		0, 0, 0x90,				/* minor 8-11 */
! 		0, 0, 0x14				/* minor 12-15 */
  	}},
  };
  
  #define NOEJECT 0
>Audit-Trail:
>Unformatted: