Commit cd26b38b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David S. Miller

[SPARC]: Cleanup scsi driver registration.

parent f70740bb
......@@ -1136,7 +1136,7 @@ static int __init detect_one_esp(Scsi_Host_Template *tpnt, struct sbus_dev *esp_
#include <asm/sun4paddr.h>
int __init esp_detect(Scsi_Host_Template *tpnt)
static int __init esp_detect(Scsi_Host_Template *tpnt)
{
static struct sbus_dev esp_dev;
int esps_in_use = 0;
......@@ -1161,7 +1161,7 @@ int __init esp_detect(Scsi_Host_Template *tpnt)
#else /* !CONFIG_SUN4 */
int __init esp_detect(Scsi_Host_Template *tpnt)
static int __init esp_detect(Scsi_Host_Template *tpnt)
{
struct sbus_bus *sbus;
struct sbus_dev *esp_dev, *sbdev_iter;
......@@ -1385,8 +1385,8 @@ static int esp_host_info(struct esp *esp, char *ptr, off_t offset, int len)
}
/* ESP proc filesystem code. */
int esp_proc_info(char *buffer, char **start, off_t offset, int length,
int hostno, int inout)
static int esp_proc_info(char *buffer, char **start, off_t offset,
int length, int hostno, int inout)
{
struct esp *esp;
......@@ -1830,7 +1830,7 @@ static void esp_exec_cmd(struct esp *esp)
}
/* Queue a SCSI command delivered from the mid-level Linux SCSI code. */
int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
static int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
{
struct esp *esp;
......@@ -1867,7 +1867,7 @@ int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
}
/* Only queuing supported in this ESP driver. */
int esp_command(Scsi_Cmnd *SCpnt)
static int esp_command(Scsi_Cmnd *SCpnt)
{
struct esp *esp = (struct esp *) SCpnt->host->hostdata;
......@@ -1932,7 +1932,7 @@ static void esp_dump_state(struct esp *esp)
}
/* Abort a command. */
int esp_abort(Scsi_Cmnd *SCptr)
static int esp_abort(Scsi_Cmnd *SCptr)
{
struct esp *esp = (struct esp *) SCptr->host->hostdata;
unsigned long flags;
......@@ -2068,7 +2068,7 @@ static int esp_do_resetbus(struct esp *esp)
/* Reset ESP chip, reset hanging bus, then kill active and
* disconnected commands for targets without soft reset.
*/
int esp_reset(Scsi_Cmnd *SCptr)
static int esp_reset(Scsi_Cmnd *SCptr)
{
struct esp *esp = (struct esp *) SCptr->host->hostdata;
unsigned long flags;
......@@ -4359,7 +4359,7 @@ static void esp_intr(int irq, void *dev_id, struct pt_regs *pregs)
spin_unlock_irqrestore(esp->ehost->host_lock, flags);
}
void esp_slave_detach(Scsi_Device* SDptr)
static void esp_slave_detach(Scsi_Device* SDptr)
{
struct esp *esp = (struct esp *) SDptr->host->hostdata;
esp->targets_present &= ~(1 << SDptr->id);
......@@ -4368,7 +4368,27 @@ void esp_slave_detach(Scsi_Device* SDptr)
SDptr->hostdata = NULL;
}
static Scsi_Host_Template driver_template = SCSI_SPARC_ESP;
#include "scsi_module.c"
static Scsi_Host_Template driver_template = {
.proc_name = "esp",
.proc_info = esp_proc_info,
.name = "Sun ESP 100/100a/200",
.detect = esp_detect,
.slave_detach = esp_slave_detach,
.info = esp_info,
.command = esp_command,
.queuecommand = esp_queue,
.eh_abort_handler = esp_abort,
.eh_bus_reset_handler = esp_reset,
.can_queue = 7,
.this_id = 7,
.sg_tablesize = SG_ALL,
.cmd_per_lun = 1,
.use_clustering = ENABLE_CLUSTERING,
/* Sparc32's iommu code cannot handle highmem pages yet. */
#ifdef CONFIG_SPARC64
.highmem_io = 1,
#endif
}
#include "scsi_module.c"
......@@ -403,42 +403,6 @@ struct esp {
#define ESP_MHZ_TO_CYCLE(mhertz) ((1000000000) / ((mhertz) / 1000))
#define ESP_TICK(ccf, cycle) ((7682 * (ccf) * (cycle) / 1000))
extern int esp_detect(struct SHT *);
extern const char *esp_info(struct Scsi_Host *);
extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
extern int esp_command(Scsi_Cmnd *);
extern int esp_abort(Scsi_Cmnd *);
extern int esp_reset(Scsi_Cmnd *);
extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
int hostno, int inout);
extern void esp_slave_detach(Scsi_Device* SDptr);
#ifdef CONFIG_SPARC64
#define ESP_HIGHMEM_IO 1
#else
/* Sparc32's iommu code cannot handle highmem pages yet. */
#define ESP_HIGHMEM_IO 0
#endif
#define SCSI_SPARC_ESP { \
.proc_name = "esp", \
.proc_info = &esp_proc_info, \
.name = "Sun ESP 100/100a/200", \
.detect = esp_detect, \
.slave_detach = esp_slave_detach, \
.info = esp_info, \
.command = esp_command, \
.queuecommand = esp_queue, \
.eh_abort_handler = esp_abort, \
.eh_bus_reset_handler = esp_reset, \
.can_queue = 7, \
.this_id = 7, \
.sg_tablesize = SG_ALL, \
.cmd_per_lun = 1, \
.use_clustering = ENABLE_CLUSTERING, \
.highmem_io = ESP_HIGHMEM_IO, \
}
/* For our interrupt engine. */
#define for_each_esp(esp) \
for((esp) = espchain; (esp); (esp) = (esp)->next)
......
......@@ -807,7 +807,7 @@ static int __init qpti_map_queues(struct qlogicpti *qpti)
}
/* Detect all PTI Qlogic ISP's in the machine. */
int __init qlogicpti_detect(Scsi_Host_Template *tpnt)
static int __init qlogicpti_detect(Scsi_Host_Template *tpnt)
{
struct qlogicpti *qpti;
struct Scsi_Host *qpti_host;
......@@ -946,7 +946,7 @@ int __init qlogicpti_detect(Scsi_Host_Template *tpnt)
return nqptis;
}
int qlogicpti_release(struct Scsi_Host *host)
staticstatic int qlogicpti_release(struct Scsi_Host *host)
{
struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
......@@ -1164,7 +1164,8 @@ static void ourdone(Scsi_Cmnd *Cmnd)
done(Cmnd);
}
int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
void (*done)(Scsi_Cmnd *))
{
struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->host->hostdata;
unsigned long flags;
......@@ -1240,7 +1241,7 @@ int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
*
* "This code must fly." -davem
*/
int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
static int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
{
struct Scsi_Host *host = Cmnd->host;
struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
......@@ -1461,7 +1462,7 @@ static void qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
local_irq_restore(flags);
}
int qlogicpti_abort(Scsi_Cmnd *Cmnd)
static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
{
u_short param[6];
struct Scsi_Host *host = Cmnd->host;
......@@ -1503,7 +1504,7 @@ int qlogicpti_abort(Scsi_Cmnd *Cmnd)
return return_status;
}
int qlogicpti_reset(Scsi_Cmnd *Cmnd)
static int qlogicpti_reset(Scsi_Cmnd *Cmnd)
{
u_short param[6];
struct Scsi_Host *host = Cmnd->host;
......@@ -1532,6 +1533,23 @@ int qlogicpti_reset(Scsi_Cmnd *Cmnd)
return return_status;
}
static Scsi_Host_Template driver_template = QLOGICPTI;
static Scsi_Host_Template driver_template = {
.detect = qlogicpti_detect,
.release = qlogicpti_release,
.info = qlogicpti_info,
.queuecommand = qlogicpti_queuecommand_slow,
.eh_abort_handler = qlogicpti_abort,
.eh_bus_reset_handler = qlogicpti_reset,
.can_queue = QLOGICPTI_REQ_QUEUE_LEN,
.this_id = 7,
.sg_tablesize = QLOGICPTI_MAX_SG(QLOGICPTI_REQ_QUEUE_LEN),
.cmd_per_lun = 1,
.use_clustering = ENABLE_CLUSTERING,
/* Sparc32's iommu code cannot handle highmem pages yet. */
#ifdef CONFIG_SPARC64
.highmem_io = 1,
#endif
};
#include "scsi_module.c"
......@@ -47,18 +47,6 @@
#define QLOGICPTI_REQ_QUEUE_LEN 255 /* must be power of two - 1 */
#define QLOGICPTI_MAX_SG(ql) (4 + ((ql) > 0) ? 7*((ql) - 1) : 0)
#ifndef NULL
#define NULL (0)
#endif
int qlogicpti_detect(Scsi_Host_Template *);
int qlogicpti_release(struct Scsi_Host *);
const char * qlogicpti_info(struct Scsi_Host *);
int qlogicpti_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
int qlogicpti_queuecommand_slow(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
int qlogicpti_abort(Scsi_Cmnd *);
int qlogicpti_reset(Scsi_Cmnd *);
/* mailbox command complete status codes */
#define MBOX_COMMAND_COMPLETE 0x4000
#define INVALID_COMMAND 0x4001
......@@ -514,28 +502,6 @@ struct qlogicpti {
#define HCCTRL_B1ENAB 0x0008 /* Breakpoint 1 enable */
#define HCCTRL_B0ENAB 0x0004 /* Breakpoint 0 enable */
#ifdef CONFIG_SPARC64
#define QLOGICPTI_HIGHMEM_IO 1
#else
/* Sparc32's iommu code cannot handle highmem pages yet. */
#define QLOGICPTI_HIGHMEM_IO 0
#endif
#define QLOGICPTI { \
.detect = qlogicpti_detect, \
.release = qlogicpti_release, \
.info = qlogicpti_info, \
.queuecommand = qlogicpti_queuecommand_slow, \
.eh_abort_handler = qlogicpti_abort, \
.eh_bus_reset_handler = qlogicpti_reset, \
.can_queue = QLOGICPTI_REQ_QUEUE_LEN, \
.this_id = 7, \
.sg_tablesize = QLOGICPTI_MAX_SG(QLOGICPTI_REQ_QUEUE_LEN), \
.cmd_per_lun = 1, \
.use_clustering = ENABLE_CLUSTERING, \
.highmem_io = QLOGICPTI_HIGHMEM_IO, \
}
/* For our interrupt engine. */
#define for_each_qlogicpti(qp) \
for((qp) = qptichain; (qp); (qp) = (qp)->next)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment