Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / scsi / sgiwd93.c
index 270f2aa..7cd366f 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/blkdev.h>
-#include <linux/version.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
 #include <linux/spinlock.h>
@@ -33,7 +32,6 @@
 #include "scsi.h"
 #include <scsi/scsi_host.h>
 #include "wd33c93.h"
-#include "sgiwd93.h"
 
 #include <linux/stat.h>
 
@@ -219,7 +217,7 @@ static inline void init_hpc_chain(struct hpc_data *hd)
 }
 
 static struct Scsi_Host * __init sgiwd93_setup_scsi(
-       Scsi_Host_Template *SGIblows, int unit, int irq,
+       struct scsi_host_template *SGIblows, int unit, int irq,
        struct hpc3_scsiregs *hregs, unsigned char *wdregs)
 {
        struct ip22_hostdata *hdata;
@@ -267,7 +265,7 @@ out_unregister:
        return NULL;
 }
 
-int __init sgiwd93_detect(Scsi_Host_Template *SGIblows)
+static int __init sgiwd93_detect(struct scsi_host_template *SGIblows)
 {
        int found = 0;
 
@@ -290,7 +288,7 @@ int __init sgiwd93_detect(Scsi_Host_Template *SGIblows)
        return found;
 }
 
-int sgiwd93_release(struct Scsi_Host *instance)
+static int sgiwd93_release(struct Scsi_Host *instance)
 {
        struct ip22_hostdata *hdata = HDATA(instance);
        int irq = 0;
@@ -310,7 +308,14 @@ int sgiwd93_release(struct Scsi_Host *instance)
 static int sgiwd93_bus_reset(Scsi_Cmnd *cmd)
 {
        /* FIXME perform bus-specific reset */
+
+       /* FIXME 2: kill this function, and let midlayer fallback
+          to the same result, calling wd33c93_host_reset() */
+
+       spin_lock_irq(cmd->device->host->host_lock);
        wd33c93_host_reset(cmd);
+       spin_unlock_irq(cmd->device->host->host_lock);
+
        return SUCCESS;
 }
 
@@ -319,7 +324,7 @@ static int sgiwd93_bus_reset(Scsi_Cmnd *cmd)
  * arguments not with pointers.  So this is going to blow up beautyfully
  * on 64-bit systems with memory outside the compat address spaces.
  */
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
        .proc_name              = "SGIWD93",
        .name                   = "SGI WD93",
        .detect                 = sgiwd93_detect,
@@ -328,10 +333,10 @@ static Scsi_Host_Template driver_template = {
        .eh_abort_handler       = wd33c93_abort,
        .eh_bus_reset_handler   = sgiwd93_bus_reset,
        .eh_host_reset_handler  = wd33c93_host_reset,
-       .can_queue              = CAN_QUEUE,
+       .can_queue              = 16,
        .this_id                = 7,
        .sg_tablesize           = SG_ALL,
-       .cmd_per_lun            = CMD_PER_LUN,
+       .cmd_per_lun            = 8,
        .use_clustering         = DISABLE_CLUSTERING,
 };
 #include "scsi_module.c"