Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76991
b: refs/heads/master
c: dfb104f
h: refs/heads/master
i:
  76989: 4c41573
  76987: d60f5c9
  76983: 07f0294
  76975: 1e27657
  76959: 341c9d2
  76927: ce8e065
v: v3
  • Loading branch information
Boaz Harrosh authored and James Bottomley committed Jan 12, 2008
1 parent 79e4d94 commit e92340e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 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: ee0ae927937ac8a30350cca1a7a75efafb13976e
refs/heads/master: dfb104ff5d8215e09892aad3cd094ad6597b1cfe
29 changes: 7 additions & 22 deletions trunk/drivers/scsi/qlogicpti.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,11 +871,12 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
struct scatterlist *sg, *s;
int i, n;

if (Cmnd->use_sg) {
if (scsi_bufflen(Cmnd)) {
int sg_count;

sg = (struct scatterlist *) Cmnd->request_buffer;
sg_count = sbus_map_sg(qpti->sdev, sg, Cmnd->use_sg, Cmnd->sc_data_direction);
sg = scsi_sglist(Cmnd);
sg_count = sbus_map_sg(qpti->sdev, sg, scsi_sg_count(Cmnd),
Cmnd->sc_data_direction);

ds = cmd->dataseg;
cmd->segment_cnt = sg_count;
Expand Down Expand Up @@ -914,16 +915,6 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
}
sg_count -= n;
}
} else if (Cmnd->request_bufflen) {
Cmnd->SCp.ptr = (char *)(unsigned long)
sbus_map_single(qpti->sdev,
Cmnd->request_buffer,
Cmnd->request_bufflen,
Cmnd->sc_data_direction);

cmd->dataseg[0].d_base = (u32) ((unsigned long)Cmnd->SCp.ptr);
cmd->dataseg[0].d_count = Cmnd->request_bufflen;
cmd->segment_cnt = 1;
} else {
cmd->dataseg[0].d_base = 0;
cmd->dataseg[0].d_count = 0;
Expand Down Expand Up @@ -1159,17 +1150,11 @@ static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
else
Cmnd->result = DID_ERROR << 16;

if (Cmnd->use_sg) {
if (scsi_bufflen(Cmnd))
sbus_unmap_sg(qpti->sdev,
(struct scatterlist *)Cmnd->request_buffer,
Cmnd->use_sg,
scsi_sglist(Cmnd), scsi_sg_count(Cmnd),
Cmnd->sc_data_direction);
} else if (Cmnd->request_bufflen) {
sbus_unmap_single(qpti->sdev,
(__u32)((unsigned long)Cmnd->SCp.ptr),
Cmnd->request_bufflen,
Cmnd->sc_data_direction);
}

qpti->cmd_count[Cmnd->device->id]--;
sbus_writew(out_ptr, qpti->qregs + MBOX5);
Cmnd->host_scribble = (unsigned char *) done_queue;
Expand Down

0 comments on commit e92340e

Please sign in to comment.