Commit 88544416 authored by Tom 'spot' Callaway's avatar Tom 'spot' Callaway Committed by David S. Miller

[SBUS]: Stop using drivers/scsi/{scsi,hosts}.h in drivers.

parent 9c5cdec2
This diff is collapsed.
...@@ -10,9 +10,20 @@ ...@@ -10,9 +10,20 @@
#include <linux/config.h> #include <linux/config.h>
/* #include "scsi.h" */
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_request.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
/* For dvma controller register definitions. */ /* For dvma controller register definitions. */
#include <asm/dma.h> #include <asm/dma.h>
#define scsi_to_sbus_dma_dir(scsi_dir) ((int)(scsi_dir))
/* The ESP SCSI controllers have their register sets in three /* The ESP SCSI controllers have their register sets in three
* "classes": * "classes":
* *
...@@ -181,9 +192,9 @@ struct esp { ...@@ -181,9 +192,9 @@ struct esp {
int bursts; /* Burst sizes our DVMA supports */ int bursts; /* Burst sizes our DVMA supports */
/* Our command queues, only one cmd lives in the current_SC queue. */ /* Our command queues, only one cmd lives in the current_SC queue. */
Scsi_Cmnd *issue_SC; /* Commands to be issued */ struct scsi_cmnd *issue_SC; /* Commands to be issued */
Scsi_Cmnd *current_SC; /* Who is currently working the bus */ struct scsi_cmnd *current_SC; /* Who is currently working the bus */
Scsi_Cmnd *disconnected_SC;/* Commands disconnected from the bus */ struct scsi_cmnd *disconnected_SC;/* Commands disconnected from the bus */
/* Message goo */ /* Message goo */
u8 cur_msgout[16]; u8 cur_msgout[16];
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include "scsi.h"
#include "hosts.h"
#include "qlogicpti.h" #include "qlogicpti.h"
#include <asm/sbus.h> #include <asm/sbus.h>
...@@ -809,7 +807,7 @@ static int __init qpti_map_queues(struct qlogicpti *qpti) ...@@ -809,7 +807,7 @@ static int __init qpti_map_queues(struct qlogicpti *qpti)
} }
/* Detect all PTI Qlogic ISP's in the machine. */ /* Detect all PTI Qlogic ISP's in the machine. */
static int __init qlogicpti_detect(Scsi_Host_Template *tpnt) static int __init qlogicpti_detect(struct scsi_host_template *tpnt)
{ {
struct qlogicpti *qpti; struct qlogicpti *qpti;
struct Scsi_Host *qpti_host; struct Scsi_Host *qpti_host;
...@@ -878,7 +876,7 @@ static int __init qlogicpti_detect(Scsi_Host_Template *tpnt) ...@@ -878,7 +876,7 @@ static int __init qlogicpti_detect(Scsi_Host_Template *tpnt)
qpti_get_bursts(qpti); qpti_get_bursts(qpti);
qpti_get_clock(qpti); qpti_get_clock(qpti);
/* Clear out Scsi_Cmnd array. */ /* Clear out scsi_cmnd array. */
memset(qpti->cmd_slots, 0, sizeof(qpti->cmd_slots)); memset(qpti->cmd_slots, 0, sizeof(qpti->cmd_slots));
if (qpti_map_queues(qpti) < 0) if (qpti_map_queues(qpti) < 0)
...@@ -997,7 +995,7 @@ static inline void marker_frob(struct Command_Entry *cmd) ...@@ -997,7 +995,7 @@ static inline void marker_frob(struct Command_Entry *cmd)
marker->rsvd = 0; marker->rsvd = 0;
} }
static inline void cmd_frob(struct Command_Entry *cmd, Scsi_Cmnd *Cmnd, static inline void cmd_frob(struct Command_Entry *cmd, struct scsi_cmnd *Cmnd,
struct qlogicpti *qpti) struct qlogicpti *qpti)
{ {
memset(cmd, 0, sizeof(struct Command_Entry)); memset(cmd, 0, sizeof(struct Command_Entry));
...@@ -1027,7 +1025,7 @@ static inline void cmd_frob(struct Command_Entry *cmd, Scsi_Cmnd *Cmnd, ...@@ -1027,7 +1025,7 @@ static inline void cmd_frob(struct Command_Entry *cmd, Scsi_Cmnd *Cmnd,
} }
/* Do it to it baby. */ /* Do it to it baby. */
static inline int load_cmd(Scsi_Cmnd *Cmnd, struct Command_Entry *cmd, static inline int load_cmd(struct scsi_cmnd *Cmnd, struct Command_Entry *cmd,
struct qlogicpti *qpti, u_int in_ptr, u_int out_ptr) struct qlogicpti *qpti, u_int in_ptr, u_int out_ptr)
{ {
struct dataseg *ds; struct dataseg *ds;
...@@ -1115,11 +1113,11 @@ static inline void update_can_queue(struct Scsi_Host *host, u_int in_ptr, u_int ...@@ -1115,11 +1113,11 @@ static inline void update_can_queue(struct Scsi_Host *host, u_int in_ptr, u_int
/* /*
* Until we scan the entire bus with inquiries, go throught this fella... * Until we scan the entire bus with inquiries, go throught this fella...
*/ */
static void ourdone(Scsi_Cmnd *Cmnd) static void ourdone(struct scsi_cmnd *Cmnd)
{ {
struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->device->host->hostdata; struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->device->host->hostdata;
int tgt = Cmnd->device->id; int tgt = Cmnd->device->id;
void (*done) (Scsi_Cmnd *); void (*done) (struct scsi_cmnd *);
/* This grot added by DaveM, blame him for ugliness. /* This grot added by DaveM, blame him for ugliness.
* The issue is that in the 2.3.x driver we use the * The issue is that in the 2.3.x driver we use the
...@@ -1127,7 +1125,7 @@ static void ourdone(Scsi_Cmnd *Cmnd) ...@@ -1127,7 +1125,7 @@ static void ourdone(Scsi_Cmnd *Cmnd)
* completion linked list at interrupt service time, * completion linked list at interrupt service time,
* so we have to store the done function pointer elsewhere. * so we have to store the done function pointer elsewhere.
*/ */
done = (void (*)(Scsi_Cmnd *)) done = (void (*)(struct scsi_cmnd *))
(((unsigned long) Cmnd->SCp.Message) (((unsigned long) Cmnd->SCp.Message)
#ifdef __sparc_v9__ #ifdef __sparc_v9__
| ((unsigned long) Cmnd->SCp.Status << 32UL) | ((unsigned long) Cmnd->SCp.Status << 32UL)
...@@ -1164,10 +1162,10 @@ static void ourdone(Scsi_Cmnd *Cmnd) ...@@ -1164,10 +1162,10 @@ static void ourdone(Scsi_Cmnd *Cmnd)
done(Cmnd); done(Cmnd);
} }
static int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *)); static int qlogicpti_queuecommand(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *));
static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd, static int qlogicpti_queuecommand_slow(struct scsi_cmnd *Cmnd,
void (*done)(Scsi_Cmnd *)) void (*done)(struct scsi_cmnd *))
{ {
struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->device->host->hostdata; struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->device->host->hostdata;
...@@ -1238,7 +1236,7 @@ static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd, ...@@ -1238,7 +1236,7 @@ static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
* *
* "This code must fly." -davem * "This code must fly." -davem
*/ */
static int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *)) static int qlogicpti_queuecommand(struct scsi_cmnd *Cmnd, void (*done)(struct scsi_cmnd *))
{ {
struct Scsi_Host *host = Cmnd->device->host; struct Scsi_Host *host = Cmnd->device->host;
struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
...@@ -1351,9 +1349,9 @@ static int qlogicpti_return_status(struct Status_Entry *sts, int id) ...@@ -1351,9 +1349,9 @@ static int qlogicpti_return_status(struct Status_Entry *sts, int id)
return (sts->scsi_status & STATUS_MASK) | (host_status << 16); return (sts->scsi_status & STATUS_MASK) | (host_status << 16);
} }
static Scsi_Cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti) static struct scsi_cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
{ {
Scsi_Cmnd *Cmnd, *done_queue = NULL; struct scsi_cmnd *Cmnd, *done_queue = NULL;
struct Status_Entry *sts; struct Status_Entry *sts;
u_int in_ptr, out_ptr; u_int in_ptr, out_ptr;
...@@ -1433,16 +1431,16 @@ static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1433,16 +1431,16 @@ static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct qlogicpti *qpti = dev_id; struct qlogicpti *qpti = dev_id;
unsigned long flags; unsigned long flags;
Scsi_Cmnd *dq; struct scsi_cmnd *dq;
spin_lock_irqsave(qpti->qhost->host_lock, flags); spin_lock_irqsave(qpti->qhost->host_lock, flags);
dq = qlogicpti_intr_handler(qpti); dq = qlogicpti_intr_handler(qpti);
if (dq != NULL) { if (dq != NULL) {
do { do {
Scsi_Cmnd *next; struct scsi_cmnd *next;
next = (Scsi_Cmnd *) dq->host_scribble; next = (struct scsi_cmnd *) dq->host_scribble;
dq->scsi_done(dq); dq->scsi_done(dq);
dq = next; dq = next;
} while (dq != NULL); } while (dq != NULL);
...@@ -1452,7 +1450,7 @@ static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1452,7 +1450,7 @@ static irqreturn_t qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int qlogicpti_abort(Scsi_Cmnd *Cmnd) static int qlogicpti_abort(struct scsi_cmnd *Cmnd)
{ {
u_short param[6]; u_short param[6];
struct Scsi_Host *host = Cmnd->device->host; struct Scsi_Host *host = Cmnd->device->host;
...@@ -1489,7 +1487,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd) ...@@ -1489,7 +1487,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
return return_status; return return_status;
} }
static int qlogicpti_reset(Scsi_Cmnd *Cmnd) static int qlogicpti_reset(struct scsi_cmnd *Cmnd)
{ {
u_short param[6]; u_short param[6];
struct Scsi_Host *host = Cmnd->device->host; struct Scsi_Host *host = Cmnd->device->host;
...@@ -1513,7 +1511,7 @@ static int qlogicpti_reset(Scsi_Cmnd *Cmnd) ...@@ -1513,7 +1511,7 @@ static int qlogicpti_reset(Scsi_Cmnd *Cmnd)
return return_status; return return_status;
} }
static Scsi_Host_Template driver_template = { static struct scsi_host_template driver_template = {
.detect = qlogicpti_detect, .detect = qlogicpti_detect,
.release = qlogicpti_release, .release = qlogicpti_release,
.info = qlogicpti_info, .info = qlogicpti_info,
......
...@@ -8,6 +8,17 @@ ...@@ -8,6 +8,17 @@
#include <linux/config.h> #include <linux/config.h>
/* #include "scsi.h" */
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_request.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#define scsi_to_sbus_dma_dir(scsi_dir) ((int)(scsi_dir))
/* Qlogic/SBUS controller registers. */ /* Qlogic/SBUS controller registers. */
#define SBUS_CFG1 0x006UL #define SBUS_CFG1 0x006UL
#define SBUS_CTRL 0x008UL #define SBUS_CTRL 0x008UL
...@@ -352,7 +363,7 @@ struct qlogicpti { ...@@ -352,7 +363,7 @@ struct qlogicpti {
* Ex000 sparc64 machines with >4GB of ram we just keep track of the * Ex000 sparc64 machines with >4GB of ram we just keep track of the
* scsi command pointers here. This is essentially what Matt Jacob does. -DaveM * scsi command pointers here. This is essentially what Matt Jacob does. -DaveM
*/ */
Scsi_Cmnd *cmd_slots[QLOGICPTI_REQ_QUEUE_LEN + 1]; struct scsi_cmnd *cmd_slots[QLOGICPTI_REQ_QUEUE_LEN + 1];
/* The rest of the elements are unimportant for performance. */ /* The rest of the elements are unimportant for performance. */
struct qlogicpti *next; struct qlogicpti *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