Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68957
b: refs/heads/master
c: 41d2493
h: refs/heads/master
i:
  68955: d96f570
v: v3
  • Loading branch information
Matthew Wilcox authored and James Bottomley committed Oct 12, 2007
1 parent b07cb58 commit 9cedc8c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 93 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: 6e8905f4a028bd07190fa5b2f90b5a35868c84d8
refs/heads/master: 41d2493d3478942f891b21dff60951ff939c08d9
131 changes: 39 additions & 92 deletions trunk/drivers/scsi/advansys.c
Original file line number Diff line number Diff line change
Expand Up @@ -11331,80 +11331,26 @@ static int AdvExeScsiQueue(ADV_DVC_VAR *asc_dvc, ADV_SCSI_REQ_Q *scsiq)
*/
static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
{
asc_board_t *boardp;
ASC_DVC_VAR *asc_dvc_varp;
ADV_DVC_VAR *adv_dvc_varp;
ADV_SCSI_REQ_Q *adv_scsiqp;
int ret;
int ret, err_code;
asc_board_t *boardp = ASC_BOARDP(scp->device->host);

ASC_DBG2(1, "asc_execute_scsi_cmnd: scp 0x%lx, done 0x%lx\n",
(ulong)scp, (ulong)scp->scsi_done);

boardp = ASC_BOARDP(scp->device->host);
ASC_DBG1(1, "asc_execute_scsi_cmnd: scp 0x%p\n", scp);

if (ASC_NARROW_BOARD(boardp)) {
/*
* Build and execute Narrow Board request.
*/

asc_dvc_varp = &boardp->dvc_var.asc_dvc_var;
ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var;

/*
* Build Asc Library request structure using the
* global structures 'asc_scsi_req' and 'asc_sg_head'.
*
* If an error is returned, then the request has been
* queued on the board done queue. It will be completed
* by the caller.
*
* asc_build_req() can not return ASC_BUSY.
*/
/* asc_build_req() can not return ASC_BUSY. */
if (asc_build_req(boardp, scp) == ASC_ERROR) {
ASC_STATS(scp->device->host, build_error);
return ASC_ERROR;
}

switch (ret = AscExeScsiQueue(asc_dvc_varp, &asc_scsi_q)) {
case ASC_NOERROR:
ASC_STATS(scp->device->host, exe_noerror);
/*
* Increment monotonically increasing per device
* successful request counter. Wrapping doesn't matter.
*/
boardp->reqcnt[scp->device->id]++;
ASC_DBG(1, "asc_execute_scsi_cmnd: AscExeScsiQueue(), "
"ASC_NOERROR\n");
break;
case ASC_BUSY:
ASC_STATS(scp->device->host, exe_busy);
break;
case ASC_ERROR:
ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
"AscExeScsiQueue() ASC_ERROR, err_code 0x%x\n",
boardp->id, asc_dvc_varp->err_code);
ASC_STATS(scp->device->host, exe_error);
scp->result = HOST_BYTE(DID_ERROR);
break;
default:
ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
"AscExeScsiQueue() unknown, err_code 0x%x\n",
boardp->id, asc_dvc_varp->err_code);
ASC_STATS(scp->device->host, exe_unknown);
scp->result = HOST_BYTE(DID_ERROR);
break;
}
ret = AscExeScsiQueue(asc_dvc, &asc_scsi_q);
err_code = asc_dvc->err_code;
} else {
/*
* Build and execute Wide Board request.
*/
adv_dvc_varp = &boardp->dvc_var.adv_dvc_var;
ADV_DVC_VAR *adv_dvc = &boardp->dvc_var.adv_dvc_var;
ADV_SCSI_REQ_Q *adv_scsiqp;

/*
* Build and get a pointer to an Adv Library request structure.
*
* If the request is successfully built then send it below,
* otherwise return with an error.
*/
switch (adv_build_req(boardp, scp, &adv_scsiqp)) {
case ASC_NOERROR:
ASC_DBG(3, "asc_execute_scsi_cmnd: adv_build_req "
Expand All @@ -11428,35 +11374,36 @@ static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
return ASC_ERROR;
}

switch (ret = AdvExeScsiQueue(adv_dvc_varp, adv_scsiqp)) {
case ASC_NOERROR:
ASC_STATS(scp->device->host, exe_noerror);
/*
* Increment monotonically increasing per device
* successful request counter. Wrapping doesn't matter.
*/
boardp->reqcnt[scp->device->id]++;
ASC_DBG(1, "asc_execute_scsi_cmnd: AdvExeScsiQueue(), "
"ASC_NOERROR\n");
break;
case ASC_BUSY:
ASC_STATS(scp->device->host, exe_busy);
break;
case ASC_ERROR:
ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
"AdvExeScsiQueue() ASC_ERROR, err_code 0x%x\n",
boardp->id, adv_dvc_varp->err_code);
ASC_STATS(scp->device->host, exe_error);
scp->result = HOST_BYTE(DID_ERROR);
break;
default:
ASC_PRINT2("asc_execute_scsi_cmnd: board %d: "
"AdvExeScsiQueue() unknown, err_code 0x%x\n",
boardp->id, adv_dvc_varp->err_code);
ASC_STATS(scp->device->host, exe_unknown);
scp->result = HOST_BYTE(DID_ERROR);
break;
}
ret = AdvExeScsiQueue(adv_dvc, adv_scsiqp);
err_code = adv_dvc->err_code;
}

switch (ret) {
case ASC_NOERROR:
ASC_STATS(scp->device->host, exe_noerror);
/*
* Increment monotonically increasing per device
* successful request counter. Wrapping doesn't matter.
*/
boardp->reqcnt[scp->device->id]++;
ASC_DBG(1, "asc_execute_scsi_cmnd: ExeScsiQueue(), "
"ASC_NOERROR\n");
break;
case ASC_BUSY:
ASC_STATS(scp->device->host, exe_busy);
break;
case ASC_ERROR:
ASC_PRINT2("asc_execute_scsi_cmnd: board %d: ExeScsiQueue() "
"ASC_ERROR, err_code 0x%x\n", boardp->id, err_code);
ASC_STATS(scp->device->host, exe_error);
scp->result = HOST_BYTE(DID_ERROR);
break;
default:
ASC_PRINT2("asc_execute_scsi_cmnd: board %d: ExeScsiQueue() "
"unknown, err_code 0x%x\n", boardp->id, err_code);
ASC_STATS(scp->device->host, exe_unknown);
scp->result = HOST_BYTE(DID_ERROR);
break;
}

ASC_DBG(1, "asc_execute_scsi_cmnd: end\n");
Expand Down

0 comments on commit 9cedc8c

Please sign in to comment.