diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2007-09-09 14:21:35 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:22:36 -0500 |
commit | dfb104ff5d8215e09892aad3cd094ad6597b1cfe (patch) | |
tree | c15a1c54bd2f660f340e4d0d942b4935f3d48e1f /drivers/scsi/qlogicpti.c | |
parent | ee0ae927937ac8a30350cca1a7a75efafb13976e (diff) |
[SCSI] qlogicpti: convert to accessors and !use_sg cleanup
- convert to accessors and !use_sg cleanup
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qlogicpti.c')
-rw-r--r-- | drivers/scsi/qlogicpti.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index 7a2e7986b038..5bc883182b97 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c | |||
@@ -871,11 +871,12 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd, | |||
871 | struct scatterlist *sg, *s; | 871 | struct scatterlist *sg, *s; |
872 | int i, n; | 872 | int i, n; |
873 | 873 | ||
874 | if (Cmnd->use_sg) { | 874 | if (scsi_bufflen(Cmnd)) { |
875 | int sg_count; | 875 | int sg_count; |
876 | 876 | ||
877 | sg = (struct scatterlist *) Cmnd->request_buffer; | 877 | sg = scsi_sglist(Cmnd); |
878 | sg_count = sbus_map_sg(qpti->sdev, sg, Cmnd->use_sg, Cmnd->sc_data_direction); | 878 | sg_count = sbus_map_sg(qpti->sdev, sg, scsi_sg_count(Cmnd), |
879 | Cmnd->sc_data_direction); | ||
879 | 880 | ||
880 | ds = cmd->dataseg; | 881 | ds = cmd->dataseg; |
881 | cmd->segment_cnt = sg_count; | 882 | cmd->segment_cnt = sg_count; |
@@ -914,16 +915,6 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd, | |||
914 | } | 915 | } |
915 | sg_count -= n; | 916 | sg_count -= n; |
916 | } | 917 | } |
917 | } else if (Cmnd->request_bufflen) { | ||
918 | Cmnd->SCp.ptr = (char *)(unsigned long) | ||
919 | sbus_map_single(qpti->sdev, | ||
920 | Cmnd->request_buffer, | ||
921 | Cmnd->request_bufflen, | ||
922 | Cmnd->sc_data_direction); | ||
923 | |||
924 | cmd->dataseg[0].d_base = (u32) ((unsigned long)Cmnd->SCp.ptr); | ||
925 | cmd->dataseg[0].d_count = Cmnd->request_bufflen; | ||
926 | cmd->segment_cnt = 1; | ||
927 | } else { | 918 | } else { |
928 | cmd->dataseg[0].d_base = 0; | 919 | cmd->dataseg[0].d_base = 0; |
929 | cmd->dataseg[0].d_count = 0; | 920 | cmd->dataseg[0].d_count = 0; |
@@ -1159,17 +1150,11 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti) | |||
1159 | else | 1150 | else |
1160 | Cmnd->result = DID_ERROR << 16; | 1151 | Cmnd->result = DID_ERROR << 16; |
1161 | 1152 | ||
1162 | if (Cmnd->use_sg) { | 1153 | if (scsi_bufflen(Cmnd)) |
1163 | sbus_unmap_sg(qpti->sdev, | 1154 | sbus_unmap_sg(qpti->sdev, |
1164 | (struct scatterlist *)Cmnd->request_buffer, | 1155 | scsi_sglist(Cmnd), scsi_sg_count(Cmnd), |
1165 | Cmnd->use_sg, | ||
1166 | Cmnd->sc_data_direction); | 1156 | Cmnd->sc_data_direction); |
1167 | } else if (Cmnd->request_bufflen) { | 1157 | |
1168 | sbus_unmap_single(qpti->sdev, | ||
1169 | (__u32)((unsigned long)Cmnd->SCp.ptr), | ||
1170 | Cmnd->request_bufflen, | ||
1171 | Cmnd->sc_data_direction); | ||
1172 | } | ||
1173 | qpti->cmd_count[Cmnd->device->id]--; | 1158 | qpti->cmd_count[Cmnd->device->id]--; |
1174 | sbus_writew(out_ptr, qpti->qregs + MBOX5); | 1159 | sbus_writew(out_ptr, qpti->qregs + MBOX5); |
1175 | Cmnd->host_scribble = (unsigned char *) done_queue; | 1160 | Cmnd->host_scribble = (unsigned char *) done_queue; |