Subject: Wangtek tape drives
To: None <port-i386@NetBSD.ORG>
From: Phil Knaack <flipk@ncremp.ag.iastate.edu>
List: port-i386
Date: 06/01/1995 16:03:01
Greetings:

What's the current state of the Wangtek tape backup drivers? I am 
attempting to get this tape drive to work, and have come upon a
problem.

I am using a QIC-02 controller which detects as 

	wt0 at isa0 port 0x370 irq 5 drq 3

correctly, and a tape drive made by CMS Enhancements INC using DC6250
tapes. 

This hardware works perfectly with the SYTOS backup software for DOS
we often use. The port/irq/drq numbers were obtained from the STCONFIG
parameters, since I have little/no documentation on the card itself and
its jumpers. On a side note, if anyone has that sort of information or
a quick idea of where I could get hold of that, I would be a really 
happy dude. :)

After modifying /usr/src/bin/mt/mt.c to include the MT_ISWANGTEK macros
and definitions in the tapes[] structure (type 0x11) I am able to use mt
to check the status on the drive, do rewinds, etc, i.e. 

	% mt -f /dev/wt0 status
	Wangtek tape drive, residual=0
	ds=3<inuse,read>
	er=0
	
however, I am unable to transfer any data successfully to/from the tape.
When I attempt a 

	% tar cf /dev/wt1 /home/flipk/proj/

[ where /dev/wt1 has major/minor numbers 3/16, selecting 6250 bpi ]

the drive begins to run, it fiddles with the tape for a bit, and then
after a moment the drive motor stops running, but the busy light stays
on, and the hard disk light blinks steadily as if accessing the files
it is supposed to. Meanwhile I get

	Jun  1 15:10:15 ncremp /netbsd: dma channel 3 not finished
	Jun  1 15:10:25 ncremp last message repeated 1919 times

in my syslog. I'm not sure what this means, and making me not so clueless
about these things would be most appreciated. :)

Hitting ^C to abort the tar results in about a half second delay, then the
drive motor kicks in again and performs a rewind (of about an inch
of tape ;).

Oh, BTW, this is with a -1.0 system, tho at the moment I'm in the process
of upgrading to -current (as of days ago) and the above results were the
same with the -current kernel and COMPAT_10 .. will it make a large
difference when I complete the rebuilding of the libs/binaries?

Any additional pointers and info would be nifty. :)

The diffs for mt.c are below; comments?

Cheers,
Phil
-----------------------------------------------------
*** mt.c.old	Thu Jun  1 15:47:44 1995
--- mt.c	Thu Jun  1 15:48:46 1995
***************
*** 164,169 ****
--- 164,173 ----
  #include <tahoe/vba/cyreg.h>
  #endif
  
+ #ifdef i386
+ #include <i386/wtreg.h>
+ #endif
+ 
  struct tape_desc {
  	short	t_type;		/* type of magtape device */
  	char	*t_name;	/* printing name */
***************
*** 183,188 ****
--- 187,195 ----
  #endif
  #ifdef tahoe
  	{ MT_ISCY,	"cipher",	CYS_BITS,	CYCW_BITS },
+ #endif
+ #ifdef i386
+ 	{ MT_ISWANGTEK,	"Wangtek",	WTDS_BITS,	WTER_BITS },
  #endif
  	{ 0 }
  };