diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-05-09 07:43:12 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-16 05:14:19 -0400 |
commit | 2f08fe5221b79aa1e240aa3938e9de6ab0baf1d3 (patch) | |
tree | 328cfb1491b9e350e5272cdf3905934a7f6ae1a5 /drivers | |
parent | 8145bfe463f4dcd644304933e6b80460557daa44 (diff) |
qlogicpti: sg chaining support
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qlogicpti.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c index e93f80316a19..7a2e7986b038 100644 --- a/drivers/scsi/qlogicpti.c +++ b/drivers/scsi/qlogicpti.c | |||
@@ -868,7 +868,7 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd, | |||
868 | struct qlogicpti *qpti, u_int in_ptr, u_int out_ptr) | 868 | struct qlogicpti *qpti, u_int in_ptr, u_int out_ptr) |
869 | { | 869 | { |
870 | struct dataseg *ds; | 870 | struct dataseg *ds; |
871 | struct scatterlist *sg; | 871 | struct scatterlist *sg, *s; |
872 | int i, n; | 872 | int i, n; |
873 | 873 | ||
874 | if (Cmnd->use_sg) { | 874 | if (Cmnd->use_sg) { |
@@ -884,11 +884,12 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd, | |||
884 | n = sg_count; | 884 | n = sg_count; |
885 | if (n > 4) | 885 | if (n > 4) |
886 | n = 4; | 886 | n = 4; |
887 | for (i = 0; i < n; i++, sg++) { | 887 | for_each_sg(sg, s, n, i) { |
888 | ds[i].d_base = sg_dma_address(sg); | 888 | ds[i].d_base = sg_dma_address(s); |
889 | ds[i].d_count = sg_dma_len(sg); | 889 | ds[i].d_count = sg_dma_len(s); |
890 | } | 890 | } |
891 | sg_count -= 4; | 891 | sg_count -= 4; |
892 | sg = s; | ||
892 | while (sg_count > 0) { | 893 | while (sg_count > 0) { |
893 | struct Continuation_Entry *cont; | 894 | struct Continuation_Entry *cont; |
894 | 895 | ||
@@ -907,9 +908,9 @@ static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd, | |||
907 | n = sg_count; | 908 | n = sg_count; |
908 | if (n > 7) | 909 | if (n > 7) |
909 | n = 7; | 910 | n = 7; |
910 | for (i = 0; i < n; i++, sg++) { | 911 | for_each_sg(sg, s, n, i) { |
911 | ds[i].d_base = sg_dma_address(sg); | 912 | ds[i].d_base = sg_dma_address(s); |
912 | ds[i].d_count = sg_dma_len(sg); | 913 | ds[i].d_count = sg_dma_len(s); |
913 | } | 914 | } |
914 | sg_count -= n; | 915 | sg_count -= n; |
915 | } | 916 | } |