fedora core 2.6.10-1.12-FC2
[linux-2.6.git] / drivers / scsi / sata_sil.c
index 72a89d1..2952d9e 100644 (file)
@@ -6,7 +6,7 @@
  *                 on emails.
  *
  *  Copyright 2003 Red Hat, Inc.
- *  Copyright 2003 Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ *  Copyright 2003 Benjamin Herrenschmidt
  *
  *  The contents of this file are subject to the Open
  *  Software License version 1.1 that can be found at
@@ -38,7 +38,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "sata_sil"
-#define DRV_VERSION    "0.54"
+#define DRV_VERSION    "0.8"
 
 enum {
        sil_3112                = 0,
@@ -71,6 +71,8 @@ static struct pci_device_id sil_pci_tbl[] = {
        { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
        { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
        { 0x1095, 0x3114, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3114 },
+       { 0x1002, 0x436e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
+       { 0x1002, 0x4379, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 },
        { }     /* terminate list */
 };
 
@@ -87,6 +89,7 @@ struct sil_drivelist {
        { "ST380023AS",         SIL_QUIRK_MOD15WRITE },
        { "ST3120023AS",        SIL_QUIRK_MOD15WRITE },
        { "ST3160023AS",        SIL_QUIRK_MOD15WRITE },
+       { "ST3120026AS",        SIL_QUIRK_MOD15WRITE },
        { "ST340014ASL",        SIL_QUIRK_MOD15WRITE },
        { "ST360014ASL",        SIL_QUIRK_MOD15WRITE },
        { "ST380011ASL",        SIL_QUIRK_MOD15WRITE },
@@ -106,6 +109,7 @@ static struct pci_driver sil_pci_driver = {
 static Scsi_Host_Template sil_sht = {
        .module                 = THIS_MODULE,
        .name                   = DRV_NAME,
+       .ioctl                  = ata_scsi_ioctl,
        .queuecommand           = ata_scsi_queuecmd,
        .eh_strategy_handler    = ata_scsi_error,
        .can_queue              = ATA_DEF_QUEUE,
@@ -124,14 +128,15 @@ static Scsi_Host_Template sil_sht = {
 static struct ata_port_operations sil_ops = {
        .port_disable           = ata_port_disable,
        .dev_config             = sil_dev_config,
-       .tf_load                = ata_tf_load_mmio,
-       .tf_read                = ata_tf_read_mmio,
-       .check_status           = ata_check_status_mmio,
-       .exec_command           = ata_exec_command_mmio,
+       .tf_load                = ata_tf_load,
+       .tf_read                = ata_tf_read,
+       .check_status           = ata_check_status,
+       .exec_command           = ata_exec_command,
+       .dev_select             = ata_std_dev_select,
        .phy_reset              = sata_phy_reset,
        .post_set_mode          = sil_post_set_mode,
-       .bmdma_setup            = ata_bmdma_setup_mmio,
-       .bmdma_start            = ata_bmdma_start_mmio,
+       .bmdma_setup            = ata_bmdma_setup,
+       .bmdma_start            = ata_bmdma_start,
        .qc_prep                = ata_qc_prep,
        .qc_issue               = ata_qc_issue_prot,
        .eng_timeout            = ata_eng_timeout,
@@ -149,7 +154,8 @@ static struct ata_port_info sil_port_info[] = {
                .sht            = &sil_sht,
                .host_flags     = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
                                  ATA_FLAG_SRST | ATA_FLAG_MMIO,
-               .pio_mask       = 0x03,                 /* pio3-4 */
+               .pio_mask       = 0x1f,                 /* pio0-4 */
+               .mwdma_mask     = 0x07,                 /* mwdma0-2 */
                .udma_mask      = 0x3f,                 /* udma0-5 */
                .port_ops       = &sil_ops,
        }, /* sil_3114 */
@@ -157,7 +163,8 @@ static struct ata_port_info sil_port_info[] = {
                .sht            = &sil_sht,
                .host_flags     = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
                                  ATA_FLAG_SRST | ATA_FLAG_MMIO,
-               .pio_mask       = 0x03,                 /* pio3-4 */
+               .pio_mask       = 0x1f,                 /* pio0-4 */
+               .mwdma_mask     = 0x07,                 /* mwdma0-2 */
                .udma_mask      = 0x3f,                 /* udma0-5 */
                .port_ops       = &sil_ops,
        },
@@ -185,6 +192,7 @@ MODULE_AUTHOR("Jeff Garzik");
 MODULE_DESCRIPTION("low-level driver for Silicon Image SATA controller");
 MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, sil_pci_tbl);
+MODULE_VERSION(DRV_VERSION);
 
 static void sil_post_set_mode (struct ata_port *ap)
 {
@@ -283,7 +291,7 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev)
        const char *s;
        unsigned int len;
 
-       ata_dev_id_string(dev, model_num, ATA_ID_PROD_OFS,
+       ata_dev_id_string(dev->id, model_num, ATA_ID_PROD_OFS,
                          sizeof(model_num));
        s = &model_num[0];
        len = strnlen(s, sizeof(model_num));
@@ -358,11 +366,12 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 
        memset(probe_ent, 0, sizeof(*probe_ent));
        INIT_LIST_HEAD(&probe_ent->node);
-       probe_ent->pdev = pdev;
+       probe_ent->dev = pci_dev_to_dev(pdev);
        probe_ent->port_ops = sil_port_info[ent->driver_data].port_ops;
        probe_ent->sht = sil_port_info[ent->driver_data].sht;
        probe_ent->n_ports = (ent->driver_data == sil_3114) ? 4 : 2;
        probe_ent->pio_mask = sil_port_info[ent->driver_data].pio_mask;
+       probe_ent->mwdma_mask = sil_port_info[ent->driver_data].mwdma_mask;
        probe_ent->udma_mask = sil_port_info[ent->driver_data].udma_mask;
                probe_ent->irq = pdev->irq;
                probe_ent->irq_flags = SA_SHIRQ;