#include <linux/proc_fs.h>
#include <linux/spinlock.h>
#include <linux/stat.h>
+#include <linux/bitops.h>
#include <asm/io.h>
-#include <asm/bitops.h>
#include <asm/system.h>
#include <asm/dma.h>
#define ULTRASTOR_PRIVATE /* Get the private stuff from ultrastor.h */
#include "scsi.h"
-#include "hosts.h"
+#include <scsi/scsi_host.h>
#include "ultrastor.h"
#define FALSE 0
} config = {0};
/* Set this to 1 to reset the SCSI bus on error. */
-int ultrastor_bus_reset;
+static int ultrastor_bus_reset;
/* Allowed BIOS base addresses (NULL indicates reserved) */
}
#endif
-static int ultrastor_14f_detect(Scsi_Host_Template * tpnt)
+static int ultrastor_14f_detect(struct scsi_host_template * tpnt)
{
size_t i;
unsigned char in_byte, version_byte = 0;
return FALSE;
}
-static int ultrastor_24f_detect(Scsi_Host_Template * tpnt)
+static int ultrastor_24f_detect(struct scsi_host_template * tpnt)
{
int i;
struct Scsi_Host * shpnt = NULL;
return FALSE;
}
-static int ultrastor_detect(Scsi_Host_Template * tpnt)
+static int ultrastor_detect(struct scsi_host_template * tpnt)
{
tpnt->proc_name = "ultrastor";
return ultrastor_14f_detect(tpnt) || ultrastor_24f_detect(tpnt);
ogm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 23));
icm_status = inb(port0 + 27);
icm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 28));
- spin_lock_irqsave(host->host_lock, flags);
+ spin_unlock_irqrestore(host->host_lock, flags);
}
/* First check to see if an interrupt is pending. I suspect the SiS
config.mscp[mscp_index].SCint, SCpnt);
#endif
if (config.mscp[mscp_index].SCint == 0)
- return SCSI_ABORT_NOT_RUNNING;
+ return FAILED;
if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort");
- config.mscp[mscp_index].SCint = 0;
+ config.mscp[mscp_index].SCint = NULL;
done = config.mscp[mscp_index].done;
- config.mscp[mscp_index].done = 0;
+ config.mscp[mscp_index].done = NULL;
SCpnt->result = DID_ABORT << 16;
/* Take the host lock to guard against scsi layer re-entry */
- spin_lock_irqsave(host->host_lock, flags);
done(SCpnt);
- spin_unlock_irqrestore(host->host_lock, flags);
/* Need to set a timeout here in case command never completes. */
return SUCCESS;
{
config.mscp[i].SCint->result = DID_RESET << 16;
config.mscp[i].done(config.mscp[i].SCint);
- config.mscp[i].done = 0;
+ config.mscp[i].done = NULL;
}
- config.mscp[i].SCint = 0;
+ config.mscp[i].SCint = NULL;
}
#endif
#endif
spin_unlock_irqrestore(host->host_lock, flags);
- return SCSI_RESET_SUCCESS;
+ return SUCCESS;
}
if (icm_status == 3) {
void (*done)(Scsi_Cmnd *) = mscp->done;
if (done) {
- mscp->done = 0;
+ mscp->done = NULL;
mscp->SCint->result = DID_ABORT << 16;
done(mscp->SCint);
}
once we call done, we may get another command queued before this
interrupt service routine can return. */
done = mscp->done;
- mscp->done = 0;
+ mscp->done = NULL;
/* Let the higher levels know that we're done */
switch (mscp->adapter_status)
SCtmp->result = status | mscp->target_status;
- SCtmp->host_scribble = 0;
+ SCtmp->host_scribble = NULL;
/* Free up mscp block for next command */
#if ULTRASTOR_MAX_CMDS == 1
MODULE_LICENSE("GPL");
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
.name = "UltraStor 14F/24F/34F",
.detect = ultrastor_detect,
.release = ultrastor_release,