Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15612
b: refs/heads/master
c: 44f30b0
h: refs/heads/master
v: v3
  • Loading branch information
Matthew Wilcox authored and James Bottomley committed Dec 14, 2005
1 parent 70a6696 commit f794453
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 205 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 84e203a279d3de1c8a41a73ab45e55a89bc19345
refs/heads/master: 44f30b0f59d628eb6f57cfa9d8ab06da670e5306
6 changes: 0 additions & 6 deletions trunk/drivers/scsi/sym53c8xx_2/sym_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ static struct sym_fwa_ofs sym_fw1a_ofs = {
};
static struct sym_fwb_ofs sym_fw1b_ofs = {
SYM_GEN_FW_B(struct SYM_FWB_SCR)
#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
SYM_GEN_B(struct SYM_FWB_SCR, data_io)
#endif
};
static struct sym_fwz_ofs sym_fw1z_ofs = {
SYM_GEN_FW_Z(struct SYM_FWZ_SCR)
Expand All @@ -86,9 +83,6 @@ static struct sym_fwa_ofs sym_fw2a_ofs = {
};
static struct sym_fwb_ofs sym_fw2b_ofs = {
SYM_GEN_FW_B(struct SYM_FWB_SCR)
#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
SYM_GEN_B(struct SYM_FWB_SCR, data_io)
#endif
SYM_GEN_B(struct SYM_FWB_SCR, start64)
SYM_GEN_B(struct SYM_FWB_SCR, pm_handle)
};
Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/scsi/sym53c8xx_2/sym_fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ struct sym_fwa_ofs {
};
struct sym_fwb_ofs {
SYM_GEN_FW_B(u_short)
#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
SYM_GEN_B(u_short, data_io)
#endif
SYM_GEN_B(u_short, start64)
SYM_GEN_B(u_short, pm_handle)
};
Expand All @@ -111,9 +108,6 @@ struct sym_fwa_ba {
};
struct sym_fwb_ba {
SYM_GEN_FW_B(u32)
#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
SYM_GEN_B(u32, data_io)
#endif
SYM_GEN_B(u32, start64);
SYM_GEN_B(u32, pm_handle);
};
Expand Down
48 changes: 0 additions & 48 deletions trunk/drivers/scsi/sym53c8xx_2/sym_fw1.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ struct SYM_FWB_SCR {
u32 bad_status [ 7];
u32 wsr_ma_helper [ 4];

#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
/* Unknown direction handling */
u32 data_io [ 2];
u32 data_io_com [ 8];
u32 data_io_out [ 7];
#endif
/* Data area */
u32 zero [ 1];
u32 scratch [ 1];
Expand Down Expand Up @@ -1747,48 +1741,6 @@ static struct SYM_FWB_SCR SYM_FWB_SCR = {
SCR_JUMP,
PADDR_A (dispatch),

#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
}/*-------------------------< DATA_IO >--------------------------*/,{
/*
* We jump here if the data direction was unknown at the
* time we had to queue the command to the scripts processor.
* Pointers had been set as follow in this situation:
* savep --> DATA_IO
* lastp --> start pointer when DATA_IN
* wlastp --> start pointer when DATA_OUT
* This script sets savep and lastp according to the
* direction chosen by the target.
*/
SCR_JUMP ^ IFTRUE (WHEN (SCR_DATA_OUT)),
PADDR_B (data_io_out),
}/*-------------------------< DATA_IO_COM >----------------------*/,{
/*
* Direction is DATA IN.
*/
SCR_COPY (4),
HADDR_1 (ccb_head.lastp),
HADDR_1 (ccb_head.savep),
/*
* Jump to the SCRIPTS according to actual direction.
*/
SCR_COPY (4),
HADDR_1 (ccb_head.savep),
RADDR_1 (temp),
SCR_RETURN,
0,
}/*-------------------------< DATA_IO_OUT >----------------------*/,{
/*
* Direction is DATA OUT.
*/
SCR_REG_REG (HF_REG, SCR_AND, (~HF_DATA_IN)),
0,
SCR_COPY (4),
HADDR_1 (ccb_head.wlastp),
HADDR_1 (ccb_head.lastp),
SCR_JUMP,
PADDR_B(data_io_com),
#endif /* SYM_OPT_HANDLE_DIR_UNKNOWN */

}/*-------------------------< ZERO >-----------------------------*/,{
SCR_DATA_ZERO,
}/*-------------------------< SCRATCH >--------------------------*/,{
Expand Down
52 changes: 0 additions & 52 deletions trunk/drivers/scsi/sym53c8xx_2/sym_fw2.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,6 @@ struct SYM_FWB_SCR {
u32 pm_wsr_handle [ 38];
u32 wsr_ma_helper [ 4];

#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
/* Unknown direction handling */
u32 data_io [ 2];
u32 data_io_in [ 2];
u32 data_io_com [ 6];
u32 data_io_out [ 8];
#endif
/* Data area */
u32 zero [ 1];
u32 scratch [ 1];
Expand Down Expand Up @@ -1838,51 +1831,6 @@ static struct SYM_FWB_SCR SYM_FWB_SCR = {
SCR_JUMP,
PADDR_A (dispatch),

#ifdef SYM_OPT_HANDLE_DIR_UNKNOWN
}/*-------------------------< DATA_IO >--------------------------*/,{
/*
* We jump here if the data direction was unknown at the
* time we had to queue the command to the scripts processor.
* Pointers had been set as follow in this situation:
* savep --> DATA_IO
* lastp --> start pointer when DATA_IN
* wlastp --> start pointer when DATA_OUT
* This script sets savep and lastp according to the
* direction chosen by the target.
*/
SCR_JUMP ^ IFTRUE (WHEN (SCR_DATA_OUT)),
PADDR_B (data_io_out),
}/*-------------------------< DATA_IO_IN >-----------------------*/,{
/*
* Direction is DATA IN.
*/
SCR_LOAD_REL (scratcha, 4),
offsetof (struct sym_ccb, phys.head.lastp),
}/*-------------------------< DATA_IO_COM >----------------------*/,{
SCR_STORE_REL (scratcha, 4),
offsetof (struct sym_ccb, phys.head.savep),

/*
* Jump to the SCRIPTS according to actual direction.
*/
SCR_LOAD_REL (temp, 4),
offsetof (struct sym_ccb, phys.head.savep),
SCR_RETURN,
0,
}/*-------------------------< DATA_IO_OUT >----------------------*/,{
/*
* Direction is DATA OUT.
*/
SCR_REG_REG (HF_REG, SCR_AND, (~HF_DATA_IN)),
0,
SCR_LOAD_REL (scratcha, 4),
offsetof (struct sym_ccb, phys.head.wlastp),
SCR_STORE_REL (scratcha, 4),
offsetof (struct sym_ccb, phys.head.lastp),
SCR_JUMP,
PADDR_B(data_io_com),
#endif /* SYM_OPT_HANDLE_DIR_UNKNOWN */

}/*-------------------------< ZERO >-----------------------------*/,{
SCR_DATA_ZERO,
}/*-------------------------< SCRATCH >--------------------------*/,{
Expand Down
39 changes: 36 additions & 3 deletions trunk/drivers/scsi/sym53c8xx_2/sym_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,10 @@ static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struc
*/
int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp)
{
int dir;
struct sym_tcb *tp = &np->target[cp->target];
struct sym_lcb *lp = sym_lp(tp, cp->lun);
u32 lastp, goalp;
int dir;

/*
* Build the CDB.
Expand All @@ -534,15 +535,47 @@ int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct s
sym_set_cam_status(cmd, DID_ERROR);
goto out_abort;
}

/*
* No segments means no data.
*/
if (!cp->segments)
dir = DMA_NONE;
} else {
cp->data_len = 0;
cp->segments = 0;
}

/*
* Set data pointers.
* Set the data pointer.
*/
switch (dir) {
case DMA_BIDIRECTIONAL:
printk("%s: got DMA_BIDIRECTIONAL command", sym_name(np));
sym_set_cam_status(cmd, DID_ERROR);
goto out_abort;
case DMA_TO_DEVICE:
goalp = SCRIPTA_BA(np, data_out2) + 8;
lastp = goalp - 8 - (cp->segments * (2*4));
break;
case DMA_FROM_DEVICE:
cp->host_flags |= HF_DATA_IN;
goalp = SCRIPTA_BA(np, data_in2) + 8;
lastp = goalp - 8 - (cp->segments * (2*4));
break;
case DMA_NONE:
default:
lastp = goalp = SCRIPTB_BA(np, no_data);
break;
}

/*
* Set all pointers values needed by SCRIPTS.
*/
sym_setup_data_pointers(np, cp, dir);
cp->phys.head.lastp = cpu_to_scr(lastp);
cp->phys.head.savep = cpu_to_scr(lastp);
cp->startp = cp->phys.head.savep;
cp->goalp = cpu_to_scr(goalp);

/*
* When `#ifed 1', the code below makes the driver
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/scsi/sym53c8xx_2/sym_glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
*/
#define SYM_CONF_TIMER_INTERVAL ((HZ+1)/2)

#define SYM_OPT_HANDLE_DIR_UNKNOWN
#define SYM_OPT_HANDLE_DEVICE_QUEUEING
#define SYM_OPT_LIMIT_COMMAND_REORDERING

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/scsi/sym53c8xx_2/sym_hipd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3654,7 +3654,7 @@ static int sym_evaluate_dp(struct sym_hcb *np, struct sym_ccb *cp, u32 scr, int
* If result is dp_sg = SYM_CONF_MAX_SG, then we are at the
* end of the data.
*/
tmp = scr_to_cpu(sym_goalp(cp));
tmp = scr_to_cpu(cp->goalp);
dp_sg = SYM_CONF_MAX_SG;
if (dp_scr != tmp)
dp_sg -= (tmp - 8 - (int)dp_scr) / (2*4);
Expand Down Expand Up @@ -3761,7 +3761,7 @@ static void sym_modify_dp(struct sym_hcb *np, struct sym_tcb *tp, struct sym_ccb
* And our alchemy:) allows to easily calculate the data
* script address we want to return for the next data phase.
*/
dp_ret = cpu_to_scr(sym_goalp(cp));
dp_ret = cpu_to_scr(cp->goalp);
dp_ret = dp_ret - 8 - (SYM_CONF_MAX_SG - dp_sg) * (2*4);

/*
Expand Down Expand Up @@ -3857,7 +3857,7 @@ int sym_compute_residual(struct sym_hcb *np, struct sym_ccb *cp)
* If all data has been transferred,
* there is no residual.
*/
if (cp->phys.head.lastp == sym_goalp(cp))
if (cp->phys.head.lastp == cp->goalp)
return resid;

/*
Expand Down Expand Up @@ -5470,7 +5470,7 @@ void sym_complete_ok (struct sym_hcb *np, struct sym_ccb *cp)
* extended error did occur, there is no residual.
*/
resid = 0;
if (cp->phys.head.lastp != sym_goalp(cp))
if (cp->phys.head.lastp != cp->goalp)
resid = sym_compute_residual(np, cp);

/*
Expand Down
Loading

0 comments on commit f794453

Please sign in to comment.