aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/atp870u.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/atp870u.c')
-rw-r--r--drivers/scsi/atp870u.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index a8cfbef304b5..5227a779c05c 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -297,11 +297,10 @@ stop_dma:
297 } 297 }
298 workreq = dev->id[c][target_id].curr_req; 298 workreq = dev->id[c][target_id].curr_req;
299#ifdef ED_DBGP 299#ifdef ED_DBGP
300 printk(KERN_DEBUG "Channel = %d ID = %d LUN = %d CDB",c,workreq->device->id,workreq->device->lun); 300 scmd_printk(KERN_DEBUG, workreq, "CDB");
301 for(l=0;l<workreq->cmd_len;l++) 301 for (l = 0; l < workreq->cmd_len; l++)
302 {
303 printk(KERN_DEBUG " %x",workreq->cmnd[l]); 302 printk(KERN_DEBUG " %x",workreq->cmnd[l]);
304 } 303 printk("\n");
305#endif 304#endif
306 305
307 tmport = workport + 0x0f; 306 tmport = workport + 0x0f;
@@ -622,10 +621,10 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p,
622 struct atp_unit *dev; 621 struct atp_unit *dev;
623 struct Scsi_Host *host; 622 struct Scsi_Host *host;
624 623
625 c = req_p->device->channel; 624 c = scmd_channel(req_p);
626 req_p->sense_buffer[0]=0; 625 req_p->sense_buffer[0]=0;
627 req_p->resid = 0; 626 req_p->resid = 0;
628 if (req_p->device->channel > 1) { 627 if (scmd_channel(req_p) > 1) {
629 req_p->result = 0x00040000; 628 req_p->result = 0x00040000;
630 done(req_p); 629 done(req_p);
631#ifdef ED_DBGP 630#ifdef ED_DBGP
@@ -640,7 +639,7 @@ static int atp870u_queuecommand(struct scsi_cmnd * req_p,
640 639
641 640
642 m = 1; 641 m = 1;
643 m = m << req_p->device->id; 642 m = m << scmd_id(req_p);
644 643
645 /* 644 /*
646 * Fake a timeout for missing targets 645 * Fake a timeout for missing targets
@@ -758,9 +757,9 @@ static void send_s870(struct atp_unit *dev,unsigned char c)
758 dev->quhd[c] = 0; 757 dev->quhd[c] = 0;
759 } 758 }
760 workreq = dev->quereq[c][dev->quhd[c]]; 759 workreq = dev->quereq[c][dev->quhd[c]];
761 if (dev->id[c][workreq->device->id].curr_req == 0) { 760 if (dev->id[c][scmd_id(workreq)].curr_req == 0) {
762 dev->id[c][workreq->device->id].curr_req = workreq; 761 dev->id[c][scmd_id(workreq)].curr_req = workreq;
763 dev->last_cmd[c] = workreq->device->id; 762 dev->last_cmd[c] = scmd_id(workreq);
764 goto cmd_subp; 763 goto cmd_subp;
765 } 764 }
766 dev->quhd[c] = j; 765 dev->quhd[c] = j;
@@ -787,16 +786,16 @@ abortsnd:
787oktosend: 786oktosend:
788#ifdef ED_DBGP 787#ifdef ED_DBGP
789 printk("OK to Send\n"); 788 printk("OK to Send\n");
790 printk("CDB"); 789 scmd_printk(KERN_DEBUG, workreq, "CDB");
791 for(i=0;i<workreq->cmd_len;i++) { 790 for(i=0;i<workreq->cmd_len;i++) {
792 printk(" %x",workreq->cmnd[i]); 791 printk(" %x",workreq->cmnd[i]);
793 } 792 }
794 printk("\nChannel = %d ID = %d LUN = %d\n",c,workreq->device->id,workreq->device->lun); 793 printk("\n");
795#endif 794#endif
796 if (dev->dev_id == ATP885_DEVID) { 795 if (dev->dev_id == ATP885_DEVID) {
797 j = inb(dev->baseport + 0x29) & 0xfe; 796 j = inb(dev->baseport + 0x29) & 0xfe;
798 outb(j, dev->baseport + 0x29); 797 outb(j, dev->baseport + 0x29);
799 dev->r1f[c][workreq->device->id] = 0; 798 dev->r1f[c][scmd_id(workreq)] = 0;
800 } 799 }
801 800
802 if (workreq->cmnd[0] == READ_CAPACITY) { 801 if (workreq->cmnd[0] == READ_CAPACITY) {
@@ -810,7 +809,7 @@ oktosend:
810 809
811 tmport = workport + 0x1b; 810 tmport = workport + 0x1b;
812 j = 0; 811 j = 0;
813 target_id = workreq->device->id; 812 target_id = scmd_id(workreq);
814 813
815 /* 814 /*
816 * Wide ? 815 * Wide ?
@@ -3109,7 +3108,7 @@ static int atp870u_abort(struct scsi_cmnd * SCpnt)
3109 host = SCpnt->device->host; 3108 host = SCpnt->device->host;
3110 3109
3111 dev = (struct atp_unit *)&host->hostdata; 3110 dev = (struct atp_unit *)&host->hostdata;
3112 c=SCpnt->device->channel; 3111 c = scmd_channel(SCpnt);
3113 printk(" atp870u: abort Channel = %x \n", c); 3112 printk(" atp870u: abort Channel = %x \n", c);
3114 printk("working=%x last_cmd=%x ", dev->working[c], dev->last_cmd[c]); 3113 printk("working=%x last_cmd=%x ", dev->working[c], dev->last_cmd[c]);
3115 printk(" quhdu=%x quendu=%x ", dev->quhd[c], dev->quend[c]); 3114 printk(" quhdu=%x quendu=%x ", dev->quhd[c], dev->quend[c]);