git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
drivers
/
scsi
/
ncr53c8xx.c
diff --git
a/drivers/scsi/ncr53c8xx.c
b/drivers/scsi/ncr53c8xx.c
index
22f9131
..
3235070
100644
(file)
--- a/
drivers/scsi/ncr53c8xx.c
+++ b/
drivers/scsi/ncr53c8xx.c
@@
-69,10
+69,6
@@
** Low PCI traffic for command handling when on-chip RAM is present.
** Aggressive SCSI SCRIPTS optimizations.
**
** Low PCI traffic for command handling when on-chip RAM is present.
** Aggressive SCSI SCRIPTS optimizations.
**
-** 2005 by Matthew Wilcox and James Bottomley
-** PCI-ectomy. This driver now supports only the 720 chip (see the
-** NCR_Q720 and zalon drivers for the bus probe logic).
-**
*******************************************************************************
*/
*******************************************************************************
*/
@@
-94,6
+90,13
@@
#define SCSI_NCR_DEBUG_FLAGS (0)
#define SCSI_NCR_DEBUG_FLAGS (0)
+/*==========================================================
+**
+** Include files
+**
+**==========================================================
+*/
+
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
@@
-118,7
+121,6
@@
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
-#include <scsi/scsi_dbg.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_transport.h>
@@
-126,8
+128,10
@@
#include "ncr53c8xx.h"
#include "ncr53c8xx.h"
+#define NAME53C "ncr53c"
#define NAME53C8XX "ncr53c8xx"
#define NAME53C8XX "ncr53c8xx"
+
/*==========================================================
**
** Debugging tags
/*==========================================================
**
** Debugging tags
@@
-2107,7
+2111,7
@@
static struct script script0 __initdata = {
*/
/*
*/
/*
- ** The M
ESSAGE
_REJECT problem seems to be due to a selection
+ ** The M_REJECT problem seems to be due to a selection
** timing problem.
** Wait immediately for the selection to complete.
** (2.5x behaves so)
** timing problem.
** Wait immediately for the selection to complete.
** (2.5x behaves so)
@@
-2158,7
+2162,7
@@
static struct script script0 __initdata = {
/*
** Selection complete.
** Send the IDENTIFY and SIMPLE_TAG messages
/*
** Selection complete.
** Send the IDENTIFY and SIMPLE_TAG messages
- ** (and the
EXTENDED_SDTR
message)
+ ** (and the
M_X_SYNC_REQ
message)
*/
SCR_MOVE_TBL ^ SCR_MSG_OUT,
offsetof (struct dsb, smsg),
*/
SCR_MOVE_TBL ^ SCR_MSG_OUT,
offsetof (struct dsb, smsg),
@@
-2187,7
+2191,7
@@
static struct script script0 __initdata = {
/*
** Initialize the msgout buffer with a NOOP message.
*/
/*
** Initialize the msgout buffer with a NOOP message.
*/
- SCR_LOAD_REG (scratcha,
N
OP),
+ SCR_LOAD_REG (scratcha,
M_NO
OP),
0,
SCR_COPY (1),
RADDR (scratcha),
0,
SCR_COPY (1),
RADDR (scratcha),
@@
-2339,21
+2343,21
@@
static struct script script0 __initdata = {
/*
** Handle this message.
*/
/*
** Handle this message.
*/
- SCR_JUMP ^ IFTRUE (DATA (
COMMAND
_COMPLETE)),
+ SCR_JUMP ^ IFTRUE (DATA (
M
_COMPLETE)),
PADDR (complete),
PADDR (complete),
- SCR_JUMP ^ IFTRUE (DATA (DISCONNECT)),
+ SCR_JUMP ^ IFTRUE (DATA (
M_
DISCONNECT)),
PADDR (disconnect),
PADDR (disconnect),
- SCR_JUMP ^ IFTRUE (DATA (
SAVE_POINTERS
)),
+ SCR_JUMP ^ IFTRUE (DATA (
M_SAVE_DP
)),
PADDR (save_dp),
PADDR (save_dp),
- SCR_JUMP ^ IFTRUE (DATA (
RESTORE_POINTERS
)),
+ SCR_JUMP ^ IFTRUE (DATA (
M_RESTORE_DP
)),
PADDR (restore_dp),
PADDR (restore_dp),
- SCR_JUMP ^ IFTRUE (DATA (
EXTENDED_MESSAGE
)),
+ SCR_JUMP ^ IFTRUE (DATA (
M_EXTENDED
)),
PADDRH (msg_extended),
PADDRH (msg_extended),
- SCR_JUMP ^ IFTRUE (DATA (
N
OP)),
+ SCR_JUMP ^ IFTRUE (DATA (
M_NO
OP)),
PADDR (clrack),
PADDR (clrack),
- SCR_JUMP ^ IFTRUE (DATA (M
ESSAGE
_REJECT)),
+ SCR_JUMP ^ IFTRUE (DATA (M_REJECT)),
PADDRH (msg_reject),
PADDRH (msg_reject),
- SCR_JUMP ^ IFTRUE (DATA (
IGNORE_WIDE
_RESIDUE)),
+ SCR_JUMP ^ IFTRUE (DATA (
M_IGN
_RESIDUE)),
PADDRH (msg_ign_residue),
/*
** Rest of the messages left as
PADDRH (msg_ign_residue),
/*
** Rest of the messages left as
@@
-2368,7
+2372,7
@@
static struct script script0 __initdata = {
*/
SCR_INT,
SIR_REJECT_SENT,
*/
SCR_INT,
SIR_REJECT_SENT,
- SCR_LOAD_REG (scratcha, M
ESSAGE
_REJECT),
+ SCR_LOAD_REG (scratcha, M_REJECT),
0,
}/*-------------------------< SETMSG >----------------------*/,{
SCR_COPY (1),
0,
}/*-------------------------< SETMSG >----------------------*/,{
SCR_COPY (1),
@@
-2560,7
+2564,7
@@
static struct script script0 __initdata = {
/*
** If it was no ABORT message ...
*/
/*
** If it was no ABORT message ...
*/
- SCR_JUMP ^ IFTRUE (DATA (
ABORT_TASK_SE
T)),
+ SCR_JUMP ^ IFTRUE (DATA (
M_ABOR
T)),
PADDRH (msg_out_abort),
/*
** ... wait for the next phase
PADDRH (msg_out_abort),
/*
** ... wait for the next phase
@@
-2572,7
+2576,7
@@
static struct script script0 __initdata = {
/*
** ... else clear the message ...
*/
/*
** ... else clear the message ...
*/
- SCR_LOAD_REG (scratcha,
N
OP),
+ SCR_LOAD_REG (scratcha,
M_NO
OP),
0,
SCR_COPY (4),
RADDR (scratcha),
0,
SCR_COPY (4),
RADDR (scratcha),
@@
-3031,7
+3035,7
@@
static struct scripth scripth0 __initdata = {
*/
SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
NADDR (msgin[2]),
*/
SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
NADDR (msgin[2]),
- SCR_JUMP ^ IFTRUE (DATA (
EXTENDED_WDTR
)),
+ SCR_JUMP ^ IFTRUE (DATA (
M_X_WIDE_REQ
)),
PADDRH (msg_wdtr),
/*
** unknown extended message
PADDRH (msg_wdtr),
/*
** unknown extended message
@@
-3065,7
+3069,7
@@
static struct scripth scripth0 __initdata = {
}/*-------------------------< SEND_WDTR >----------------*/,{
/*
}/*-------------------------< SEND_WDTR >----------------*/,{
/*
- ** Send the
EXTENDED_WDTR
+ ** Send the
M_X_WIDE_REQ
*/
SCR_MOVE_ABS (4) ^ SCR_MSG_OUT,
NADDR (msgout),
*/
SCR_MOVE_ABS (4) ^ SCR_MSG_OUT,
NADDR (msgout),
@@
-3085,7
+3089,7
@@
static struct scripth scripth0 __initdata = {
*/
SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
NADDR (msgin[2]),
*/
SCR_MOVE_ABS (1) ^ SCR_MSG_IN,
NADDR (msgin[2]),
- SCR_JUMP ^ IFTRUE (DATA (
EXTENDED_SDTR
)),
+ SCR_JUMP ^ IFTRUE (DATA (
M_X_SYNC_REQ
)),
PADDRH (msg_sdtr),
/*
** unknown extended message
PADDRH (msg_sdtr),
/*
** unknown extended message
@@
-3120,7
+3124,7
@@
static struct scripth scripth0 __initdata = {
}/*-------------------------< SEND_SDTR >-------------*/,{
/*
}/*-------------------------< SEND_SDTR >-------------*/,{
/*
- ** Send the
EXTENDED_SDTR
+ ** Send the
M_X_SYNC_REQ
*/
SCR_MOVE_ABS (5) ^ SCR_MSG_OUT,
NADDR (msgout),
*/
SCR_MOVE_ABS (5) ^ SCR_MSG_OUT,
NADDR (msgout),
@@
-3198,10
+3202,10
@@
static struct scripth scripth0 __initdata = {
}/*-------------------------< RESET >----------------------*/,{
/*
}/*-------------------------< RESET >----------------------*/,{
/*
- ** Send a
TARGET
_RESET message if bad IDENTIFY
+ ** Send a
M
_RESET message if bad IDENTIFY
** received on reselection.
*/
** received on reselection.
*/
- SCR_LOAD_REG (scratcha,
ABORT_TASK
),
+ SCR_LOAD_REG (scratcha,
M_ABORT_TAG
),
0,
SCR_JUMP,
PADDRH (abort_resel),
0,
SCR_JUMP,
PADDRH (abort_resel),
@@
-3209,7
+3213,7
@@
static struct scripth scripth0 __initdata = {
/*
** Abort a wrong tag received on reselection.
*/
/*
** Abort a wrong tag received on reselection.
*/
- SCR_LOAD_REG (scratcha,
ABORT_TASK
),
+ SCR_LOAD_REG (scratcha,
M_ABORT_TAG
),
0,
SCR_JUMP,
PADDRH (abort_resel),
0,
SCR_JUMP,
PADDRH (abort_resel),
@@
-3217,7
+3221,7
@@
static struct scripth scripth0 __initdata = {
/*
** Abort a reselection when no active CCB.
*/
/*
** Abort a reselection when no active CCB.
*/
- SCR_LOAD_REG (scratcha,
ABORT_TASK_SE
T),
+ SCR_LOAD_REG (scratcha,
M_ABOR
T),
0,
}/*-------------------------< ABORT_RESEL >----------------*/,{
SCR_COPY (1),
0,
}/*-------------------------< ABORT_RESEL >----------------*/,{
SCR_COPY (1),
@@
-3329,7
+3333,7
@@
static struct scripth scripth0 __initdata = {
** Read the message, since we got it directly
** from the SCSI BUS data lines.
** Signal problem to C code for logging the event.
** Read the message, since we got it directly
** from the SCSI BUS data lines.
** Signal problem to C code for logging the event.
- ** Send a
n ABORT_TASK_SE
T to clear all pending tasks.
+ ** Send a
M_ABOR
T to clear all pending tasks.
*/
SCR_INT,
SIR_RESEL_BAD_LUN,
*/
SCR_INT,
SIR_RESEL_BAD_LUN,
@@
-3341,7
+3345,7
@@
static struct scripth scripth0 __initdata = {
/*
** We donnot have a task for that I_T_L.
** Signal problem to C code for logging the event.
/*
** We donnot have a task for that I_T_L.
** Signal problem to C code for logging the event.
- ** Send a
n ABORT_TASK_SE
T message.
+ ** Send a
M_ABOR
T message.
*/
SCR_INT,
SIR_RESEL_BAD_I_T_L,
*/
SCR_INT,
SIR_RESEL_BAD_I_T_L,
@@
-3351,7
+3355,7
@@
static struct scripth scripth0 __initdata = {
/*
** We donnot have a task that matches the tag.
** Signal problem to C code for logging the event.
/*
** We donnot have a task that matches the tag.
** Signal problem to C code for logging the event.
- ** Send a
n ABORT_TASK
message.
+ ** Send a
M_ABORTTAG
message.
*/
SCR_INT,
SIR_RESEL_BAD_I_T_L_Q,
*/
SCR_INT,
SIR_RESEL_BAD_I_T_L_Q,
@@
-3362,7
+3366,7
@@
static struct scripth scripth0 __initdata = {
** We donnot know the target that reselected us.
** Grab the first message if any (IDENTIFY).
** Signal problem to C code for logging the event.
** We donnot know the target that reselected us.
** Grab the first message if any (IDENTIFY).
** Signal problem to C code for logging the event.
- **
TARGET
_RESET message.
+ **
M
_RESET message.
*/
SCR_INT,
SIR_RESEL_BAD_TARGET,
*/
SCR_INT,
SIR_RESEL_BAD_TARGET,
@@
-4105,11
+4109,17
@@
static int ncr_prepare_nego(struct ncb *np, struct ccb *cp, u_char *msgptr)
switch (nego) {
case NS_SYNC:
switch (nego) {
case NS_SYNC:
- msglen += spi_populate_sync_msg(msgptr + msglen,
- tp->maxoffs ? tp->minsync : 0, tp->maxoffs);
+ msgptr[msglen++] = M_EXTENDED;
+ msgptr[msglen++] = 3;
+ msgptr[msglen++] = M_X_SYNC_REQ;
+ msgptr[msglen++] = tp->maxoffs ? tp->minsync : 0;
+ msgptr[msglen++] = tp->maxoffs;
break;
case NS_WIDE:
break;
case NS_WIDE:
- msglen += spi_populate_width_msg(msgptr + msglen, tp->usrwide);
+ msgptr[msglen++] = M_EXTENDED;
+ msgptr[msglen++] = 2;
+ msgptr[msglen++] = M_X_WIDE_REQ;
+ msgptr[msglen++] = tp->usrwide;
break;
}
break;
}
@@
-4210,7
+4220,7
@@
static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd)
**----------------------------------------------------
*/
**----------------------------------------------------
*/
- idmsg =
IDENTIFY(0, sdev->lun)
;
+ idmsg =
M_IDENTIFY | sdev->lun
;
if (cp ->tag != NO_TAG ||
(cp != np->ccb && np->disc && !(tp->usrflag & UF_NODISC)))
if (cp ->tag != NO_TAG ||
(cp != np->ccb && np->disc && !(tp->usrflag & UF_NODISC)))
@@
-4229,7
+4239,7
@@
static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd)
*/
if (lp && time_after(jiffies, lp->tags_stime)) {
if (lp->tags_smap) {
*/
if (lp && time_after(jiffies, lp->tags_stime)) {
if (lp->tags_smap) {
- order =
ORDERED_QUEUE
_TAG;
+ order =
M_ORDERED
_TAG;
if ((DEBUG_FLAGS & DEBUG_TAGS)||bootverbose>2){
PRINT_ADDR(cmd,
"ordered tag forced.\n");
if ((DEBUG_FLAGS & DEBUG_TAGS)||bootverbose>2){
PRINT_ADDR(cmd,
"ordered tag forced.\n");
@@
-4247,10
+4257,10
@@
static int ncr_queue_command (struct ncb *np, struct scsi_cmnd *cmd)
case 0x08: /* READ_SMALL (6) */
case 0x28: /* READ_BIG (10) */
case 0xa8: /* READ_HUGE (12) */
case 0x08: /* READ_SMALL (6) */
case 0x28: /* READ_BIG (10) */
case 0xa8: /* READ_HUGE (12) */
- order =
SIMPLE_QUEU
E_TAG;
+ order =
M_SIMPL
E_TAG;
break;
default:
break;
default:
- order =
ORDERED_QUEUE
_TAG;
+ order =
M_ORDERED
_TAG;
}
}
msgptr[msglen++] = order;
}
}
msgptr[msglen++] = order;
@@
-6219,9
+6229,9
@@
static int ncr_int_par (struct ncb *np)
if (!(dbc & 0xc0000000))
phase = (dbc >> 24) & 7;
if (phase == 7)
if (!(dbc & 0xc0000000))
phase = (dbc >> 24) & 7;
if (phase == 7)
- msg = M
SG_PARITY_ERROR
;
+ msg = M
_PARITY
;
else
else
- msg =
INITIATOR
_ERROR;
+ msg =
M_ID
_ERROR;
/*
/*
@@
-6785,8
+6795,6
@@
void ncr_int_sir (struct ncb *np)
/*-----------------------------------------------------------------------------
**
** Was Sie schon immer ueber transfermode negotiation wissen wollten ...
/*-----------------------------------------------------------------------------
**
** Was Sie schon immer ueber transfermode negotiation wissen wollten ...
-** ("Everything you've always wanted to know about transfer mode
-** negotiation")
**
** We try to negotiate sync and wide transfer only after
** a successful inquire command. We look at byte 7 of the
**
** We try to negotiate sync and wide transfer only after
** a successful inquire command. We look at byte 7 of the
@@
-6888,8
+6896,8
@@
void ncr_int_sir (struct ncb *np)
break;
}
break;
}
- np->msgin [0] =
N
OP;
- np->msgout[0] =
N
OP;
+ np->msgin [0] =
M_NO
OP;
+ np->msgout[0] =
M_NO
OP;
cp->nego_status = 0;
break;
cp->nego_status = 0;
break;
@@
-6983,7
+6991,12
@@
void ncr_int_sir (struct ncb *np)
spi_offset(starget) = ofs;
ncr_setsync(np, cp, scntl3, (fak<<5)|ofs);
spi_offset(starget) = ofs;
ncr_setsync(np, cp, scntl3, (fak<<5)|ofs);
- spi_populate_sync_msg(np->msgout, per, ofs);
+ np->msgout[0] = M_EXTENDED;
+ np->msgout[1] = 3;
+ np->msgout[2] = M_X_SYNC_REQ;
+ np->msgout[3] = per;
+ np->msgout[4] = ofs;
+
cp->nego_status = NS_SYNC;
if (DEBUG_FLAGS & DEBUG_NEGO) {
cp->nego_status = NS_SYNC;
if (DEBUG_FLAGS & DEBUG_NEGO) {
@@
-6994,7
+7007,7
@@
void ncr_int_sir (struct ncb *np)
OUTL_DSP (NCB_SCRIPT_PHYS (np, msg_bad));
return;
}
OUTL_DSP (NCB_SCRIPT_PHYS (np, msg_bad));
return;
}
- np->msgin [0] =
N
OP;
+ np->msgin [0] =
M_NO
OP;
break;
break;
@@
-7069,9
+7082,13
@@
void ncr_int_sir (struct ncb *np)
spi_width(starget) = wide;
ncr_setwide(np, cp, wide, 1);
spi_width(starget) = wide;
ncr_setwide(np, cp, wide, 1);
- spi_populate_width_msg(np->msgout, wide);
- np->msgin [0] = NOP;
+ np->msgout[0] = M_EXTENDED;
+ np->msgout[1] = 2;
+ np->msgout[2] = M_X_WIDE_REQ;
+ np->msgout[3] = wide;
+
+ np->msgin [0] = M_NOOP;
cp->nego_status = NS_WIDE;
cp->nego_status = NS_WIDE;
@@
-7090,12
+7107,12
@@
void ncr_int_sir (struct ncb *np)
case SIR_REJECT_RECEIVED:
/*-----------------------------------------------
**
case SIR_REJECT_RECEIVED:
/*-----------------------------------------------
**
- ** We received a M
ESSAGE_REJECT
.
+ ** We received a M
_REJECT message
.
**
**-----------------------------------------------
*/
**
**-----------------------------------------------
*/
- PRINT_ADDR(cp->cmd, "M
ESSAGE
_REJECT received (%x:%x).\n",
+ PRINT_ADDR(cp->cmd, "M_REJECT received (%x:%x).\n",
(unsigned)scr_to_cpu(np->lastmsg), np->msgout[0]);
break;
(unsigned)scr_to_cpu(np->lastmsg), np->msgout[0]);
break;
@@
-7107,7
+7124,7
@@
void ncr_int_sir (struct ncb *np)
**-----------------------------------------------
*/
**-----------------------------------------------
*/
- ncr_print_msg(cp, "M
ESSAGE
_REJECT sent for", np->msgin);
+ ncr_print_msg(cp, "M_REJECT sent for", np->msgin);
break;
/*--------------------------------------------------------------------
break;
/*--------------------------------------------------------------------
@@
-7126,7
+7143,7
@@
void ncr_int_sir (struct ncb *np)
**-----------------------------------------------
*/
**-----------------------------------------------
*/
- PRINT_ADDR(cp->cmd, "
IGNORE_WIDE
_RESIDUE received, but not yet "
+ PRINT_ADDR(cp->cmd, "
M_IGN
_RESIDUE received, but not yet "
"implemented.\n");
break;
#if 0
"implemented.\n");
break;
#if 0
@@
-7139,7
+7156,7
@@
void ncr_int_sir (struct ncb *np)
**-----------------------------------------------
*/
**-----------------------------------------------
*/
- PRINT_ADDR(cp->cmd, "DISCONNECT received, but datapointer "
+ PRINT_ADDR(cp->cmd, "
M_
DISCONNECT received, but datapointer "
"not saved: data=%x save=%x goal=%x.\n",
(unsigned) INL (nc_temp),
(unsigned) scr_to_cpu(np->header.savep),
"not saved: data=%x save=%x goal=%x.\n",
(unsigned) INL (nc_temp),
(unsigned) scr_to_cpu(np->header.savep),
@@
-7845,7
+7862,7
@@
static int __init ncr_snooptest (struct ncb* np)
**==========================================================
**
** Note: we have to return the correct value.
**==========================================================
**
** Note: we have to return the correct value.
-** THERE IS NO SA
F
E DEFAULT VALUE.
+** THERE IS NO SA
V
E DEFAULT VALUE.
**
** Most NCR/SYMBIOS boards are delivered with a 40 Mhz clock.
** 53C860 and 53C875 rev. 1 support fast20 transfers but
**
** Most NCR/SYMBIOS boards are delivered with a 40 Mhz clock.
** 53C860 and 53C875 rev. 1 support fast20 transfers but
@@
-8545,7
+8562,7
@@
struct Scsi_Host * __init ncr_attach(struct scsi_host_template *tpnt,
/* use SIMPLE TAG messages by default */
#ifdef SCSI_NCR_ALWAYS_SIMPLE_TAG
/* use SIMPLE TAG messages by default */
#ifdef SCSI_NCR_ALWAYS_SIMPLE_TAG
- np->order =
SIMPLE_QUEU
E_TAG;
+ np->order =
M_SIMPL
E_TAG;
#endif
spin_unlock_irqrestore(&np->smp_lock, flags);
#endif
spin_unlock_irqrestore(&np->smp_lock, flags);