[SCSI] qla2xxx: Create an VPD sysfs entry for supported ISPs only.
[powerpc.git] / drivers / scsi / sata_promise.c
index 322525d..b2b6ed5 100644 (file)
@@ -112,7 +112,6 @@ static struct scsi_host_template pdc_ata_sht = {
        .name                   = DRV_NAME,
        .ioctl                  = ata_scsi_ioctl,
        .queuecommand           = ata_scsi_queuecmd,
-       .eh_strategy_handler    = ata_scsi_error,
        .can_queue              = ATA_DEF_QUEUE,
        .this_id                = ATA_SHT_THIS_ID,
        .sg_tablesize           = LIBATA_MAX_PRD,
@@ -122,6 +121,7 @@ static struct scsi_host_template pdc_ata_sht = {
        .proc_name              = DRV_NAME,
        .dma_boundary           = ATA_DMA_BOUNDARY,
        .slave_configure        = ata_scsi_slave_config,
+       .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
 };
 
@@ -138,6 +138,7 @@ static const struct ata_port_operations pdc_sata_ops = {
        .qc_prep                = pdc_qc_prep,
        .qc_issue               = pdc_qc_issue_prot,
        .eng_timeout            = pdc_eng_timeout,
+       .data_xfer              = ata_mmio_data_xfer,
        .irq_handler            = pdc_interrupt,
        .irq_clear              = pdc_irq_clear,
 
@@ -160,6 +161,7 @@ static const struct ata_port_operations pdc_pata_ops = {
 
        .qc_prep                = pdc_qc_prep,
        .qc_issue               = pdc_qc_issue_prot,
+       .data_xfer              = ata_mmio_data_xfer,
        .eng_timeout            = pdc_eng_timeout,
        .irq_handler            = pdc_interrupt,
        .irq_clear              = pdc_irq_clear,
@@ -365,12 +367,23 @@ static void pdc_sata_phy_reset(struct ata_port *ap)
        sata_phy_reset(ap);
 }
 
-static void pdc_pata_phy_reset(struct ata_port *ap)
+static void pdc_pata_cbl_detect(struct ata_port *ap)
 {
-       /* FIXME: add cable detect.  Don't assume 40-pin cable */
-       ap->cbl = ATA_CBL_PATA40;
-       ap->udma_mask &= ATA_UDMA_MASK_40C;
+       u8 tmp;
+       void __iomem *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
+
+       tmp = readb(mmio);
+
+       if (tmp & 0x01) {
+               ap->cbl = ATA_CBL_PATA40;
+               ap->udma_mask &= ATA_UDMA_MASK_40C;
+       } else
+               ap->cbl = ATA_CBL_PATA80;
+}
 
+static void pdc_pata_phy_reset(struct ata_port *ap)
+{
+       pdc_pata_cbl_detect(ap);
        pdc_reset_port(ap);
        ata_port_probe(ap);
        ata_bus_reset(ap);
@@ -437,7 +450,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
        switch (qc->tf.protocol) {
        case ATA_PROT_DMA:
        case ATA_PROT_NODATA:
-               printk(KERN_ERR "ata%u: command timeout\n", ap->id);
+               ata_port_printk(ap, KERN_ERR, "command timeout\n");
                drv_stat = ata_wait_idle(ap);
                qc->err_mask |= __ac_err_mask(drv_stat);
                break;
@@ -445,8 +458,9 @@ static void pdc_eng_timeout(struct ata_port *ap)
        default:
                drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
 
-               printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n",
-                      ap->id, qc->tf.command, drv_stat);
+               ata_port_printk(ap, KERN_ERR,
+                               "unknown timeout, cmd 0x%x stat 0x%x\n",
+                               qc->tf.command, drv_stat);
 
                qc->err_mask |= ac_err_mask(drv_stat);
                break;
@@ -678,10 +692,6 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
        if (!printed_version++)
                dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
 
-       /*
-        * If this driver happens to only be useful on Apple's K2, then
-        * we should check that here as it has a normal Serverworks ID
-        */
        rc = pci_enable_device(pdev);
        if (rc)
                return rc;