[2812] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

fix for seagate driver

daemon@ATHENA.MIT.EDU (Egbert Eich)
Fri Nov 14 05:42:14 1997

Date: 	Fri, 14 Nov 1997 11:38:23 +0100
From: Egbert Eich <eich@crunch.ikp.physik.tu-darmstadt.de>
To: linux-scsi@vger.rutgers.edu


Hi,

could someone on this list please tell me who currently maintains
the seagate st0x-driver?

I have a patch for it which has been in my drawer for quite a while. 
I thought Drew Eckhardt was maintainer of this driver. I have mailed 
it to him twice however never received an answer. 

I know it's very outdated hardware and no one wants to bother with it.
But until I decide to retire my 33MHz 486 I'm going to use it. It still
works well (at least I don't get problems provided I'm using this fix).

This patch  fixes the long standing problem with the order of CONTROL/DATA. 
The solution which is suggested now is clumsy and doesn't work for 
me as one of my two disks wants it the other way around from the 
second.

I changed it to be more SCSI standard compliant. Now my two
disks - along with a CDROM and a MOD drive - work flawlessly.
Besides I've tested this fix on a different system, a DELL notebook
with a port replicator which uses a FD TMC-8xx. There it works without
problems, too. 

 Cheers,
	Egbert.

  
The fix is against 2.1.55. 

--- seagate.c.org	Wed Sep 24 16:27:05 1997
+++ seagate.c	Wed Sep 24 16:33:41 1997
@@ -72,6 +72,13 @@
  *      x is some number, It will let you specify a default
  *      transfer rate if handshaking isn't working correctly.
  *
+ * -DOLDCNTDATASCEME  There is a new sceme to set the CONTROL
+ *                    and DATA reigsters which complies more closely
+ *                    with the SCSI2 standard. This hopefully eliminates
+ *                    the need to swap the order these registers are
+ *                    'messed' with. It makes the following two options
+ *                    obsolete. To reenable the old sceme define this.
+ *
  * The following to options are patches from the SCSI.HOWTO
  *
  * -DSWAPSTAT  This will swap the definitions for STAT_MSG and STAT_CD.
@@ -794,6 +801,10 @@
   unsigned char message = 0;
   register unsigned char status_read;
 
+#ifndef OLDCNTDATASCEME
+  volatile unsigned char tmp_data;
+  volatile unsigned char tmp_control;
+#endif
   unsigned transfersize = 0, underflow = 0;
 
   incommand = 0;
@@ -1029,6 +1040,7 @@
  *    try this with a SCSI protocol or logic analyzer to see what is
  *    going on.
  */
+#ifdef OLDCNTDATASCEME
 #ifdef SWAPCNTDATA
 	cli();
       WRITE_CONTROL (BASE_CMD | CMD_DRVR_ENABLE | CMD_SEL |
@@ -1044,6 +1056,16 @@
                      (reselect ? CMD_ATTN : 0));
       sti ();
 #endif
+#else
+       tmp_data = (unsigned char) ((1 << target) | (controller_type == SEAGATE 
+? 0x80 : 0x40));
+       tmp_control = BASE_CMD | CMD_DRVR_ENABLE | CMD_SEL |
+                (reselect ? CMD_ATTN : 0) | CMD_BSY;
+       WRITE_CONTROL(tmp_data);
+       WRITE_DATA(tmp_control);
+       tmp_control ^= CMD_BSY;
+       WRITE_CONTROL(tmp_control);
+#endif /* OLDCNTDATASCEME */
       while (!((status_read = STATUS) & STAT_BSY) && (jiffies < clock)
              && !st0x_aborted)
 #if 0 && (DEBUG & PHASE_SELECTION)



home help back first fref pref prev next nref lref last post