]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/block/cciss.c
i386: do not restore reserved memory after hibernation
[linux-2.6-omap-h63xx.git] / drivers / block / cciss.c
index 370dfe1c422ea8a4b3ce6c8c9ba49f8001667cd3..a2d6612b80d2187a57a1ebf64aacc7a8e0e0cfc0 100644 (file)
@@ -87,6 +87,7 @@ static const struct pci_device_id cciss_pci_device_id[] = {
        {PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSD,     0x103C, 0x3214},
        {PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSD,     0x103C, 0x3215},
        {PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSC,     0x103C, 0x3237},
+       {PCI_VENDOR_ID_HP,     PCI_DEVICE_ID_HP_CISSC,     0x103C, 0x323D},
        {PCI_VENDOR_ID_HP,     PCI_ANY_ID,      PCI_ANY_ID, PCI_ANY_ID,
                PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0},
        {0,}
@@ -119,6 +120,7 @@ static struct board_type products[] = {
        {0x3214103C, "Smart Array E200i", &SA5_access, 120},
        {0x3215103C, "Smart Array E200i", &SA5_access, 120},
        {0x3237103C, "Smart Array E500", &SA5_access, 512},
+       {0x323D103C, "Smart Array P700m", &SA5_access, 512},
        {0xFFFF103C, "Unknown Smart Array", &SA5_access, 120},
 };
 
@@ -1168,7 +1170,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
        case SG_EMULATED_HOST:
        case SG_IO:
        case SCSI_IOCTL_SEND_COMMAND:
-               return scsi_cmd_ioctl(filep, disk, cmd, argp);
+               return scsi_cmd_ioctl(filep, disk->queue, disk, cmd, argp);
 
        /* scsi_cmd_ioctl would normally handle these, below, but */
        /* they aren't a good fit for cciss, as CD-ROMs are */
@@ -3469,13 +3471,39 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
        return -1;
 }
 
-static void cciss_remove_one(struct pci_dev *pdev)
+static void cciss_shutdown(struct pci_dev *pdev)
 {
        ctlr_info_t *tmp_ptr;
-       int i, j;
+       int i;
        char flush_buf[4];
        int return_code;
 
+       tmp_ptr = pci_get_drvdata(pdev);
+       if (tmp_ptr == NULL)
+               return;
+       i = tmp_ptr->ctlr;
+       if (hba[i] == NULL)
+               return;
+
+       /* Turn board interrupts off  and send the flush cache command */
+       /* sendcmd will turn off interrupt, and send the flush...
+        * To write all data in the battery backed cache to disks */
+       memset(flush_buf, 0, 4);
+       return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL,
+                             TYPE_CMD);
+       if (return_code == IO_OK) {
+               printk(KERN_INFO "Completed flushing cache on controller %d\n", i);
+       } else {
+               printk(KERN_WARNING "Error flushing cache on controller %d\n", i);
+       }
+       free_irq(hba[i]->intr[2], hba[i]);
+}
+
+static void __devexit cciss_remove_one(struct pci_dev *pdev)
+{
+       ctlr_info_t *tmp_ptr;
+       int i, j;
+
        if (pci_get_drvdata(pdev) == NULL) {
                printk(KERN_ERR "cciss: Unable to remove device \n");
                return;
@@ -3506,18 +3534,7 @@ static void cciss_remove_one(struct pci_dev *pdev)
 
        cciss_unregister_scsi(i);       /* unhook from SCSI subsystem */
 
-       /* Turn board interrupts off  and send the flush cache command */
-       /* sendcmd will turn off interrupt, and send the flush...
-        * To write all data in the battery backed cache to disks */
-       memset(flush_buf, 0, 4);
-       return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL,
-                             TYPE_CMD);
-       if (return_code == IO_OK) {
-               printk(KERN_INFO "Completed flushing cache on controller %d\n", i);
-       } else {
-               printk(KERN_WARNING "Error flushing cache on controller %d\n", i);
-       }
-       free_irq(hba[i]->intr[2], hba[i]);
+       cciss_shutdown(pdev);
 
 #ifdef CONFIG_PCI_MSI
        if (hba[i]->msix_vector)
@@ -3550,7 +3567,7 @@ static struct pci_driver cciss_pci_driver = {
        .probe = cciss_init_one,
        .remove = __devexit_p(cciss_remove_one),
        .id_table = cciss_pci_device_id,        /* id_table */
-       .shutdown = cciss_remove_one,
+       .shutdown = cciss_shutdown,
 };
 
 /*