Updated patch for 2.1.21 linux/drivers/scsi/seagte.c

Leslie Donaldson (leslied@std.teradyne.com)
Mon, 20 Jan 1997 11:13:45 -0800 (PST)


I am posting an update for my patch.
- Adds some new define targets to Makefile
- Prints all defines used to compile when booting.
- has some fixes the scsi.howto talks about.

CUT HERE-----------------------------------------------
--- linux/drivers/scsi/Makefile Tue Oct 1 00:29:13 1996
+++ linux/drivers/scsi/Makefile Fri Oct 25 07:37:25 1996
@@ -356,7 +357,7 @@
./aic7xxx_asm -o $@ aic7xxx.seq

seagate.o: seagate.c
- $(CC) $(CFLAGS) -DARBITRATE -DSLOW_HANDSHAKE -DFAST32 -c seagate.c
+ $(CC) $(CFLAGS) -DARBITRATE -DSLOW_HANDSHAKE -DFAST32 -DPARITY -c seagate.c

# For debugging, use the -g flag
53c7,8xx.o : 53c7,8xx.c
*** linux/drivers/scsi/seagate.h.0 Thu Nov 28 13:15:35 1996
--- linux/drivers/scsi/seagate.h Thu Nov 28 13:27:40 1996
***************
*** 37,50 ****
1, 7, SG_ALL, 1, 0, 0, DISABLE_CLUSTERING}
#endif

-
- /*
- defining PARITY causes parity data to be checked
- */
-
- #define PARITY
-
-
/*
Thanks to Brian Antoine for the example code in his Messy-Loss ST-01
driver, and Mitsugu Suzuki for information on the ST-01
--- 37,42 ----
***************
*** 67,77 ****
/*
STATUS
*/

#define STAT_BSY 0x01
- #define STAT_MSG 0x02
#define STAT_IO 0x04
- #define STAT_CD 0x08
#define STAT_REQ 0x10
#define STAT_SEL 0x20
#define STAT_PARITY 0x40
--- 59,74 ----
/*
STATUS
*/
+ #ifdef SWAPSTAT
+ #define STAT_MSG 0x08
+ #define STAT_CD 0x02
+ #else
+ #define STAT_MSG 0x02
+ #define STAT_CD 0x08
+ #endif

#define STAT_BSY 0x01
#define STAT_IO 0x04
#define STAT_REQ 0x10
#define STAT_SEL 0x20
#define STAT_PARITY 0x40
*** linux/drivers/scsi/seagate.c.orig Sun Jan 19 19:35:47 1997
--- linux/drivers/scsi/seagate.c Sun Jan 19 19:43:08 1997
***************
*** 43,62 ****
* will configure the driver for a TMC-8xx style controller using IRQ 15
* with a base address of 0xC8000.
*
! * -DFAST or -DFAST32 will use blind transfers where possible
! *
! * -DARBITRATE will cause the host adapter to arbitrate for the
* bus for better SCSI-II compatibility, rather than just
* waiting for BUS FREE and then doing its thing. Should
* let us do one command per Lun when I integrate my
* reorganization changes into the distribution sources.
*
! * -DSLOW_HANDSHAKE will allow compatibility with broken devices that don't
* handshake fast enough (ie, some CD ROM's) for the Seagate
* code.
*
! * -DSLOW_RATE=x, x some number will let you specify a default
* transfer rate if handshaking isn't working correctly.
*/

#include <linux/module.h>
--- 43,83 ----
* will configure the driver for a TMC-8xx style controller using IRQ 15
* with a base address of 0xC8000.
*
! * -DARBITRATE
! * Will cause the host adapter to arbitrate for the
* bus for better SCSI-II compatibility, rather than just
* waiting for BUS FREE and then doing its thing. Should
* let us do one command per Lun when I integrate my
* reorganization changes into the distribution sources.
*
! * -DDEBUG
! * Will activate debug code.
! *
! * -DFAST or -DFAST32
! * Will use blind transfers where possible
! *
! * -DPARITY
! * This will enable parity.
! *
! * -DSEAGATE_USE_ASM
! * Will use older seagate assembly code. should be (very small amount)
! * Faster.
! *
! * -DSLOW_HANDSHAKE
! * Will allow compatibility with broken devices that don't
* handshake fast enough (ie, some CD ROM's) for the Seagate
* code.
*
! * -DSLOW_RATE=x
! * x is some number, It will let you specify a default
* transfer rate if handshaking isn't working correctly.
+ *
+ * The following to options are patches from the SCSI.HOWTO
+ *
+ * -DSWAPSTAT This will swap the definitions for STAT_MSG and STAT_CD.
+ *
+ * -DSWAPCNTDATA This will swap the order that seagate.c messes with
+ * the CONTROL an DATA registers.
*/

#include <linux/module.h>
***************
*** 396,403 ****
#ifdef ARBITRATE
" ARBITRATE"
#endif
! #ifdef SLOW_HANDSHAKE
! " SLOW_HANDSHAKE"
#endif
#ifdef FAST
#ifdef FAST32
--- 417,424 ----
#ifdef ARBITRATE
" ARBITRATE"
#endif
! #ifdef DEBUG
! " DEBUG"
#endif
#ifdef FAST
#ifdef FAST32
***************
*** 409,414 ****
--- 430,450 ----
#ifdef LINKED
" LINKED"
#endif
+ #ifdef PARITY
+ " PARITY"
+ #endif
+ #ifdef SEAGATE_USE_ASM
+ " SEAGATE_USE_ASM"
+ #endif
+ #ifdef SLOW_HANDSHAKE
+ " SLOW_HANDSHAKE"
+ #endif
+ #ifdef SWAPSTAT
+ " SWAPSTAT"
+ #endif
+ #ifdef SWAPCNTDATA
+ " SWAPCNTDATA"
+ #endif
"\n", tpnt->name);
return 1;
}
***************
*** 926,937 ****
--- 962,982 ----
* try this with a SCSI protocol or logic analyzer to see what is
* going on.
*/
+ #ifdef SWAPCNTDATA
+ cli();
+ WRITE_CONTROL (BASE_CMD | CMD_DRVR_ENABLE | CMD_SEL |
+ (reselect ? CMD_ATTN : 0));
+ WRITE_DATA ((unsigned char) ((1 << target) |
+ (controller_type == SEAGATE ? 0x80 : 0x40)));
+ sti();
+ #else
cli ();
WRITE_DATA ((unsigned char) ((1 << target) |
(controller_type == SEAGATE ? 0x80 : 0x40)));
WRITE_CONTROL (BASE_CMD | CMD_DRVR_ENABLE | CMD_SEL |
(reselect ? CMD_ATTN : 0));
sti ();
+ #endif
while (!((status_read = STATUS) & STAT_BSY) && (jiffies < clock)
&& !st0x_aborted)
#if 0 && (DEBUG & PHASE_SELECTION)