aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic94xx/aic94xx_task.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 20:19:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 20:19:08 -0500
commit9b73e76f3cf63379dcf45fcd4f112f5812418d0a (patch)
tree4e6bef87cd0cd6d848fc39a5ae25b981dbbe035b /drivers/scsi/aic94xx/aic94xx_task.c
parent50d9a126240f9961cfdd063336bbeb91f77a7dce (diff)
parent23c3e290fb9ce38cabc2822b47583fc8702411bf (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (200 commits) [SCSI] usbstorage: use last_sector_bug flag universally [SCSI] libsas: abstract STP task status into a function [SCSI] ultrastor: clean up inline asm warnings [SCSI] aic7xxx: fix firmware build [SCSI] aacraid: fib context lock for management ioctls [SCSI] ch: remove forward declarations [SCSI] ch: fix device minor number management bug [SCSI] ch: handle class_device_create failure properly [SCSI] NCR5380: fix section mismatch [SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices [SCSI] IB/iSER: add logical unit reset support [SCSI] don't use __GFP_DMA for sense buffers if not required [SCSI] use dynamically allocated sense buffer [SCSI] scsi.h: add macro for enclosure bit of inquiry data [SCSI] sd: add fix for devices with last sector access problems [SCSI] fix pcmcia compile problem [SCSI] aacraid: add Voodoo Lite class of cards. [SCSI] aacraid: add new driver features flags [SCSI] qla2xxx: Update version number to 8.02.00-k7. [SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command. ...
Diffstat (limited to 'drivers/scsi/aic94xx/aic94xx_task.c')
-rw-r--r--drivers/scsi/aic94xx/aic94xx_task.c50
1 files changed, 17 insertions, 33 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c
index ee0a98bffcd4..965d4bb999d9 100644
--- a/drivers/scsi/aic94xx/aic94xx_task.c
+++ b/drivers/scsi/aic94xx/aic94xx_task.c
@@ -187,29 +187,13 @@ static void asd_get_response_tasklet(struct asd_ascb *ascb,
187 ts->buf_valid_size = 0; 187 ts->buf_valid_size = 0;
188 edb = asd_ha->seq.edb_arr[edb_id + escb->edb_index]; 188 edb = asd_ha->seq.edb_arr[edb_id + escb->edb_index];
189 r = edb->vaddr; 189 r = edb->vaddr;
190 if (task->task_proto == SAS_PROTO_SSP) { 190 if (task->task_proto == SAS_PROTOCOL_SSP) {
191 struct ssp_response_iu *iu = 191 struct ssp_response_iu *iu =
192 r + 16 + sizeof(struct ssp_frame_hdr); 192 r + 16 + sizeof(struct ssp_frame_hdr);
193 193
194 ts->residual = le32_to_cpu(*(__le32 *)r); 194 ts->residual = le32_to_cpu(*(__le32 *)r);
195 ts->resp = SAS_TASK_COMPLETE; 195
196 if (iu->datapres == 0) 196 sas_ssp_task_response(&asd_ha->pcidev->dev, task, iu);
197 ts->stat = iu->status;
198 else if (iu->datapres == 1)
199 ts->stat = iu->resp_data[3];
200 else if (iu->datapres == 2) {
201 ts->stat = SAM_CHECK_COND;
202 ts->buf_valid_size = min((u32) SAS_STATUS_BUF_SIZE,
203 be32_to_cpu(iu->sense_data_len));
204 memcpy(ts->buf, iu->sense_data, ts->buf_valid_size);
205 if (iu->status != SAM_CHECK_COND) {
206 ASD_DPRINTK("device %llx sent sense data, but "
207 "stat(0x%x) is not CHECK_CONDITION"
208 "\n",
209 SAS_ADDR(task->dev->sas_addr),
210 iu->status);
211 }
212 }
213 } else { 197 } else {
214 struct ata_task_resp *resp = (void *) &ts->buf[0]; 198 struct ata_task_resp *resp = (void *) &ts->buf[0];
215 199
@@ -341,14 +325,14 @@ Again:
341 } 325 }
342 326
343 switch (task->task_proto) { 327 switch (task->task_proto) {
344 case SATA_PROTO: 328 case SAS_PROTOCOL_SATA:
345 case SAS_PROTO_STP: 329 case SAS_PROTOCOL_STP:
346 asd_unbuild_ata_ascb(ascb); 330 asd_unbuild_ata_ascb(ascb);
347 break; 331 break;
348 case SAS_PROTO_SMP: 332 case SAS_PROTOCOL_SMP:
349 asd_unbuild_smp_ascb(ascb); 333 asd_unbuild_smp_ascb(ascb);
350 break; 334 break;
351 case SAS_PROTO_SSP: 335 case SAS_PROTOCOL_SSP:
352 asd_unbuild_ssp_ascb(ascb); 336 asd_unbuild_ssp_ascb(ascb);
353 default: 337 default:
354 break; 338 break;
@@ -586,17 +570,17 @@ int asd_execute_task(struct sas_task *task, const int num,
586 list_for_each_entry(a, &alist, list) { 570 list_for_each_entry(a, &alist, list) {
587 t = a->uldd_task; 571 t = a->uldd_task;
588 a->uldd_timer = 1; 572 a->uldd_timer = 1;
589 if (t->task_proto & SAS_PROTO_STP) 573 if (t->task_proto & SAS_PROTOCOL_STP)
590 t->task_proto = SAS_PROTO_STP; 574 t->task_proto = SAS_PROTOCOL_STP;
591 switch (t->task_proto) { 575 switch (t->task_proto) {
592 case SATA_PROTO: 576 case SAS_PROTOCOL_SATA:
593 case SAS_PROTO_STP: 577 case SAS_PROTOCOL_STP:
594 res = asd_build_ata_ascb(a, t, gfp_flags); 578 res = asd_build_ata_ascb(a, t, gfp_flags);
595 break; 579 break;
596 case SAS_PROTO_SMP: 580 case SAS_PROTOCOL_SMP:
597 res = asd_build_smp_ascb(a, t, gfp_flags); 581 res = asd_build_smp_ascb(a, t, gfp_flags);
598 break; 582 break;
599 case SAS_PROTO_SSP: 583 case SAS_PROTOCOL_SSP:
600 res = asd_build_ssp_ascb(a, t, gfp_flags); 584 res = asd_build_ssp_ascb(a, t, gfp_flags);
601 break; 585 break;
602 default: 586 default:
@@ -633,14 +617,14 @@ out_err_unmap:
633 t->task_state_flags &= ~SAS_TASK_AT_INITIATOR; 617 t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
634 spin_unlock_irqrestore(&t->task_state_lock, flags); 618 spin_unlock_irqrestore(&t->task_state_lock, flags);
635 switch (t->task_proto) { 619 switch (t->task_proto) {
636 case SATA_PROTO: 620 case SAS_PROTOCOL_SATA:
637 case SAS_PROTO_STP: 621 case SAS_PROTOCOL_STP:
638 asd_unbuild_ata_ascb(a); 622 asd_unbuild_ata_ascb(a);
639 break; 623 break;
640 case SAS_PROTO_SMP: 624 case SAS_PROTOCOL_SMP:
641 asd_unbuild_smp_ascb(a); 625 asd_unbuild_smp_ascb(a);
642 break; 626 break;
643 case SAS_PROTO_SSP: 627 case SAS_PROTOCOL_SSP:
644 asd_unbuild_ssp_ascb(a); 628 asd_unbuild_ssp_ascb(a);
645 default: 629 default:
646 break; 630 break;