Merge branch 'upstream'
[powerpc.git] / drivers / scsi / sata_vsc.c
index 5af05fd..3e34fed 100644 (file)
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
-#include "scsi.h"
+#include <linux/device.h>
 #include <scsi/scsi_host.h>
 #include <linux/libata.h>
 
 #define DRV_NAME       "sata_vsc"
-#define DRV_VERSION    "1.0"
+#define DRV_VERSION    "1.1"
 
 /* Interrupt register offsets (from chip base address) */
 #define VSC_SATA_INT_STAT_OFFSET       0x00
@@ -153,16 +153,24 @@ static void vsc_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
 static void vsc_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
 {
        struct ata_ioports *ioaddr = &ap->ioaddr;
-       u16 nsect, lbal, lbam, lbah;
+       u16 nsect, lbal, lbam, lbah, feature;
 
-       nsect = tf->nsect = readw(ioaddr->nsect_addr);
-       lbal = tf->lbal = readw(ioaddr->lbal_addr);
-       lbam = tf->lbam = readw(ioaddr->lbam_addr);
-       lbah = tf->lbah = readw(ioaddr->lbah_addr);
+       tf->command = ata_check_status(ap);
        tf->device = readw(ioaddr->device_addr);
+       feature = readw(ioaddr->error_addr);
+       nsect = readw(ioaddr->nsect_addr);
+       lbal = readw(ioaddr->lbal_addr);
+       lbam = readw(ioaddr->lbam_addr);
+       lbah = readw(ioaddr->lbah_addr);
+
+       tf->feature = feature;
+       tf->nsect = nsect;
+       tf->lbal = lbal;
+       tf->lbam = lbam;
+       tf->lbah = lbah;
 
        if (tf->flags & ATA_TFLAG_LBA48) {
-               tf->hob_feature = readb(ioaddr->error_addr);
+               tf->hob_feature = feature >> 8;
                tf->hob_nsect = nsect >> 8;
                tf->hob_lbal = lbal >> 8;
                tf->hob_lbam = lbam >> 8;
@@ -193,12 +201,12 @@ static irqreturn_t vsc_sata_interrupt (int irq, void *dev_instance,
                        struct ata_port *ap;
 
                        ap = host_set->ports[i];
-                       if (ap && !(ap->flags &
-                                   (ATA_FLAG_PORT_DISABLED|ATA_FLAG_NOINTR))) {
+                       if (ap &&
+                           !(ap->flags & ATA_FLAG_PORT_DISABLED)) {
                                struct ata_queued_cmd *qc;
 
                                qc = ata_qc_from_tag(ap, ap->active_tag);
-                               if (qc && (!(qc->tf.ctl & ATA_NIEN)))
+                               if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)))
                                        handled += ata_host_intr(ap, qc);
                        }
                }
@@ -210,7 +218,7 @@ static irqreturn_t vsc_sata_interrupt (int irq, void *dev_instance,
 }
 
 
-static Scsi_Host_Template vsc_sata_sht = {
+static struct scsi_host_template vsc_sata_sht = {
        .module                 = THIS_MODULE,
        .name                   = DRV_NAME,
        .ioctl                  = ata_scsi_ioctl,
@@ -227,7 +235,6 @@ static Scsi_Host_Template vsc_sata_sht = {
        .dma_boundary           = ATA_DMA_BOUNDARY,
        .slave_configure        = ata_scsi_slave_config,
        .bios_param             = ata_std_bios_param,
-       .ordered_flush          = 1,
 };
 
 
@@ -287,7 +294,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d
        int rc;
 
        if (!printed_version++)
-               printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
+               dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
 
        rc = pci_enable_device(pdev);
        if (rc)
@@ -392,7 +399,7 @@ err_out:
  * 0x8086/0x3200 is the Intel 31244, which is supposed to be identical
  * compatibility is untested as of yet
  */
-static struct pci_device_id vsc_sata_pci_tbl[] = {
+static const struct pci_device_id vsc_sata_pci_tbl[] = {
        { 0x1725, 0x7174, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 },
        { 0x8086, 0x3200, PCI_ANY_ID, PCI_ANY_ID, 0x10600, 0xFFFFFF, 0 },
        { }