aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 20:08:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 20:08:28 -0500
commit2ba14a017a4ba8d2266316f481d4ad7400073d18 (patch)
tree6e86dcbbb7898eb747f1198e33961eb68bfcdb4d /drivers/scsi/libsas
parent99f1c97dbdb30e958edfd1ced0ae43df62504e07 (diff)
parenta984f58dd97f22f5113700322fed311a0ee29947 (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (67 commits) fix drivers/ata/sata_fsl.c double-decl [libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof() pata_legacy: Merge winbond support ata_generic: Cenatek support pata_winbond: error return pata_serverworks: Fix cable types and cosmetics pata_mpc52xx: remove un-needed assignment libata: fix off-by-one in error categorization ahci: factor out AHCI enabling and enable AHCI before reading CAP ata_piix: implement SIDPR SCR access ata_piix: convert to prepare - activate initialization libata: factor out ata_pci_activate_sff_host() from ata_pci_one() [libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof() pata_legacy: resychronize with upstream changes and resubmit [libata] pata_legacy: typo fix [libata] pata_winbond: update for new ->data_xfer hook pata_pcmcia: convert to new data_xfer prototype libata annotations and fixes libata: use dev_driver_string() instead of "libata" in libata-sff.c ata_piix: kill unused constants and flags ...
Diffstat (limited to 'drivers/scsi/libsas')
-rw-r--r--drivers/scsi/libsas/sas_ata.c14
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;