Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32740
b: refs/heads/master
c: 5e13cdf
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and James Bottomley committed Jul 9, 2006
1 parent ad3a102 commit 704ac1f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 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: 4e73ea7b02a8d2759b20ab52f13f40d5f5421044
refs/heads/master: 5e13cdfa5ba94724d6ab11de26b3ec3c94b88b00
29 changes: 23 additions & 6 deletions trunk/drivers/scsi/aha152x.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ struct aha152x_hostdata {
struct aha152x_scdata {
Scsi_Cmnd *next; /* next sc in queue */
struct semaphore *sem; /* semaphore to block on */
unsigned char cmd_len;
unsigned char cmnd[MAX_COMMAND_SIZE];
unsigned short use_sg;
unsigned request_bufflen;
void *request_buffer;
};


Expand Down Expand Up @@ -1006,11 +1011,20 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct semaphore *sem, int p
return FAILED;
}
} else {
struct aha152x_scdata *sc;

SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC);
if(SCpnt->host_scribble==0) {
printk(ERR_LEAD "allocation failed\n", CMDINFO(SCpnt));
return FAILED;
}

sc = SCDATA(SCpnt);
memcpy(sc->cmnd, SCpnt->cmnd, sizeof(sc->cmnd));
sc->request_buffer = SCpnt->request_buffer;
sc->request_bufflen = SCpnt->request_bufflen;
sc->use_sg = SCpnt->use_sg;
sc->cmd_len = SCpnt->cmd_len;
}

SCNEXT(SCpnt) = NULL;
Expand Down Expand Up @@ -1565,6 +1579,9 @@ static void busfree_run(struct Scsi_Host *shpnt)
#endif

if(DONE_SC->SCp.phase & check_condition) {
struct scsi_cmnd *cmd = HOSTDATA(shpnt)->done_SC;
struct aha152x_scdata *sc = SCDATA(cmd);

#if 0
if(HOSTDATA(shpnt)->debug & debug_eh) {
printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC));
Expand All @@ -1573,13 +1590,13 @@ static void busfree_run(struct Scsi_Host *shpnt)
#endif

/* restore old command */
memcpy((void *) DONE_SC->cmnd, (void *) DONE_SC->data_cmnd, sizeof(DONE_SC->data_cmnd));
DONE_SC->request_buffer = DONE_SC->buffer;
DONE_SC->request_bufflen = DONE_SC->bufflen;
DONE_SC->use_sg = DONE_SC->old_use_sg;
DONE_SC->cmd_len = DONE_SC->old_cmd_len;
memcpy(cmd->cmnd, sc->cmnd, sizeof(sc->cmnd));
cmd->request_buffer = sc->request_buffer;
cmd->request_bufflen = sc->request_bufflen;
cmd->use_sg = sc->use_sg;
cmd->cmd_len = sc->cmd_len;

DONE_SC->SCp.Status = 0x02;
cmd->SCp.Status = 0x02;

HOSTDATA(shpnt)->commands--;
if (!HOSTDATA(shpnt)->commands)
Expand Down

0 comments on commit 704ac1f

Please sign in to comment.