53c7,8xx and pre7

Wolfgang Wander (wwc@lars.desy.de)
Sat, 10 May 1997 10:40:25 +0200


Hi,

the following patch allows to compile pre7 with smp and 53c7,8xx

--- linux-pre7/drivers/scsi/53c7,8xx.h Fri May 9 09:30:44 1997
+++ linux/drivers/scsi/53c7,8xx.h Sat May 10 10:33:48 1997
@@ -1394,7 +1394,7 @@
/* commands running, maintained
by Linux driver */

- volatile struct NCR53c7x0_cmd *current; /* currently connected
+ volatile struct NCR53c7x0_cmd *lcurrent; /* currently connected
nexus, ONLY valid for
NCR53c700/NCR53c700-66
*/
--- linux-pre7/drivers/scsi/53c7,8xx.c Wed Apr 23 07:42:50 1997
+++ linux/drivers/scsi/53c7,8xx.c Sat May 10 10:34:35 1997
@@ -254,7 +254,7 @@
#include <linux/time.h>
#include <linux/blk.h>
#include <linux/init.h>
-#undef current
+/* #undef current */

#include "scsi.h"
#include "hosts.h"
@@ -783,7 +783,7 @@
struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
host->hostdata;
int i, j;
- u32 *current;
+ u32 *lcurrent;
for (i = 0; i < 16; ++i) {
hostdata->request_sense[i] = 0;
for (j = 0; j < 8; ++j)
@@ -792,14 +792,14 @@
}
hostdata->issue_queue = NULL;
hostdata->running_list = hostdata->finished_queue =
- hostdata->current = NULL;
- for (i = 0, current = (u32 *) hostdata->schedule;
- i < host->can_queue; ++i, current += 2) {
- current[0] = hostdata->NOP_insn;
- current[1] = 0xdeadbeef;
+ hostdata->lcurrent = NULL;
+ for (i = 0, lcurrent = (u32 *) hostdata->schedule;
+ i < host->can_queue; ++i, lcurrent += 2) {
+ lcurrent[0] = hostdata->NOP_insn;
+ lcurrent[1] = 0xdeadbeef;
}
- current[0] = ((DCMD_TYPE_TCI|DCMD_TCI_OP_JUMP) << 24) | DBC_TCI_TRUE;
- current[1] = (u32) virt_to_bus (hostdata->script) +
+ lcurrent[0] = ((DCMD_TYPE_TCI|DCMD_TCI_OP_JUMP) << 24) | DBC_TCI_TRUE;
+ lcurrent[1] = (u32) virt_to_bus (hostdata->script) +
hostdata->E_wait_reselect;
hostdata->reconnect_dsa_head = 0;
hostdata->addr_reconnect_dsa_head = (u32)
@@ -2104,7 +2104,7 @@
int left, found;
volatile struct NCR53c7x0_cmd * linux_search;
volatile struct NCR53c7x0_cmd * volatile *linux_prev;
- volatile u32 *ncr_prev, *current, ncr_search;
+ volatile u32 *ncr_prev, *lcurrent, ncr_search;

#if 0
printk ("scsi%d: abnormal finished\n", host->host_no);
@@ -2120,13 +2120,13 @@
*/


- for (found = 0, left = host->can_queue, current = hostdata->schedule;
- left > 0; --left, current += 2)
+ for (found = 0, left = host->can_queue, lcurrent = hostdata->schedule;
+ left > 0; --left, lcurrent += 2)
{
- if (issue_to_cmd (host, hostdata, (u32 *) current) == cmd)
+ if (issue_to_cmd (host, hostdata, (u32 *) lcurrent) == cmd)
{
- current[0] = hostdata->NOP_insn;
- current[1] = 0xdeadbeef;
+ lcurrent[0] = hostdata->NOP_insn;
+ lcurrent[1] = 0xdeadbeef;
++found;
break;
}
@@ -3964,7 +3964,7 @@
Scsi_Cmnd *tmp = cmd->cmd;
unsigned long flags;
/* dsa start is negative, so subtraction is used */
- volatile u32 *current;
+ volatile u32 *lcurrent;

int i;
NCR53c7x0_local_setup(host);
@@ -3991,9 +3991,9 @@
return;
}

- for (i = host->can_queue, current = hostdata->schedule;
- i > 0 && current[0] != hostdata->NOP_insn;
- --i, current += 2 /* JUMP instructions are two words */);
+ for (i = host->can_queue, lcurrent = hostdata->schedule;
+ i > 0 && lcurrent[0] != hostdata->NOP_insn;
+ --i, lcurrent += 2 /* JUMP instructions are two words */);

if (i > 0) {
++hostdata->busy[tmp->target][tmp->lun];
@@ -4002,13 +4002,13 @@

/* Restore this instruction to a NOP once the command starts */
cmd->dsa [(hostdata->dsa_jump_dest - hostdata->dsa_start) /
- sizeof(u32)] = (u32) virt_to_bus ((void *)current);
+ sizeof(u32)] = (u32) virt_to_bus ((void *)lcurrent);
/* Replace the current jump operand. */
- current[1] =
+ lcurrent[1] =
virt_to_bus ((void *) cmd->dsa) + hostdata->E_dsa_code_begin -
hostdata->E_dsa_code_template;
/* Replace the NOP instruction with a JUMP */
- current[0] = ((DCMD_TYPE_TCI|DCMD_TCI_OP_JUMP) << 24) |
+ lcurrent[0] = ((DCMD_TYPE_TCI|DCMD_TCI_OP_JUMP) << 24) |
DBC_TCI_TRUE;
} else {
printk ("scsi%d: no free slot\n", host->host_no);
@@ -4510,8 +4510,8 @@

/*
* NCR53c700 and NCR53c700-66 change the current SCSI
- * process, hostdata->current, in the Linux driver so
- * cmd = hostdata->current.
+ * process, hostdata->lcurrent, in the Linux driver so
+ * cmd = hostdata->lcurrent.
*
* With other chips, we must look through the commands
* executing and find the command structure which
@@ -4519,7 +4519,7 @@
*/

if (hostdata->options & OPTION_700) {
- cmd = (struct NCR53c7x0_cmd *) hostdata->current;
+ cmd = (struct NCR53c7x0_cmd *) hostdata->lcurrent;
} else {
dsa = bus_to_virt(NCR53c7x0_read32(DSA_REG));
for (cmd = (struct NCR53c7x0_cmd *)
@@ -5872,7 +5872,7 @@
struct NCR53c7x0_hostdata *hostdata = (struct NCR53c7x0_hostdata *)
host->hostdata;
u32 *dsa, *next_dsa;
- volatile u32 *current;
+ volatile u32 *lcurrent;
int left;
Scsi_Cmnd *cmd, *next_cmd;
unsigned long flags;
@@ -5914,11 +5914,11 @@
*/

printk ("scsi%d : schedule dsa array :\n", host->host_no);
- for (left = host->can_queue, current = hostdata->schedule;
- left > 0; current += 2, --left)
- if (current[0] != hostdata->NOP_insn)
+ for (left = host->can_queue, lcurrent = hostdata->schedule;
+ left > 0; lcurrent += 2, --left)
+ if (lcurrent[0] != hostdata->NOP_insn)
/* FIXME : convert pointer to dsa_begin to pointer to dsa. */
- print_dsa (host, bus_to_virt (current[1] -
+ print_dsa (host, bus_to_virt (lcurrent[1] -
(hostdata->E_dsa_code_begin -
hostdata->E_dsa_code_template)), "");
printk ("scsi%d : end schedule dsa array\n", host->host_no);
@@ -6108,7 +6108,7 @@
host->hostdata;
struct NCR53c7x0_cmd *c;
int i;
- u32 *current;
+ u32 *lcurrent;
Scsi_Cmnd *list = NULL, *tmp;
for (c = (struct NCR53c7x0_cmd *) hostdata->running_list; c;
c = (struct NCR53c7x0_cmd *) c->next) {
@@ -6129,12 +6129,12 @@
}

if (free) {
- for (i = 0, current = (u32 *) hostdata->schedule;
- i < host->can_queue; ++i, current += 2) {
- current[0] = hostdata->NOP_insn;
- current[1] = 0xdeadbeef;
+ for (i = 0, lcurrent = (u32 *) hostdata->schedule;
+ i < host->can_queue; ++i, lcurrent += 2) {
+ lcurrent[0] = hostdata->NOP_insn;
+ lcurrent[1] = 0xdeadbeef;
}
- hostdata->current = NULL;
+ hostdata->lcurrent = NULL;
}

if (issue) {