diff options
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 0829b55c64d2..827cfb132f21 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -158,8 +158,8 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) | |||
158 | struct Scsi_Host *host = sas_ha->core.shost; | 158 | struct Scsi_Host *host = sas_ha->core.shost; |
159 | struct sas_internal *i = to_sas_internal(host->transportt); | 159 | struct sas_internal *i = to_sas_internal(host->transportt); |
160 | struct scatterlist *sg; | 160 | struct scatterlist *sg; |
161 | unsigned int num = 0; | ||
162 | unsigned int xfer = 0; | 161 | unsigned int xfer = 0; |
162 | unsigned int si; | ||
163 | 163 | ||
164 | task = sas_alloc_task(GFP_ATOMIC); | 164 | task = sas_alloc_task(GFP_ATOMIC); |
165 | if (!task) | 165 | if (!task) |
@@ -176,22 +176,20 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) | |||
176 | 176 | ||
177 | ata_tf_to_fis(&qc->tf, 1, 0, (u8*)&task->ata_task.fis); | 177 | ata_tf_to_fis(&qc->tf, 1, 0, (u8*)&task->ata_task.fis); |
178 | task->uldd_task = qc; | 178 | task->uldd_task = qc; |
179 | if (is_atapi_taskfile(&qc->tf)) { | 179 | if (ata_is_atapi(qc->tf.protocol)) { |
180 | memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); | 180 | memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); |
181 | task->total_xfer_len = qc->nbytes + qc->pad_len; | 181 | task->total_xfer_len = qc->nbytes + qc->pad_len; |
182 | task->num_scatter = qc->pad_len ? qc->n_elem + 1 : qc->n_elem; | 182 | task->num_scatter = qc->pad_len ? qc->n_elem + 1 : qc->n_elem; |
183 | } else { | 183 | } else { |
184 | ata_for_each_sg(sg, qc) { | 184 | for_each_sg(qc->sg, sg, qc->n_elem, si) |
185 | num++; | ||
186 | xfer += sg->length; | 185 | xfer += sg->length; |
187 | } | ||
188 | 186 | ||
189 | task->total_xfer_len = xfer; | 187 | task->total_xfer_len = xfer; |
190 | task->num_scatter = num; | 188 | task->num_scatter = si; |
191 | } | 189 | } |
192 | 190 | ||
193 | task->data_dir = qc->dma_dir; | 191 | task->data_dir = qc->dma_dir; |
194 | task->scatter = qc->__sg; | 192 | task->scatter = qc->sg; |
195 | task->ata_task.retry_count = 1; | 193 | task->ata_task.retry_count = 1; |
196 | task->task_state_flags = SAS_TASK_STATE_PENDING; | 194 | task->task_state_flags = SAS_TASK_STATE_PENDING; |
197 | qc->lldd_task = task; | 195 | qc->lldd_task = task; |
@@ -200,7 +198,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) | |||
200 | case ATA_PROT_NCQ: | 198 | case ATA_PROT_NCQ: |
201 | task->ata_task.use_ncq = 1; | 199 | task->ata_task.use_ncq = 1; |
202 | /* fall through */ | 200 | /* fall through */ |
203 | case ATA_PROT_ATAPI_DMA: | 201 | case ATAPI_PROT_DMA: |
204 | case ATA_PROT_DMA: | 202 | case ATA_PROT_DMA: |
205 | task->ata_task.dma_xfer = 1; | 203 | task->ata_task.dma_xfer = 1; |
206 | break; | 204 | break; |