Subject: HP Colorado T4000s SCSI tape drive
To: None <netbsd-bugs@NetBSD.ORG>
From: David Rosenthal <dshr@vitria.com>
List: netbsd-bugs
Date: 05/23/1996 14:57:15
H-P have figured out that there's more money in cheap tape drives with
expensive tapes than in more expensive drives with really cheap tapes,
so they've pretty much pulled their DAT drives from the market and they're
pushing the HP Colorado T4000s instead.  Drive around $400,  4GB uncompressed
cartridge about $40.  They use standard QIC_3095 cartridges and a bigger
non-standard TR-4 cartridge.

The drive needs a quirk.  It works only in a single mode,  with 512-byte
blocks at one density.  So the turkeys at H-P figure that they can afford
to reject as illegal *all* mode selects,  even if they are requesting the
one density/block-size combination that the drive does support.

NetBSD drivers seem to be very insistent on doing mode selects,  so here's
a quirk for drives like the T4000s which object to them.  Base version is
1.1.

	David.

*** st.c.orig	Thu May 23 11:23:19 1996
--- st.c	Thu May 23 11:35:41 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	0x45	/* maximum density code known */
! 
  /*
   * Define various devices that we know mis-behave in some way,
   * and note how they are bad, so we can correct for them
***************
*** 97,102 ****
--- 97,103 ----
  #define	ST_Q_SENSE_HELP		0x0002	/* must do READ for good MODE SENSE */
  #define	ST_Q_IGNORE_LOADS	0x0004
  #define	ST_Q_BLKSIZE		0x0008	/* variable-block media_blksize > 0 */
+ #define ST_Q_UNIMODAL		0x0010	/* uni-mode drive rejects mode select*/
  	u_int page_0_size;
  #define	MAX_PAGE_0_SIZE	64
  	struct modes modes[4];
***************
*** 193,198 ****
--- 194,206 ----
  		ST_Q_FORCE_BLKSIZE, 1024, DDS,		/* minor 8-11 */
  		ST_Q_FORCE_BLKSIZE, 0, DDS		/* minor 12-15 */
  	}},
+ 	{T_SEQUENTIAL, T_REMOV,
+ 	 "HP      ", "T4000s          ", "",     ST_Q_UNIMODAL, 0, {
+ 		0, 0, QIC_3095,				/* minor 0-3 */
+ 		0, 0, QIC_3095,				/* minor 4-7 */
+ 		0, 0, QIC_3095,				/* minor 8-11 */
+ 		0, 0, QIC_3095,				/* minor 12-15 */
+ 	}},
  #if 0
  	{T_SEQUENTIAL, T_REMOV,
  	 "EXABYTE ", "EXB-8200        ", "",     0, 12, {
***************
*** 1361,1366 ****
--- 1369,1385 ----
  
  	scsi_select_len = 12 + st->page_0_size;
  
+ 	/*
+ 	 *  This quirk deals with drives that have only one valid mode
+ 	 *  and think this gives them license to reject all mode selects,
+ 	 *  even if they request that one mode.
+ 	 */
+ 	if (st->quirks & ST_Q_UNIMODAL) {
+ 		SC_DEBUG(sc_link, SDEV_DB3,
+ 			("not setting density 0x%x blksize 0x%x\n",
+ 			 st->density, st->blksize));
+ 		return (0);
+ 	}
  	/*
  	 * Set up for a mode select
  	 */

*** scsi_tape.h.orig	Thu May 23 11:26:45 1996
--- scsi_tape.h	Thu May 23 11:29:14 1996
***************
*** 170,175 ****
--- 170,176 ----
                  0x15    1     45434       RLL   CS    ECMA TC17    4
                  0x16   48     10000       MFM   C     X3.193-1990  1
                  0x17   48     42500       MFM   C     X3B5/91-174  1
+ 		0x45   73     67733       RLL   C    QIC3095
  
                  where Code means:
                  NRZI Non Return to Zero, change on ones
***************
*** 205,209 ****
--- 206,211 ----
  #define QIC_1320	0x12
  #define DDS		0x13
  #define DAT_1		0x13
+ #define QIC_3095	0x45
  
  #endif /* _SCSI_TAPE_H_ */