]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/sata_promise.c
IB/iser: Limit the max size of a scsi command
[linux-2.6-omap-h63xx.git] / drivers / scsi / sata_promise.c
index aaf896a0c63ad38513210ac2ea2372adb0820e43..4776f4e55839022303c8dba80e7ca4ec76ddf368 100644 (file)
@@ -121,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,
 };
 
@@ -137,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,
 
@@ -159,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,
@@ -266,8 +269,15 @@ static const struct pci_device_id pdc_ata_pci_tbl[] = {
        { PCI_VENDOR_ID_PROMISE, 0x6629, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
          board_20619 },
 
+/* TODO: remove all associated board_20771 code, as it completely
+ * duplicates board_2037x code, unless reason for separation can be
+ * divined.
+ */
+#if 0
        { PCI_VENDOR_ID_PROMISE, 0x3570, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
          board_20771 },
+#endif
+
        { }     /* terminate list */
 };
 
@@ -364,12 +374,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);
@@ -436,7 +457,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;
@@ -444,8 +465,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;
@@ -728,7 +750,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
        probe_ent->port_ops     = pdc_port_info[board_idx].port_ops;
 
                probe_ent->irq = pdev->irq;
-               probe_ent->irq_flags = SA_SHIRQ;
+               probe_ent->irq_flags = IRQF_SHARED;
        probe_ent->mmio_base = mmio_base;
 
        pdc_ata_setup_port(&probe_ent->port[0], base + 0x200);