diff options
author | Vikas Chaudhary <vikas.chaudhary@qlogic.com> | 2010-04-28 02:11:59 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-05-02 15:40:02 -0400 |
commit | 5369887a95da9509163931b21f61a94da09dac15 (patch) | |
tree | a1f167d2a18086ec25ad10bc46ab7fdf3f170336 /drivers/scsi/qla4xxx | |
parent | 821d6e5413481a57bbe1c2722dbe1fee4ff675c4 (diff) |
[SCSI] qla4xxx: correct use of cmd->host_scribble
used cmd->host_scribble to store iocb command handle.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_def.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_iocb.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 18 |
3 files changed, 13 insertions, 9 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql4_def.h index 1e56b8ee19bb..b6f2d0152454 100644 --- a/drivers/scsi/qla4xxx/ql4_def.h +++ b/drivers/scsi/qla4xxx/ql4_def.h | |||
@@ -148,6 +148,8 @@ | |||
148 | 148 | ||
149 | #define MAX_RESET_HA_RETRIES 2 | 149 | #define MAX_RESET_HA_RETRIES 2 |
150 | 150 | ||
151 | #define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr) | ||
152 | |||
151 | /* | 153 | /* |
152 | * SCSI Request Block structure (srb) that is placed | 154 | * SCSI Request Block structure (srb) that is placed |
153 | * on cmd->SCp location of every I/O [We have 22 bytes available] | 155 | * on cmd->SCp location of every I/O [We have 22 bytes available] |
diff --git a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c index e0c32159749c..e66f3f263f49 100644 --- a/drivers/scsi/qla4xxx/ql4_iocb.c +++ b/drivers/scsi/qla4xxx/ql4_iocb.c | |||
@@ -299,7 +299,7 @@ int qla4xxx_send_command_to_isp(struct scsi_qla_host *ha, struct srb * srb) | |||
299 | qla4xxx_build_scsi_iocbs(srb, cmd_entry, tot_dsds); | 299 | qla4xxx_build_scsi_iocbs(srb, cmd_entry, tot_dsds); |
300 | wmb(); | 300 | wmb(); |
301 | 301 | ||
302 | srb->cmd->host_scribble = (unsigned char *)srb; | 302 | srb->cmd->host_scribble = (unsigned char *)(unsigned long)index; |
303 | 303 | ||
304 | /* update counters */ | 304 | /* update counters */ |
305 | srb->state = SRB_ACTIVE_STATE; | 305 | srb->state = SRB_ACTIVE_STATE; |
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index d6c8b429a675..2ca43f0ebcd6 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -389,7 +389,7 @@ static struct srb* qla4xxx_get_new_srb(struct scsi_qla_host *ha, | |||
389 | srb->ddb = ddb_entry; | 389 | srb->ddb = ddb_entry; |
390 | srb->cmd = cmd; | 390 | srb->cmd = cmd; |
391 | srb->flags = 0; | 391 | srb->flags = 0; |
392 | cmd->SCp.ptr = (void *)srb; | 392 | CMD_SP(cmd) = (void *)srb; |
393 | cmd->scsi_done = done; | 393 | cmd->scsi_done = done; |
394 | 394 | ||
395 | return srb; | 395 | return srb; |
@@ -403,7 +403,7 @@ static void qla4xxx_srb_free_dma(struct scsi_qla_host *ha, struct srb *srb) | |||
403 | scsi_dma_unmap(cmd); | 403 | scsi_dma_unmap(cmd); |
404 | srb->flags &= ~SRB_DMA_VALID; | 404 | srb->flags &= ~SRB_DMA_VALID; |
405 | } | 405 | } |
406 | cmd->SCp.ptr = NULL; | 406 | CMD_SP(cmd) = NULL; |
407 | } | 407 | } |
408 | 408 | ||
409 | void qla4xxx_srb_compl(struct scsi_qla_host *ha, struct srb *srb) | 409 | void qla4xxx_srb_compl(struct scsi_qla_host *ha, struct srb *srb) |
@@ -891,7 +891,6 @@ static void qla4xxx_flush_active_srbs(struct scsi_qla_host *ha) | |||
891 | } | 891 | } |
892 | } | 892 | } |
893 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 893 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
894 | |||
895 | } | 894 | } |
896 | 895 | ||
897 | /** | 896 | /** |
@@ -1479,12 +1478,14 @@ static void qla4xxx_slave_destroy(struct scsi_device *sdev) | |||
1479 | struct srb * qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t index) | 1478 | struct srb * qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t index) |
1480 | { | 1479 | { |
1481 | struct srb *srb = NULL; | 1480 | struct srb *srb = NULL; |
1482 | struct scsi_cmnd *cmd; | 1481 | struct scsi_cmnd *cmd = NULL; |
1483 | 1482 | ||
1484 | if (!(cmd = scsi_host_find_tag(ha->host, index))) | 1483 | cmd = scsi_host_find_tag(ha->host, index); |
1484 | if (!cmd) | ||
1485 | return srb; | 1485 | return srb; |
1486 | 1486 | ||
1487 | if (!(srb = (struct srb *)cmd->host_scribble)) | 1487 | srb = (struct srb *)CMD_SP(cmd); |
1488 | if (!srb) | ||
1488 | return srb; | 1489 | return srb; |
1489 | 1490 | ||
1490 | /* update counters */ | 1491 | /* update counters */ |
@@ -1492,7 +1493,8 @@ struct srb * qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t in | |||
1492 | ha->req_q_count += srb->iocb_cnt; | 1493 | ha->req_q_count += srb->iocb_cnt; |
1493 | ha->iocb_cnt -= srb->iocb_cnt; | 1494 | ha->iocb_cnt -= srb->iocb_cnt; |
1494 | if (srb->cmd) | 1495 | if (srb->cmd) |
1495 | srb->cmd->host_scribble = NULL; | 1496 | srb->cmd->host_scribble = |
1497 | (unsigned char *)(unsigned long) MAX_SRBS; | ||
1496 | } | 1498 | } |
1497 | return srb; | 1499 | return srb; |
1498 | } | 1500 | } |
@@ -1514,7 +1516,7 @@ static int qla4xxx_eh_wait_on_command(struct scsi_qla_host *ha, | |||
1514 | 1516 | ||
1515 | do { | 1517 | do { |
1516 | /* Checking to see if its returned to OS */ | 1518 | /* Checking to see if its returned to OS */ |
1517 | rp = (struct srb *) cmd->SCp.ptr; | 1519 | rp = (struct srb *) CMD_SP(cmd); |
1518 | if (rp == NULL) { | 1520 | if (rp == NULL) { |
1519 | done++; | 1521 | done++; |
1520 | break; | 1522 | break; |