aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_qstor.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-10-30 21:37:12 -0500
committerPaul Mackerras <paulus@samba.org>2005-10-30 21:37:12 -0500
commit23fd07750a789a66fe88cf173d52a18f1a387da4 (patch)
tree06fdd6df35fdb835abdaa9b754d62f6b84b97250 /drivers/scsi/sata_qstor.c
parentbd787d438a59266af3c9f6351644c85ef1dd21fe (diff)
parented28f96ac1960f30f818374d65be71d2fdf811b0 (diff)
Merge ../linux-2.6 by hand
Diffstat (limited to 'drivers/scsi/sata_qstor.c')
-rw-r--r--drivers/scsi/sata_qstor.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/scsi/sata_qstor.c b/drivers/scsi/sata_qstor.c
index ffcdeb68641c..9938dae782b6 100644
--- a/drivers/scsi/sata_qstor.c
+++ b/drivers/scsi/sata_qstor.c
@@ -35,6 +35,7 @@
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/interrupt.h> 36#include <linux/interrupt.h>
37#include <linux/sched.h> 37#include <linux/sched.h>
38#include <linux/device.h>
38#include "scsi.h" 39#include "scsi.h"
39#include <scsi/scsi_host.h> 40#include <scsi/scsi_host.h>
40#include <asm/io.h> 41#include <asm/io.h>
@@ -51,8 +52,6 @@ enum {
51 QS_PRD_BYTES = QS_MAX_PRD * 16, 52 QS_PRD_BYTES = QS_MAX_PRD * 16,
52 QS_PKT_BYTES = QS_CPB_BYTES + QS_PRD_BYTES, 53 QS_PKT_BYTES = QS_CPB_BYTES + QS_PRD_BYTES,
53 54
54 QS_DMA_BOUNDARY = ~0UL,
55
56 /* global register offsets */ 55 /* global register offsets */
57 QS_HCF_CNFG3 = 0x0003, /* host configuration offset */ 56 QS_HCF_CNFG3 = 0x0003, /* host configuration offset */
58 QS_HID_HPHY = 0x0004, /* host physical interface info */ 57 QS_HID_HPHY = 0x0004, /* host physical interface info */
@@ -101,6 +100,10 @@ enum {
101 board_2068_idx = 0, /* QStor 4-port SATA/RAID */ 100 board_2068_idx = 0, /* QStor 4-port SATA/RAID */
102}; 101};
103 102
103enum {
104 QS_DMA_BOUNDARY = ~0UL
105};
106
104typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t; 107typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t;
105 108
106struct qs_port_priv { 109struct qs_port_priv {
@@ -145,7 +148,7 @@ static Scsi_Host_Template qs_ata_sht = {
145 .bios_param = ata_std_bios_param, 148 .bios_param = ata_std_bios_param,
146}; 149};
147 150
148static struct ata_port_operations qs_ata_ops = { 151static const struct ata_port_operations qs_ata_ops = {
149 .port_disable = ata_port_disable, 152 .port_disable = ata_port_disable,
150 .tf_load = ata_tf_load, 153 .tf_load = ata_tf_load,
151 .tf_read = ata_tf_read, 154 .tf_read = ata_tf_read,
@@ -398,11 +401,12 @@ static inline unsigned int qs_intr_pkt(struct ata_host_set *host_set)
398 qc = ata_qc_from_tag(ap, ap->active_tag); 401 qc = ata_qc_from_tag(ap, ap->active_tag);
399 if (qc && (!(qc->tf.ctl & ATA_NIEN))) { 402 if (qc && (!(qc->tf.ctl & ATA_NIEN))) {
400 switch (sHST) { 403 switch (sHST) {
401 case 0: /* sucessful CPB */ 404 case 0: /* successful CPB */
402 case 3: /* device error */ 405 case 3: /* device error */
403 pp->state = qs_state_idle; 406 pp->state = qs_state_idle;
404 qs_enter_reg_mode(qc->ap); 407 qs_enter_reg_mode(qc->ap);
405 ata_qc_complete(qc, sDST); 408 ata_qc_complete(qc,
409 ac_err_mask(sDST));
406 break; 410 break;
407 default: 411 default:
408 break; 412 break;
@@ -431,7 +435,7 @@ static inline unsigned int qs_intr_mmio(struct ata_host_set *host_set)
431 if (qc && (!(qc->tf.ctl & ATA_NIEN))) { 435 if (qc && (!(qc->tf.ctl & ATA_NIEN))) {
432 436
433 /* check main status, clearing INTRQ */ 437 /* check main status, clearing INTRQ */
434 u8 status = ata_chk_status(ap); 438 u8 status = ata_check_status(ap);
435 if ((status & ATA_BUSY)) 439 if ((status & ATA_BUSY))
436 continue; 440 continue;
437 DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", 441 DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n",
@@ -439,7 +443,7 @@ static inline unsigned int qs_intr_mmio(struct ata_host_set *host_set)
439 443
440 /* complete taskfile transaction */ 444 /* complete taskfile transaction */
441 pp->state = qs_state_idle; 445 pp->state = qs_state_idle;
442 ata_qc_complete(qc, status); 446 ata_qc_complete(qc, ac_err_mask(status));
443 handled = 1; 447 handled = 1;
444 } 448 }
445 } 449 }
@@ -597,25 +601,22 @@ static int qs_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
597 if (rc) { 601 if (rc) {
598 rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 602 rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
599 if (rc) { 603 if (rc) {
600 printk(KERN_ERR DRV_NAME 604 dev_printk(KERN_ERR, &pdev->dev,
601 "(%s): 64-bit DMA enable failed\n", 605 "64-bit DMA enable failed\n");
602 pci_name(pdev));
603 return rc; 606 return rc;
604 } 607 }
605 } 608 }
606 } else { 609 } else {
607 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 610 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
608 if (rc) { 611 if (rc) {
609 printk(KERN_ERR DRV_NAME 612 dev_printk(KERN_ERR, &pdev->dev,
610 "(%s): 32-bit DMA enable failed\n", 613 "32-bit DMA enable failed\n");
611 pci_name(pdev));
612 return rc; 614 return rc;
613 } 615 }
614 rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 616 rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
615 if (rc) { 617 if (rc) {
616 printk(KERN_ERR DRV_NAME 618 dev_printk(KERN_ERR, &pdev->dev,
617 "(%s): 32-bit consistent DMA enable failed\n", 619 "32-bit consistent DMA enable failed\n");
618 pci_name(pdev));
619 return rc; 620 return rc;
620 } 621 }
621 } 622 }
@@ -632,7 +633,7 @@ static int qs_ata_init_one(struct pci_dev *pdev,
632 int rc, port_no; 633 int rc, port_no;
633 634
634 if (!printed_version++) 635 if (!printed_version++)
635 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); 636 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
636 637
637 rc = pci_enable_device(pdev); 638 rc = pci_enable_device(pdev);
638 if (rc) 639 if (rc)