Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / drivers / scsi / seagate.c
index 4c95abb..2679ea8 100644 (file)
@@ -97,6 +97,7 @@
 #include <linux/delay.h>
 #include <linux/blkdev.h>
 #include <linux/stat.h>
+#include <linux/delay.h>
 
 #include <asm/io.h>
 #include <asm/system.h>
@@ -311,7 +312,7 @@ static Signature __initdata signatures[] = {
        {"IBM F1 V1.2009/22/93", 5, 25, FD},
 };
 
-#define NUM_SIGNATURES (sizeof(signatures) / sizeof(Signature))
+#define NUM_SIGNATURES ARRAY_SIZE(signatures)
 #endif                         /* n OVERRIDE */
 
 /*
@@ -417,7 +418,7 @@ static inline void borken_wait (void)
 #define ULOOP( i ) for (clock = i*8;;)
 #define TIMEOUT (!(clock--))
 
-int __init seagate_st0x_detect (Scsi_Host_Template * tpnt)
+int __init seagate_st0x_detect (struct scsi_host_template * tpnt)
 {
        struct Scsi_Host *instance;
        int i, j;
@@ -456,7 +457,7 @@ int __init seagate_st0x_detect (Scsi_Host_Template * tpnt)
  * space for the on-board RAM instead.
  */
 
-               for (i = 0; i < (sizeof (seagate_bases) / sizeof (unsigned int)); ++i) {
+               for (i = 0; i < ARRAY_SIZE(seagate_bases); ++i) {
                        void __iomem *p = ioremap(seagate_bases[i], 0x2000);
                        if (!p)
                                continue;
@@ -496,7 +497,7 @@ int __init seagate_st0x_detect (Scsi_Host_Template * tpnt)
                return 0;
 
        hostno = instance->host_no;
-       if (request_irq (irq, do_seagate_reconnect_intr, SA_INTERRUPT, (controller_type == SEAGATE) ? "seagate" : "tmc-8xx", instance)) {
+       if (request_irq (irq, do_seagate_reconnect_intr, IRQF_DISABLED, (controller_type == SEAGATE) ? "seagate" : "tmc-8xx", instance)) {
                printk(KERN_ERR "scsi%d : unable to allocate IRQ%d\n", hostno, irq);
                return 0;
        }
@@ -1001,7 +1002,7 @@ connect_loop:
                        }
 #endif
 
-                       buffer = (struct scatterlist *) SCint->buffer;
+                       buffer = (struct scatterlist *) SCint->request_buffer;
                        len = buffer->length;
                        data = page_address(buffer->page) + buffer->offset;
                } else {
@@ -1631,7 +1632,7 @@ static int seagate_st0x_bus_reset(Scsi_Cmnd * SCpnt)
        /* assert  RESET signal on SCSI bus.  */
        WRITE_CONTROL (BASE_CMD | CMD_RST);
 
-       udelay (20 * 1000);
+       mdelay (20);
 
        WRITE_CONTROL (BASE_CMD);
        st0x_aborted = DID_RESET;
@@ -1640,16 +1641,6 @@ static int seagate_st0x_bus_reset(Scsi_Cmnd * SCpnt)
        return SUCCESS;
 }
 
-static int seagate_st0x_host_reset(Scsi_Cmnd *SCpnt)
-{
-       return FAILED;
-}
-
-static int seagate_st0x_device_reset(Scsi_Cmnd *SCpnt)
-{
-       return FAILED;
-}
-
 static int seagate_st0x_release(struct Scsi_Host *shost)
 {
        if (shost->irq)
@@ -1658,15 +1649,13 @@ static int seagate_st0x_release(struct Scsi_Host *shost)
        return 0;
 }
 
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
        .detect                 = seagate_st0x_detect,
        .release                = seagate_st0x_release,
        .info                   = seagate_st0x_info,
        .queuecommand           = seagate_st0x_queue_command,
        .eh_abort_handler       = seagate_st0x_abort,
        .eh_bus_reset_handler   = seagate_st0x_bus_reset,
-       .eh_host_reset_handler  = seagate_st0x_host_reset,
-       .eh_device_reset_handler = seagate_st0x_device_reset,
        .can_queue              = 1,
        .this_id                = 7,
        .sg_tablesize           = SG_ALL,