Subject: Re: Exabyte doesn't work with NetBSD1.0A
To: Michael L. Hitch <osymh@gemini.oscs.montana.edu>
From: Donn Cave <donn@u.washington.edu>
List: amiga
Date: 06/30/1995 09:39:16
|   One other problem that I ran into the last time I tried using an
| Exabyte was that the drive was disconnecting.  There was some code in
| the original Amiga st.c that looked like it disabled the disconnect
| on the Exabyte by sending some vendor-specific data in the mode select
| command.  I added that to the common scsi st.c and was able to get the
| tape working, although I didn't have the tape available long enough to
| do much testing.  It was after that change that the st.c driver was
| modified and I haven't tried to modify my changes to work with the
| current driver yet.

I did have to adapt your patch at one point, must have been when
I went from 1.0-beta-current ca. July 94 to 1.0a standard.  I haven't
tested it extensively, but it makes a big difference.

I will append the diff between what I'm using and the 1.0a st.c.  In
addition to the EXB-specific setup parameters, there's a provision for
no automatic "load".  The IGNORE_LOAD flag originally defeated both
load and unload, so mt -rewoffl didn't work.  I added a check so that
it would defeat only load.  The load is just a time-consuming nuisance,
no serious problem that I remember.

I didn't remember the disconnect problem.  It's too bad the problem couldn't
be solved in the SCSI driver, sounds like a feature, not a bug, for a tape
drive to disconnect.

	Donn Cave, University Computing Services, University of Washington
	donn@u.washington.edu
-----------------------------
*** st.c.dist	Wed Oct  5 22:09:39 1994
--- st.c	Wed Dec 21 13:00:59 1994
***************
*** 108,113 ****
--- 108,114 ----
  #define	ST_Q_SENSE_HELP		0x00008	/* must do READ for good MODE SENSE */
  #define	ST_Q_IGNORE_LOADS	0x00010
  #define	ST_Q_BLKSIZ		0x00020	/* variable-block media_blksiz > 0 */
+ #define ST_Q_EXABYTE		0x00040	/* Exabyte vendor unique */
  
  static struct rogues gallery[] =	/* ends with an all-null entry */
  {
***************
*** 182,198 ****
  	    {0, ST_Q_FORCE_VAR_MODE, DDS}		/* minor 12-15 */
  	}
      },
- #if 0
      {"EXABYTE ", "EXB-8200", "????",
! 	0, 5,
  	{
  	    {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
      {0}
  };
  
--- 183,206 ----
  	    {0, ST_Q_FORCE_VAR_MODE, DDS}		/* minor 12-15 */
  	}
      },
      {"EXABYTE ", "EXB-8200", "????",
! 	ST_Q_EXABYTE|ST_Q_IGNORE_LOADS, 5,
  	{
  	    {0, 0, 0},					/* minor 0-3 */
! 	    {512, ST_Q_FORCE_FIXED_MODE, 0},		/* minor 4-7 */
! 	    {1024, ST_Q_FORCE_FIXED_MODE, 0},		/* minor 8-11 */
! 	    {0, ST_Q_FORCE_VAR_MODE, 0}			/* minor 12-15 */
! 	}
!     },
!     {"DEC     ", "TZ30", "????",
! 	0, 0,
! 	{
! 	    {0, 0, 0},					/* minor 0-3 */
! 	    {512, ST_Q_FORCE_FIXED_MODE, 0},		/* minor 4-7 */
! 	    {1024, ST_Q_FORCE_FIXED_MODE, 0},		/* minor 8-11 */
! 	    {0, ST_Q_FORCE_VAR_MODE, 0}			/* minor 12-15 */
  	}
      },
      {0}
  };
  
***************
*** 386,391 ****
--- 394,407 ----
  		model[16] = 0;
  		strncpy(version, "????", 4);
  		version[4] = 0;
+ 	} else if (inqbuf.additional_length == 0 &&
+ 	    (inqbuf.dev_qual2 & SID_QUAL2) == 0x30) {
+ 		strncpy(manu, "DEC     ", 8);
+ 		manu[8] = 0;
+ 		strncpy(model, "TZ30            ", 16);
+ 		model[16] = 0;
+ 		strncpy(version, "????", 4);
+ 		version[4] = 0;
  	} else {
  		strncpy(manu, inqbuf.vendor, 8);
  		manu[8] = 0;
***************
*** 1422,1427 ****
--- 1438,1451 ----
  		struct blk_desc blk_desc;
  		u_char sense_data[MAX_PAGE_0_SIZE];
  	} scsi_select;
+ 	struct exabyte_page0 {
+ 		u_char vupb;
+ 		u_char rsvd5: 7,
+ 		       p5: 1;
+ 		u_char motionthres;
+ 		u_char reconthres;
+ 		u_char gapthres;
+ 	} *exb_page0;
  	struct scsi_link *sc_link = st->sc_link;
  
  	scsi_select_len = 12 + st->page_0_size;
***************
*** 1439,1444 ****
--- 1463,1479 ----
  	scsi_select.blk_desc.density = st->density;
  	if (st->flags & ST_FIXEDBLOCKS)
  		lto3b(st->blksiz, scsi_select.blk_desc.blklen);
+ 	/* Driver has changed since patch was created, can't tell for
+ 	   sure where this was supposed to go!  DC */
+ 	if (st->quirks & ST_Q_EXABYTE) {
+ 		exb_page0 = &st->sense_data[0];
+ 		exb_page0->vupb = 0xa8;
+ 		exb_page0->rsvd5 = 0;
+ 		exb_page0->p5 = 0;
+ 		exb_page0->motionthres = 0x80;
+ 		exb_page0->reconthres = 0xa0;
+ 		exb_page0->gapthres = 0x07;
+ 	}
  	if (st->page_0_size)
  		bcopy(st->sense_data, scsi_select.sense_data, st->page_0_size);
  
***************
*** 1624,1630 ****
  		if (error)
  			return error;
  	}
! 	if (st->quirks & ST_Q_IGNORE_LOADS)
  		return 0;
  
  	bzero(&cmd, sizeof(cmd));
--- 1659,1665 ----
  		if (error)
  			return error;
  	}
! 	if ((st->quirks & ST_Q_IGNORE_LOADS) && type == LD_LOAD)
  		return 0;
  
  	bzero(&cmd, sizeof(cmd));