aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-07-08 14:39:30 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-07-09 12:27:23 -0400
commit5e13cdfa5ba94724d6ab11de26b3ec3c94b88b00 (patch)
tree7f6ec288f314dda60b825a2ded8e8eb7e5bde647 /drivers
parent4e73ea7b02a8d2759b20ab52f13f40d5f5421044 (diff)
[SCSI] aha152x: stop poking at saved scsi_cmnd members
Stop poking into the old_ & co scsi_cmnd fields that should only be used in the EH code. Untested, but this is required to move ahead with the EH fixes. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/aha152x.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 36e63f82d9f8..cff3d389b010 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -551,6 +551,11 @@ struct aha152x_hostdata {
551struct aha152x_scdata { 551struct aha152x_scdata {
552 Scsi_Cmnd *next; /* next sc in queue */ 552 Scsi_Cmnd *next; /* next sc in queue */
553 struct semaphore *sem; /* semaphore to block on */ 553 struct semaphore *sem; /* semaphore to block on */
554 unsigned char cmd_len;
555 unsigned char cmnd[MAX_COMMAND_SIZE];
556 unsigned short use_sg;
557 unsigned request_bufflen;
558 void *request_buffer;
554}; 559};
555 560
556 561
@@ -1006,11 +1011,20 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct semaphore *sem, int p
1006 return FAILED; 1011 return FAILED;
1007 } 1012 }
1008 } else { 1013 } else {
1014 struct aha152x_scdata *sc;
1015
1009 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC); 1016 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC);
1010 if(SCpnt->host_scribble==0) { 1017 if(SCpnt->host_scribble==0) {
1011 printk(ERR_LEAD "allocation failed\n", CMDINFO(SCpnt)); 1018 printk(ERR_LEAD "allocation failed\n", CMDINFO(SCpnt));
1012 return FAILED; 1019 return FAILED;
1013 } 1020 }
1021
1022 sc = SCDATA(SCpnt);
1023 memcpy(sc->cmnd, SCpnt->cmnd, sizeof(sc->cmnd));
1024 sc->request_buffer = SCpnt->request_buffer;
1025 sc->request_bufflen = SCpnt->request_bufflen;
1026 sc->use_sg = SCpnt->use_sg;
1027 sc->cmd_len = SCpnt->cmd_len;
1014 } 1028 }
1015 1029
1016 SCNEXT(SCpnt) = NULL; 1030 SCNEXT(SCpnt) = NULL;
@@ -1565,6 +1579,9 @@ static void busfree_run(struct Scsi_Host *shpnt)
1565#endif 1579#endif
1566 1580
1567 if(DONE_SC->SCp.phase & check_condition) { 1581 if(DONE_SC->SCp.phase & check_condition) {
1582 struct scsi_cmnd *cmd = HOSTDATA(shpnt)->done_SC;
1583 struct aha152x_scdata *sc = SCDATA(cmd);
1584
1568#if 0 1585#if 0
1569 if(HOSTDATA(shpnt)->debug & debug_eh) { 1586 if(HOSTDATA(shpnt)->debug & debug_eh) {
1570 printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC)); 1587 printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC));
@@ -1573,13 +1590,13 @@ static void busfree_run(struct Scsi_Host *shpnt)
1573#endif 1590#endif
1574 1591
1575 /* restore old command */ 1592 /* restore old command */
1576 memcpy((void *) DONE_SC->cmnd, (void *) DONE_SC->data_cmnd, sizeof(DONE_SC->data_cmnd)); 1593 memcpy(cmd->cmnd, sc->cmnd, sizeof(sc->cmnd));
1577 DONE_SC->request_buffer = DONE_SC->buffer; 1594 cmd->request_buffer = sc->request_buffer;
1578 DONE_SC->request_bufflen = DONE_SC->bufflen; 1595 cmd->request_bufflen = sc->request_bufflen;
1579 DONE_SC->use_sg = DONE_SC->old_use_sg; 1596 cmd->use_sg = sc->use_sg;
1580 DONE_SC->cmd_len = DONE_SC->old_cmd_len; 1597 cmd->cmd_len = sc->cmd_len;
1581 1598
1582 DONE_SC->SCp.Status = 0x02; 1599 cmd->SCp.Status = 0x02;
1583 1600
1584 HOSTDATA(shpnt)->commands--; 1601 HOSTDATA(shpnt)->commands--;
1585 if (!HOSTDATA(shpnt)->commands) 1602 if (!HOSTDATA(shpnt)->commands)