*
*/
-static void __init NCR5380_init (struct Scsi_Host *instance, int flags)
+static int NCR5380_init (struct Scsi_Host *instance, int flags)
{
int i;
SETUP_HOSTDATA(instance);
NCR5380_write(MODE_REG, MR_BASE);
NCR5380_write(TARGET_COMMAND_REG, 0);
NCR5380_write(SELECT_ENABLE_REG, 0);
+
+ return 0;
}
/*
*
*/
-/* Only make static if a wrapper function is used */
-#ifndef NCR5380_queue_command
static
-#endif
int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
{
SETUP_HOSTDATA(cmd->host);
if (in_interrupt() || ((flags >> 8) & 7) >= 6)
queue_main();
else
- NCR5380_main();
+ NCR5380_main(NULL);
return 0;
}
* reenable them. This prevents reentrancy and kernel stack overflow.
*/
-static void NCR5380_main (void)
+static void NCR5380_main (void *bl)
{
Scsi_Cmnd *tmp, *prev;
struct Scsi_Host *instance = first_instance;
* called where the loop started in NCR5380_main().
*/
-#ifndef NCR5380_abort
static
-#endif
int NCR5380_abort (Scsi_Cmnd *cmd)
{
struct Scsi_Host *instance = cmd->host;
/*
- * Function : int NCR5380_reset (Scsi_Cmnd *cmd, unsigned int reset_flags)
+ * Function : int NCR5380_reset (Scsi_Cmnd *cmd)
*
* Purpose : reset the SCSI bus.
*
*
*/
-static int NCR5380_reset( Scsi_Cmnd *cmd, unsigned int reset_flags)
+static int NCR5380_bus_reset( Scsi_Cmnd *cmd)
{
SETUP_HOSTDATA(cmd->host);
int i;
#endif
}
-int atari_scsi_reset( Scsi_Cmnd *cmd, unsigned int reset_flags)
+int atari_scsi_bus_reset(Scsi_Cmnd *cmd)
{
int rv;
struct NCR5380_hostdata *hostdata =
#endif /* REAL_DMA */
}
- rv = NCR5380_reset(cmd, reset_flags);
+ rv = NCR5380_bus_reset(cmd);
/* Re-enable ints */
if (IS_A_TT()) {
.release = atari_scsi_release,
.info = atari_scsi_info,
.queuecommand = atari_scsi_queue_command,
- .abort = atari_scsi_abort,
- .reset = atari_scsi_reset,
+ .eh_abort_handler = atari_scsi_abort,
+ .eh_bus_reset_handler = atari_scsi_bus_reset,
.can_queue = 0, /* initialized at run-time */
.this_id = 0, /* initialized at run-time */
.sg_tablesize = 0, /* initialized at run-time */
/* (I_HAVE_OVERRUNS stuff removed) */
#ifndef ASM
-int atari_scsi_abort (Scsi_Cmnd *);
int atari_scsi_detect (Scsi_Host_Template *);
const char *atari_scsi_info (struct Scsi_Host *);
-int atari_scsi_queue_command (Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
int atari_scsi_reset (Scsi_Cmnd *, unsigned int);
int atari_scsi_proc_info (char *, char **, off_t, int, int, int);
#ifdef MODULE
/*
- * Function : void NCR5380_init (struct Scsi_Host *instance)
+ * Function : void NCR5380_init (struct Scsi_Host *instance, int flags)
*
* Purpose : initializes *instance and corresponding 5380 chip.
*
*
*/
-static void NCR5380_init (struct Scsi_Host *instance, int flags)
+static int NCR5380_init (struct Scsi_Host *instance, int flags)
{
int i;
SETUP_HOSTDATA(instance);
NCR5380_write(MODE_REG, MR_BASE);
NCR5380_write(TARGET_COMMAND_REG, 0);
NCR5380_write(SELECT_ENABLE_REG, 0);
+
+ return 0;
}
/*
*
*/
-/* Only make static if a wrapper function is used */
-#ifndef NCR5380_queue_command
static
-#endif
int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
{
SETUP_HOSTDATA(cmd->host);
Scsi_Cmnd *tmp;
int oldto;
unsigned long flags;
- extern int update_timeout(Scsi_Cmnd * SCset, int timeout);
#if (NDEBUG & NDEBUG_NO_WRITE)
switch (cmd->cmnd[0]) {
if (in_interrupt() > 0 || ((flags >> 8) & 7) >= 6)
queue_main();
else
- NCR5380_main();
+ NCR5380_main(NULL);
return 0;
}
/*
- * Function : NCR5380_main (void)
+ * Function : NCR5380_main (void *bl)
*
* Purpose : NCR5380_main is a coroutine that runs as long as more work can
* be done on the NCR5380 host adapters in a system. Both
* reenable them. This prevents reentrancy and kernel stack overflow.
*/
-static void NCR5380_main (void)
+static void NCR5380_main (void *bl)
{
Scsi_Cmnd *tmp, *prev;
struct Scsi_Host *instance = first_instance;
* called where the loop started in NCR5380_main().
*/
-#ifndef NCR5380_abort
-static
-#endif
int NCR5380_abort (Scsi_Cmnd *cmd)
{
struct Scsi_Host *instance = cmd->host;
/*
- * Function : int NCR5380_reset (Scsi_Cmnd *cmd, unsigned int reset_flags)
+ * Function : int NCR5380_bus_reset (Scsi_Cmnd *cmd)
*
* Purpose : reset the SCSI bus.
*
*
*/
-static int NCR5380_reset( Scsi_Cmnd *cmd, unsigned int reset_flags)
+static int NCR5380_bus_reset( Scsi_Cmnd *cmd)
{
SETUP_HOSTDATA(cmd->host);
int i;
*
*/
-static void __init NCR5380_init (struct Scsi_Host *instance, int flags)
+static int NCR5380_init (struct Scsi_Host *instance, int flags)
{
int i;
SETUP_HOSTDATA(instance);
NCR5380_write(MODE_REG, MR_BASE);
NCR5380_write(TARGET_COMMAND_REG, 0);
NCR5380_write(SELECT_ENABLE_REG, 0);
+
+ return 0;
}
/*
SETUP_HOSTDATA(cmd->host);
Scsi_Cmnd *tmp;
unsigned long flags;
- extern int update_timeout(Scsi_Cmnd * SCset, int timeout);
#if (NDEBUG & NDEBUG_NO_WRITE)
switch (cmd->cmnd[0]) {
if (in_interrupt() || ((flags >> 8) & 7) >= 6)
queue_main();
else
- NCR5380_main();
+ NCR5380_main(NULL);
return 0;
}
* reenable them. This prevents reentrancy and kernel stack overflow.
*/
-static void NCR5380_main (void)
+static void NCR5380_main (void *bl)
{
Scsi_Cmnd *tmp, *prev;
struct Scsi_Host *instance = first_instance;
local_save_flags(flags);
do {
- local_irq_disable(flags); /* Freeze request queues */
+ local_irq_disable(); /* Freeze request queues */
done = 1;
if (!hostdata->connected) {
/*
- * Function : int NCR5380_reset (Scsi_Cmnd *cmd, unsigned int reset_flags)
+ * Function : int NCR5380_bus_reset (Scsi_Cmnd *cmd)
*
* Purpose : reset the SCSI bus.
*
*
*/
-static int NCR5380_reset( Scsi_Cmnd *cmd, unsigned int reset_flags)
+static int NCR5380_bus_reset( Scsi_Cmnd *cmd)
{
SETUP_HOSTDATA(cmd->host);
int i;
#include "sun3_scsi.h"
#include "NCR5380.h"
+static void NCR5380_print(struct Scsi_Host *instance);
+
/* #define OLDDMA */
#define USE_WRAPPER
.release = sun3scsi_release,
.info = sun3scsi_info,
.queuecommand = sun3scsi_queue_command,
- .abort = sun3scsi_abort,
- .reset = sun3scsi_reset,
+ .eh_abort_handler = sun3scsi_abort,
+ .eh_bus_reset_handler = sun3scsi_bus_reset,
.can_queue = CAN_QUEUE,
.this_id = 7,
.sg_tablesize = SG_TABLESIZE,
static int sun3scsi_abort (Scsi_Cmnd *);
static int sun3scsi_detect (Scsi_Host_Template *);
static const char *sun3scsi_info (struct Scsi_Host *);
-static int sun3scsi_reset(Scsi_Cmnd *, unsigned int);
+static int sun3scsi_bus_reset(Scsi_Cmnd *);
static int sun3scsi_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int sun3scsi_proc_info (char *buffer, char **start, off_t offset,
int length, int hostno, int inout);
#define NCR5380_intr sun3scsi_intr
#define NCR5380_queue_command sun3scsi_queue_command
-#define NCR5380_reset sun3scsi_reset
+#define NCR5380_bus_reset sun3scsi_bus_reset
#define NCR5380_abort sun3scsi_abort
#define NCR5380_proc_info sun3scsi_proc_info
#define NCR5380_dma_xfer_len(i, cmd, phase) \
-/*
+ /*
* Sun3 SCSI stuff by Erik Verbruggen (erik@bigmama.xtdnet.nl)
*
* Sun3 DMA routines added by Sam Creasey (sammy@sammy.net)
.release = sun3scsi_release,
.info = sun3scsi_info,
.queuecommand = sun3scsi_queue_command,
- .abort = sun3scsi_abort,
- .reset = sun3scsi_reset,
+ .eh_abort_handler = sun3scsi_abort,
+ .eh_bus_reset_handler = sun3scsi_bus_reset,
.can_queue = CAN_QUEUE,
.this_id = 7,
.sg_tablesize = SG_TABLESIZE,
sp->SCp.ptr = (char *)((unsigned long)sp->SCp.buffer->dvma_address);
}
+
+static int esp_slave_alloc(Scsi_Device *SDptr)
+{
+ struct esp_device *esp_dev =
+ kmalloc(sizeof(struct esp_device), GFP_ATOMIC);
+
+ if (!esp_dev)
+ return -ENOMEM;
+ memset(esp_dev, 0, sizeof(struct esp_device));
+ SDptr->hostdata = esp_dev;
+ return 0;
+}
+
+static void esp_slave_destroy(Scsi_Device *SDptr)
+{
+ struct NCR_ESP *esp = (struct NCR_ESP *) SDptr->host->hostdata;
+
+ esp->targets_present &= ~(1 << SDptr->id);
+ kfree(SDptr->hostdata);
+ SDptr->hostdata = NULL;
+}
+
+
+static int sun3x_esp_release(struct Scsi_Host *instance)
+{
+ /* this code does not support being compiled as a module */
+ return 1;
+
+}
+
static Scsi_Host_Template driver_template = {
.proc_name = "esp",
.proc_info = &esp_proc_info,
.name = "Sun ESP 100/100a/200",
.detect = sun3x_esp_detect,
+ .release = sun3x_esp_release,
+ .slave_alloc = esp_slave_alloc,
+ .slave_destroy = esp_slave_destroy,
.info = esp_info,
.command = esp_command,
.queuecommand = esp_queue,