Commit 7ee40b43 authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

sym2 2.1.18m

From: 	Matthew Wilcox <matthew@wil.cx>

sym2 2.1.18m:
 - Improve documentation
 - Remove host-level command queueing (Christoph Hellwig)
 - Add support for IU and QAS
 - sparse annotation (Randolph Chung)
 - Remove SYM_LINUX_BOOT_COMMAND_LINE_SUPPORT ifdefs
 - Switch to the new module_param interface
   - Rename tags to cmd_per_lun for consistency
   - Fix debug param
   - Split extended tags functionality into the new tag_ctrl parameter
   - rewrite how safe param works
   - reverse_probe param has had no effect for a while, remove it.
   - Add descriptions for all the parameters
 - Add MODULE_AUTHOR and MODULE_DESCRIPTION
 - Restructure sym_config_pqs() a little
 - Move hostid setup to a more sensible place
 - Do away with SYM_GLUE_C
 - Use a completion instead of a semaphore (Thomas Gleixner)
 - Use IDENTIFY() instead of M_IDENTIFY
 - Define messages in terms of those defined in <scsi/scsi.h>
 - Define PCI IDs in terms of those in <linux/pci_ids.h>
 - Define sym2's status codes in terms of the SAM ones defined in <scsi/scsi.h>

Added brown bag fix
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent cb45c591
This diff is collapsed.
......@@ -68,7 +68,6 @@
*/
#if 1
#define SYM_LINUX_PROC_INFO_SUPPORT
#define SYM_LINUX_BOOT_COMMAND_LINE_SUPPORT
#define SYM_LINUX_USER_COMMAND_SUPPORT
#define SYM_LINUX_USER_INFO_SUPPORT
#define SYM_LINUX_DEBUG_CONTROL_SUPPORT
......@@ -129,9 +128,7 @@ struct sym_driver_setup {
u_char scsi_bus_check;
u_char host_id;
u_char reverse_probe;
u_char verbose;
u_short debug;
u_char settle_delay;
u_char use_nvram;
u_long excludes[8];
......@@ -145,6 +142,7 @@ struct sym_driver_setup {
#define SYM_SETUP_IRQ_MODE sym_driver_setup.irq_mode
#define SYM_SETUP_SCSI_BUS_CHECK sym_driver_setup.scsi_bus_check
#define SYM_SETUP_HOST_ID sym_driver_setup.host_id
#define boot_verbose sym_driver_setup.verbose
/* Always enable parity. */
#define SYM_SETUP_PCI_PARITY 1
......@@ -163,54 +161,13 @@ struct sym_driver_setup {
.irq_mode = 0, \
.scsi_bus_check = 1, \
.host_id = 7, \
.reverse_probe = 0, \
.verbose = 0, \
.debug = 0, \
.settle_delay = 3, \
.use_nvram = 1, \
}
/*
* Boot fail safe setup.
*
* Override initial setup from boot command line:
* sym53c8xx=safe:y
*/
#define SYM_LINUX_DRIVER_SAFE_SETUP { \
.max_tag = 0, \
.burst_order = 0, \
.scsi_led = 0, \
.scsi_diff = 1, \
.irq_mode = 0, \
.scsi_bus_check = 2, \
.host_id = 7, \
.reverse_probe = 0, \
.verbose = 2, \
.debug = 0, \
.settle_delay = 10, \
.use_nvram = 1, \
}
/*
* This structure is initialized from linux config options.
* It can be overridden at boot-up by the boot command line.
*/
#ifdef SYM_GLUE_C
struct sym_driver_setup
sym_driver_setup = SYM_LINUX_DRIVER_SETUP;
#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT
u_int sym_debug_flags = 0;
#endif
#else
extern struct sym_driver_setup sym_driver_setup;
#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT
extern u_int sym_debug_flags;
#endif
#endif /* SYM_GLUE_C */
#ifdef SYM_LINUX_DEBUG_CONTROL_SUPPORT
extern unsigned int sym_debug_flags;
#define DEBUG_FLAGS sym_debug_flags
#endif
#define boot_verbose sym_driver_setup.verbose
#endif /* SYM53C8XX_H */
......@@ -40,33 +40,28 @@
#ifndef SYM_DEFS_H
#define SYM_DEFS_H
#define SYM_VERSION "2.1.18k"
#define SYM_VERSION "2.1.18m"
#define SYM_DRIVER_NAME "sym-" SYM_VERSION
/*
* Vendor.
*/
#define PCI_VENDOR_NCR 0x1000
/*
* PCI device identifier of SYMBIOS chips.
*/
#define PCI_ID_SYM53C810 1
#define PCI_ID_SYM53C810AP 5
#define PCI_ID_SYM53C815 4
#define PCI_ID_SYM53C820 2
#define PCI_ID_SYM53C825 3
#define PCI_ID_SYM53C860 6
#define PCI_ID_SYM53C875 0xf
#define PCI_ID_SYM53C875_2 0x8f
#define PCI_ID_SYM53C885 0xd
#define PCI_ID_SYM53C895 0xc
#define PCI_ID_SYM53C896 0xb
#define PCI_ID_SYM53C895A 0x12
#define PCI_ID_SYM53C875A 0x13
#define PCI_ID_LSI53C1010_33 0x20
#define PCI_ID_LSI53C1010_66 0x21
#define PCI_ID_LSI53C1510D 0xa
#define PCI_ID_SYM53C810 PCI_DEVICE_ID_NCR_53C810
#define PCI_ID_SYM53C810AP PCI_DEVICE_ID_LSI_53C810AP
#define PCI_ID_SYM53C815 PCI_DEVICE_ID_NCR_53C815
#define PCI_ID_SYM53C820 PCI_DEVICE_ID_NCR_53C820
#define PCI_ID_SYM53C825 PCI_DEVICE_ID_NCR_53C825
#define PCI_ID_SYM53C860 PCI_DEVICE_ID_NCR_53C860
#define PCI_ID_SYM53C875 PCI_DEVICE_ID_NCR_53C875
#define PCI_ID_SYM53C875_2 PCI_DEVICE_ID_NCR_53C875J
#define PCI_ID_SYM53C885 PCI_DEVICE_ID_NCR_53C885
#define PCI_ID_SYM53C895 PCI_DEVICE_ID_NCR_53C895
#define PCI_ID_SYM53C896 PCI_DEVICE_ID_NCR_53C896
#define PCI_ID_SYM53C895A PCI_DEVICE_ID_LSI_53C895A
#define PCI_ID_SYM53C875A PCI_DEVICE_ID_LSI_53C875A
#define PCI_ID_LSI53C1010_33 PCI_DEVICE_ID_LSI_53C1010_33
#define PCI_ID_LSI53C1010_66 PCI_DEVICE_ID_LSI_53C1010_66
#define PCI_ID_LSI53C1510D PCI_DEVICE_ID_LSI_53C1510
/*
* SYM53C8XX device features descriptor.
......@@ -763,33 +758,32 @@ struct sym_tblsel {
* Messages
*/
#define M_COMPLETE (0x00)
#define M_EXTENDED (0x01)
#define M_SAVE_DP (0x02)
#define M_RESTORE_DP (0x03)
#define M_DISCONNECT (0x04)
#define M_ID_ERROR (0x05)
#define M_ABORT (0x06)
#define M_REJECT (0x07)
#define M_NOOP (0x08)
#define M_PARITY (0x09)
#define M_LCOMPLETE (0x0a)
#define M_FCOMPLETE (0x0b)
#define M_RESET (0x0c)
#define M_COMPLETE COMMAND_COMPLETE
#define M_EXTENDED EXTENDED_MESSAGE
#define M_SAVE_DP SAVE_POINTERS
#define M_RESTORE_DP RESTORE_POINTERS
#define M_DISCONNECT DISCONNECT
#define M_ID_ERROR INITIATOR_ERROR
#define M_ABORT ABORT
#define M_REJECT MESSAGE_REJECT
#define M_NOOP NOP
#define M_PARITY MSG_PARITY_ERROR
#define M_LCOMPLETE LINKED_CMD_COMPLETE
#define M_FCOMPLETE LINKED_FLG_CMD_COMPLETE
#define M_RESET BUS_DEVICE_RESET
#define M_ABORT_TAG (0x0d)
#define M_CLEAR_QUEUE (0x0e)
#define M_INIT_REC (0x0f)
#define M_REL_REC (0x10)
#define M_INIT_REC INITIATE_RECOVERY
#define M_REL_REC RELEASE_RECOVERY
#define M_TERMINATE (0x11)
#define M_SIMPLE_TAG (0x20)
#define M_HEAD_TAG (0x21)
#define M_ORDERED_TAG (0x22)
#define M_SIMPLE_TAG SIMPLE_QUEUE_TAG
#define M_HEAD_TAG HEAD_OF_QUEUE_TAG
#define M_ORDERED_TAG ORDERED_QUEUE_TAG
#define M_IGN_RESIDUE (0x23)
#define M_IDENTIFY (0x80)
#define M_X_MODIFY_DP (0x00)
#define M_X_SYNC_REQ (0x01)
#define M_X_WIDE_REQ (0x03)
#define M_X_MODIFY_DP EXTENDED_MODIFY_DATA_POINTER
#define M_X_SYNC_REQ EXTENDED_SDTR
#define M_X_WIDE_REQ EXTENDED_WDTR
#define M_X_PPR_REQ (0x04)
/*
......@@ -804,15 +798,15 @@ struct sym_tblsel {
* Status
*/
#define S_GOOD (0x00)
#define S_CHECK_COND (0x02)
#define S_COND_MET (0x04)
#define S_BUSY (0x08)
#define S_INT (0x10)
#define S_INT_COND_MET (0x14)
#define S_CONFLICT (0x18)
#define S_TERMINATED (0x20)
#define S_QUEUE_FULL (0x28)
#define S_GOOD SAM_STAT_GOOD
#define S_CHECK_COND SAM_STAT_CHECK_CONDITION
#define S_COND_MET SAM_STAT_CONDITION_MET
#define S_BUSY SAM_STAT_BUSY
#define S_INT SAM_STAT_INTERMEDIATE
#define S_INT_COND_MET SAM_STAT_INTERMEDIATE_CONDITION_MET
#define S_CONFLICT SAM_STAT_RESERVATION_CONFLICT
#define S_TERMINATED SAM_STAT_COMMAND_TERMINATED
#define S_QUEUE_FULL SAM_STAT_TASK_SET_FULL
#define S_ILLEGAL (0xff)
#endif /* defined SYM_DEFS_H */
This diff is collapsed.
......@@ -381,9 +381,6 @@ struct sym_shcb {
u_short io_ws; /* IO window size */
int irq; /* IRQ number */
SYM_QUEHEAD wait_cmdq; /* Awaiting SCSI commands */
SYM_QUEHEAD busy_cmdq; /* Enqueued SCSI commands */
struct timer_list timer; /* Timer handler link header */
u_long lasttime;
u_long settle_time; /* Resetting the SCSI BUS */
......
......@@ -1503,6 +1503,7 @@ static void sym_check_goals(struct scsi_device *sdev)
if (st->period > np->maxsync_dt)
st->period = np->maxsync_dt;
} else {
st->options &= ~PPR_OPT_MASK;
if (st->offset > np->maxoffs)
st->offset = np->maxoffs;
if (st->period < np->minsync)
......@@ -1510,7 +1511,7 @@ static void sym_check_goals(struct scsi_device *sdev)
if (st->period > np->maxsync)
st->period = np->maxsync;
}
}
}
/*
* Prepare the next negotiation message if needed.
......@@ -1575,7 +1576,7 @@ static int sym_prepare_nego(hcb_p np, ccb_p cp, int nego, u_char *msgptr)
msgptr[msglen++] = 0;
msgptr[msglen++] = tp->tinfo.goal.offset;
msgptr[msglen++] = tp->tinfo.goal.width;
msgptr[msglen++] = tp->tinfo.goal.options & PPR_OPT_DT;
msgptr[msglen++] = tp->tinfo.goal.options & PPR_OPT_MASK;
break;
};
......@@ -2009,7 +2010,7 @@ void sym_start_up (hcb_p np, int reason)
/*
* Switch trans mode for current job and it's target.
*/
static void sym_settrans(hcb_p np, int target, u_char dt, u_char ofs,
static void sym_settrans(hcb_p np, int target, u_char opts, u_char ofs,
u_char per, u_char wide, u_char div, u_char fak)
{
SYM_QUEHEAD *qp;
......@@ -2060,7 +2061,7 @@ static void sym_settrans(hcb_p np, int target, u_char dt, u_char ofs,
*/
if (np->features & FE_C10) {
uval = uval & ~(U3EN|AIPCKEN);
if (dt) {
if (opts) {
assert(np->features & FE_U3EN);
uval |= U3EN;
}
......@@ -2163,17 +2164,17 @@ sym_setsync(hcb_p np, int target,
* Let everything be aware of the changes.
*/
static void
sym_setpprot(hcb_p np, int target, u_char dt, u_char ofs,
sym_setpprot(hcb_p np, int target, u_char opts, u_char ofs,
u_char per, u_char wide, u_char div, u_char fak)
{
tcb_p tp = &np->target[target];
sym_settrans(np, target, dt, ofs, per, wide, div, fak);
sym_settrans(np, target, opts, ofs, per, wide, div, fak);
tp->tinfo.goal.width = tp->tinfo.curr.width = wide;
tp->tinfo.goal.period = tp->tinfo.curr.period = per;
tp->tinfo.goal.offset = tp->tinfo.curr.offset = ofs;
tp->tinfo.goal.options = tp->tinfo.curr.options = dt;
tp->tinfo.goal.options = tp->tinfo.curr.options = opts;
sym_xpt_async_nego_ppr(np, target);
}
......@@ -2734,7 +2735,7 @@ static void sym_int_ma (hcb_p np)
if (dsp == SCRIPTA_BA (np, send_ident)) {
if (cp->tag != NO_TAG && olen - rest <= 3) {
cp->host_status = HS_BUSY;
np->msgout[0] = M_IDENTIFY | cp->lun;
np->msgout[0] = IDENTIFY(0, cp->lun);
nxtdsp = SCRIPTB_BA (np, ident_break_atn);
}
else
......@@ -3163,10 +3164,7 @@ static void sym_sir_bad_scsi_status(hcb_p np, int num, ccb_p cp)
* requesting sense data.
*/
/*
* identify message
*/
cp->scsi_smsg2[0] = M_IDENTIFY | cp->lun;
cp->scsi_smsg2[0] = IDENTIFY(0, cp->lun);
msglen = 1;
/*
......@@ -3525,8 +3523,8 @@ static void sym_sir_task_recovery(hcb_p np, int num)
*/
if (lun != -1) {
lcb_p lp = sym_lp(np, tp, lun);
lp->to_clear = 0; /* We donnot expect to fail here */
np->abrt_msg[0] = M_IDENTIFY | lun;
lp->to_clear = 0; /* We don't expect to fail here */
np->abrt_msg[0] = IDENTIFY(0, lun);
np->abrt_msg[1] = M_ABORT;
np->abrt_tbl.size = 2;
break;
......@@ -3567,7 +3565,7 @@ static void sym_sir_task_recovery(hcb_p np, int num)
* We have some task to abort.
* Set the IDENTIFY(lun)
*/
np->abrt_msg[0] = M_IDENTIFY | cp->lun;
np->abrt_msg[0] = IDENTIFY(0, cp->lun);
/*
* If we want to abort an untagged command, we
......@@ -3578,8 +3576,7 @@ static void sym_sir_task_recovery(hcb_p np, int num)
if (cp->tag == NO_TAG) {
np->abrt_msg[1] = M_ABORT;
np->abrt_tbl.size = 2;
}
else {
} else {
np->abrt_msg[1] = cp->scsi_smsg[1];
np->abrt_msg[2] = cp->scsi_smsg[2];
np->abrt_msg[3] = M_ABORT_TAG;
......@@ -4139,20 +4136,17 @@ static int
sym_ppr_nego_check(hcb_p np, int req, int target)
{
tcb_p tp = &np->target[target];
u_char chg, ofs, per, fak, dt, div, wide;
unsigned char fak, div;
int dt, chg = 0;
unsigned char per = np->msgin[3];
unsigned char ofs = np->msgin[5];
unsigned char wide = np->msgin[6];
unsigned char opts = np->msgin[7] & PPR_OPT_MASK;
if (DEBUG_FLAGS & DEBUG_NEGO) {
sym_print_nego_msg(np, target, "ppr msgin", np->msgin);
};
/*
* Get requested values.
*/
chg = 0;
per = np->msgin[3];
ofs = np->msgin[5];
wide = np->msgin[6];
dt = np->msgin[7] & PPR_OPT_DT;
}
/*
* Check values against our limits.
......@@ -4162,29 +4156,30 @@ sym_ppr_nego_check(hcb_p np, int req, int target)
wide = np->maxwide;
}
if (!wide || !(np->features & FE_ULTRA3))
dt &= ~PPR_OPT_DT;
opts = 0;
if (!(np->features & FE_U3EN)) /* Broken U3EN bit not supported */
dt &= ~PPR_OPT_DT;
opts = 0;
if (opts != (np->msgin[7] & PPR_OPT_MASK))
chg = 1;
if (dt != (np->msgin[7] & PPR_OPT_MASK)) chg = 1;
dt = opts & PPR_OPT_DT;
if (ofs) {
if (dt) {
if (ofs > np->maxoffs_dt)
{chg = 1; ofs = np->maxoffs_dt;}
unsigned char maxoffs = dt ? np->maxoffs_dt : np->maxoffs;
if (ofs > maxoffs) {
chg = 1;
ofs = maxoffs;
}
else if (ofs > np->maxoffs)
{chg = 1; ofs = np->maxoffs;}
}
if (ofs) {
if (dt) {
if (per < np->minsync_dt)
{chg = 1; per = np->minsync_dt;}
unsigned char minsync = dt ? np->minsync_dt : np->minsync;
if (per < np->minsync_dt) {
chg = 1;
per = minsync;
}
else if (per < np->minsync)
{chg = 1; per = np->minsync;}
}
/*
......@@ -4204,7 +4199,7 @@ sym_ppr_nego_check(hcb_p np, int req, int target)
/*
* Apply new values.
*/
sym_setpprot (np, target, dt, ofs, per, wide, div, fak);
sym_setpprot(np, target, opts, ofs, per, wide, div, fak);
/*
* It was an answer. We are done.
......@@ -4222,7 +4217,7 @@ sym_ppr_nego_check(hcb_p np, int req, int target)
np->msgout[4] = 0;
np->msgout[5] = ofs;
np->msgout[6] = wide;
np->msgout[7] = dt;
np->msgout[7] = opts;
if (DEBUG_FLAGS & DEBUG_NEGO) {
sym_print_nego_msg(np, target, "ppr msgout", np->msgout);
......@@ -4238,7 +4233,7 @@ sym_ppr_nego_check(hcb_p np, int req, int target)
* If it is a device response that should result in
* ST, we may want to try a legacy negotiation later.
*/
if (!req && !dt) {
if (!req && !opts) {
tp->tinfo.goal.options = 0;
tp->tinfo.goal.width = wide;
tp->tinfo.goal.period = per;
......@@ -5271,8 +5266,9 @@ int sym_queue_scsiio(hcb_p np, cam_scsiio_p csio, ccb_p cp)
{
tcb_p tp;
lcb_p lp;
u_char idmsg, *msgptr;
u_char *msgptr;
u_int msglen;
int can_disconnect;
/*
* Keep track of the IO in our CCB.
......@@ -5280,25 +5276,21 @@ int sym_queue_scsiio(hcb_p np, cam_scsiio_p csio, ccb_p cp)
cp->cam_ccb = (cam_ccb_p) csio;
/*
* Retreive the target descriptor.
* Retrieve the target descriptor.
*/
tp = &np->target[cp->target];
/*
* Retreive the lun descriptor.
* Retrieve the lun descriptor.
*/
lp = sym_lp(np, tp, cp->lun);
/*
* Build the IDENTIFY message.
*/
idmsg = M_IDENTIFY | cp->lun;
if (cp->tag != NO_TAG || (lp && (lp->curr_flags & SYM_DISC_ENABLED)))
idmsg |= 0x40;
can_disconnect = (cp->tag != NO_TAG) ||
(lp && (lp->curr_flags & SYM_DISC_ENABLED));
msgptr = cp->scsi_smsg;
msglen = 0;
msgptr[msglen++] = idmsg;
msgptr[msglen++] = IDENTIFY(can_disconnect, cp->lun);
/*
* Build the tag message if present.
......
......@@ -190,10 +190,12 @@ void sym_announce_transfer_rate(hcb_p np, int target)
mb10 = (f10 + period/2) / period;
}
printf_info (
"%s:%d: %s %sSCSI %d.%d MB/s %s (%d.%d ns, offset %d)\n",
"%s:%d: %s %sSCSI %d.%d MB/s %s%s%s (%d.%d ns, offset %d)\n",
sym_name(np), target, scsi, __tcurr.width? "WIDE " : "",
mb10/10, mb10%10,
(__tcurr.options & PPR_OPT_DT) ? "DT" : "ST",
(__tcurr.options & PPR_OPT_IU) ? " IU" : "",
(__tcurr.options & PPR_OPT_QAS) ? " QAS" : "",
period/10, period%10, __tcurr.offset);
}
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment