]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/ips.c
Manual merge with Linus.
[linux-2.6-omap-h63xx.git] / drivers / scsi / ips.c
index e5e1ca44e1eea831e17814c84d81db91b62be2cf..a4c0b04cfdbdb14af7b17cdec0180a59b44c2725 100644 (file)
 
 #include <linux/blkdev.h>
 #include <linux/types.h>
+#include <linux/dma-mapping.h>
 
 #include <scsi/sg.h>
 
@@ -1146,7 +1147,7 @@ ips_queue(Scsi_Cmnd * SC, void (*done) (Scsi_Cmnd *))
                                return (0);
                        }
                        ha->ioctl_reset = 1;    /* This reset request is from an IOCTL */
-                       ips_eh_reset(SC);
+                       __ips_eh_reset(SC);
                        SC->result = DID_OK << 16;
                        SC->scsi_done(SC);
                        return (0);
@@ -3499,6 +3500,7 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp)
        int device_error;
        uint32_t transfer_len;
        IPS_DCDB_TABLE_TAPE *tapeDCDB;
+       IPS_SCSI_INQ_DATA inquiryData;
 
        METHOD_TRACE("ips_map_status", 1);
 
@@ -3557,13 +3559,13 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp)
                                errcode = DID_OK;
 
                                /* Restrict access to physical DASD */
-                               if ((scb->scsi_cmd->cmnd[0] == INQUIRY) &&
-                                   ((((char *) scb->scsi_cmd->
-                                      buffer)[0] & 0x1f) == TYPE_DISK)) {
-                                       /* underflow -- no error               */
-                                       /* restrict access to physical DASD    */
-                                       errcode = DID_TIME_OUT;
-                                       break;
+                               if (scb->scsi_cmd->cmnd[0] == INQUIRY) {
+                                   ips_scmd_buf_read(scb->scsi_cmd, 
+                                      &inquiryData, sizeof (inquiryData));
+                                   if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) {
+                                       errcode = DID_TIME_OUT;
+                                       break;
+                                   }
                                }
                        } else
                                errcode = DID_ERROR;
@@ -4135,6 +4137,7 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus)
        uint8_t basic_status;
        uint8_t ext_status;
        int errcode;
+       IPS_SCSI_INQ_DATA inquiryData;
 
        METHOD_TRACE("ips_chkstatus", 1);
 
@@ -4255,11 +4258,11 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus)
                        scb->scsi_cmd->result = errcode << 16;
                } else {        /* bus == 0 */
                        /* restrict access to physical drives */
-                       if ((scb->scsi_cmd->cmnd[0] == INQUIRY) &&
-                           ((((char *) scb->scsi_cmd->buffer)[0] & 0x1f) ==
-                            TYPE_DISK)) {
-
-                               scb->scsi_cmd->result = DID_TIME_OUT << 16;
+                       if (scb->scsi_cmd->cmnd[0] == INQUIRY) { 
+                           ips_scmd_buf_read(scb->scsi_cmd, 
+                                  &inquiryData, sizeof (inquiryData));
+                           if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) 
+                               scb->scsi_cmd->result = DID_TIME_OUT << 16;
                        }
                }               /* else */
        } else {                /* recovered error / success */
@@ -5012,7 +5015,7 @@ ips_init_copperhead(ips_ha_t * ha)
                                break;
 
                        /* Delay for 1 Second */
-                       MDELAY(IPS_ONE_SEC);
+                       msleep(IPS_ONE_SEC);
                }
 
                if (j >= 45)
@@ -5038,7 +5041,7 @@ ips_init_copperhead(ips_ha_t * ha)
                                break;
 
                        /* Delay for 1 Second */
-                       MDELAY(IPS_ONE_SEC);
+                       msleep(IPS_ONE_SEC);
                }
 
                if (j >= 240)
@@ -5056,7 +5059,7 @@ ips_init_copperhead(ips_ha_t * ha)
                        break;
 
                /* Delay for 1 Second */
-               MDELAY(IPS_ONE_SEC);
+               msleep(IPS_ONE_SEC);
        }
 
        if (i >= 240)
@@ -5106,7 +5109,7 @@ ips_init_copperhead_memio(ips_ha_t * ha)
                                break;
 
                        /* Delay for 1 Second */
-                       MDELAY(IPS_ONE_SEC);
+                       msleep(IPS_ONE_SEC);
                }
 
                if (j >= 45)
@@ -5132,7 +5135,7 @@ ips_init_copperhead_memio(ips_ha_t * ha)
                                break;
 
                        /* Delay for 1 Second */
-                       MDELAY(IPS_ONE_SEC);
+                       msleep(IPS_ONE_SEC);
                }
 
                if (j >= 240)
@@ -5150,7 +5153,7 @@ ips_init_copperhead_memio(ips_ha_t * ha)
                        break;
 
                /* Delay for 1 Second */
-               MDELAY(IPS_ONE_SEC);
+               msleep(IPS_ONE_SEC);
        }
 
        if (i >= 240)
@@ -5202,7 +5205,7 @@ ips_init_morpheus(ips_ha_t * ha)
                        break;
 
                /* Delay for 1 Second */
-               MDELAY(IPS_ONE_SEC);
+               msleep(IPS_ONE_SEC);
        }
 
        if (i >= 45) {
@@ -5228,7 +5231,7 @@ ips_init_morpheus(ips_ha_t * ha)
                        if (Post != 0x4F00)
                                break;
                        /* Delay for 1 Second */
-                       MDELAY(IPS_ONE_SEC);
+                       msleep(IPS_ONE_SEC);
                }
 
                if (i >= 120) {
@@ -5258,7 +5261,7 @@ ips_init_morpheus(ips_ha_t * ha)
                        break;
 
                /* Delay for 1 Second */
-               MDELAY(IPS_ONE_SEC);
+               msleep(IPS_ONE_SEC);
        }
 
        if (i >= 240) {
@@ -5318,12 +5321,12 @@ ips_reset_copperhead(ips_ha_t * ha)
                outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR);
 
                /* Delay for 1 Second */
-               MDELAY(IPS_ONE_SEC);
+               msleep(IPS_ONE_SEC);
 
                outb(0, ha->io_addr + IPS_REG_SCPR);
 
                /* Delay for 1 Second */
-               MDELAY(IPS_ONE_SEC);
+               msleep(IPS_ONE_SEC);
 
                if ((*ha->func.init) (ha))
                        break;
@@ -5363,12 +5366,12 @@ ips_reset_copperhead_memio(ips_ha_t * ha)
                writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR);
 
                /* Delay for 1 Second */
-               MDELAY(IPS_ONE_SEC);
+               msleep(IPS_ONE_SEC);
 
                writeb(0, ha->mem_ptr + IPS_REG_SCPR);
 
                /* Delay for 1 Second */
-               MDELAY(IPS_ONE_SEC);
+               msleep(IPS_ONE_SEC);
 
                if ((*ha->func.init) (ha))
                        break;
@@ -5409,7 +5412,7 @@ ips_reset_morpheus(ips_ha_t * ha)
                writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR);
 
                /* Delay for 5 Seconds */
-               MDELAY(5 * IPS_ONE_SEC);
+               msleep(5 * IPS_ONE_SEC);
 
                /* Do a PCI config read to wait for adapter */
                pci_read_config_byte(ha->pcidev, 4, &junk);
@@ -7282,10 +7285,10 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr)
         * are guaranteed to be < 4G.
         */
        if (IPS_ENABLE_DMA64 && IPS_HAS_ENH_SGLIST(ha) &&
-           !pci_set_dma_mask(ha->pcidev, 0xffffffffffffffffULL)) {
+           !pci_set_dma_mask(ha->pcidev, DMA_64BIT_MASK)) {
                (ha)->flags |= IPS_HA_ENH_SG;
        } else {
-               if (pci_set_dma_mask(ha->pcidev, 0xffffffffULL) != 0) {
+               if (pci_set_dma_mask(ha->pcidev, DMA_32BIT_MASK) != 0) {
                        printk(KERN_WARNING "Unable to set DMA Mask\n");
                        return ips_abort_init(ha, index);
                }