Commit c1278289 authored by Henne's avatar Henne Committed by James Bottomley

[SCSI] scsi: Scsi_Cmnd convertion in aic7xxx_old.c

Changes the obsolete Scsi_Cmnd to struct scsi_cmnd in aic7xxx_old.c.
Also replacing lots of whitespaces with tabs in structures and functions
which have been changed.
Signed-off-by: default avatarHenrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 2a3681e5
...@@ -781,7 +781,7 @@ typedef enum { ...@@ -781,7 +781,7 @@ typedef enum {
struct aic7xxx_scb { struct aic7xxx_scb {
struct aic7xxx_hwscb *hscb; /* corresponding hardware scb */ struct aic7xxx_hwscb *hscb; /* corresponding hardware scb */
Scsi_Cmnd *cmd; /* Scsi_Cmnd for this scb */ struct scsi_cmnd *cmd; /* scsi_cmnd for this scb */
struct aic7xxx_scb *q_next; /* next scb in queue */ struct aic7xxx_scb *q_next; /* next scb in queue */
volatile scb_flag_type flags; /* current state of scb */ volatile scb_flag_type flags; /* current state of scb */
struct hw_scatterlist *sg_list; /* SG list in adapter format */ struct hw_scatterlist *sg_list; /* SG list in adapter format */
...@@ -792,9 +792,11 @@ struct aic7xxx_scb { ...@@ -792,9 +792,11 @@ struct aic7xxx_scb {
* sense command. * sense command.
*/ */
unsigned char *cmnd; unsigned char *cmnd;
unsigned int sg_length; /* We init this during buildscb so we unsigned int sg_length; /*
* don't have to calculate anything * We init this during
* during underflow/overflow/stat code * buildscb so we don't have
* to calculate anything during
* underflow/overflow/stat code
*/ */
void *kmalloc_ptr; void *kmalloc_ptr;
struct aic7xxx_scb_dma *scb_dma; struct aic7xxx_scb_dma *scb_dma;
...@@ -926,8 +928,8 @@ struct aic7xxx_host { ...@@ -926,8 +928,8 @@ struct aic7xxx_host {
unsigned long spurious_int; unsigned long spurious_int;
scb_data_type *scb_data; scb_data_type *scb_data;
struct aic7xxx_cmd_queue { struct aic7xxx_cmd_queue {
Scsi_Cmnd *head; struct scsi_cmnd *head;
Scsi_Cmnd *tail; struct scsi_cmnd *tail;
} completeq; } completeq;
/* /*
...@@ -946,10 +948,8 @@ struct aic7xxx_host { ...@@ -946,10 +948,8 @@ struct aic7xxx_host {
unsigned char dev_last_queue_full[MAX_TARGETS]; unsigned char dev_last_queue_full[MAX_TARGETS];
unsigned char dev_last_queue_full_count[MAX_TARGETS]; unsigned char dev_last_queue_full_count[MAX_TARGETS];
unsigned short ultraenb; /* Gets downloaded to card as a unsigned short ultraenb; /* Gets downloaded to card as a bitmap */
bitmap */ unsigned short discenable; /* Gets downloaded to card as a bitmap */
unsigned short discenable; /* Gets downloaded to card as a
bitmap */
transinfo_type user[MAX_TARGETS]; transinfo_type user[MAX_TARGETS];
unsigned char msg_buf[13]; /* The message for the target */ unsigned char msg_buf[13]; /* The message for the target */
...@@ -962,10 +962,11 @@ struct aic7xxx_host { ...@@ -962,10 +962,11 @@ struct aic7xxx_host {
/* /*
* We put the less frequently used host structure items after the more * We put the less frequently used host structure items
* frequently used items to try and ease the burden on the cache subsystem. * after the more frequently used items to try and ease
* These entries are not *commonly* accessed, whereas the preceding entries * the burden on the cache subsystem.
* are accessed very often. * These entries are not *commonly* accessed, whereas
* the preceding entries are accessed very often.
*/ */
unsigned int irq; /* IRQ for this adapter */ unsigned int irq; /* IRQ for this adapter */
...@@ -990,7 +991,6 @@ struct aic7xxx_host { ...@@ -990,7 +991,6 @@ struct aic7xxx_host {
ahc_chip chip; /* chip type */ ahc_chip chip; /* chip type */
ahc_bugs bugs; ahc_bugs bugs;
dma_addr_t fifo_dma; /* DMA handle for fifo arrays */ dma_addr_t fifo_dma; /* DMA handle for fifo arrays */
}; };
/* /*
...@@ -1271,7 +1271,7 @@ static void aic7xxx_set_syncrate(struct aic7xxx_host *p, ...@@ -1271,7 +1271,7 @@ static void aic7xxx_set_syncrate(struct aic7xxx_host *p,
static void aic7xxx_set_width(struct aic7xxx_host *p, int target, int channel, static void aic7xxx_set_width(struct aic7xxx_host *p, int target, int channel,
int lun, unsigned int width, unsigned int type, int lun, unsigned int width, unsigned int type,
struct aic_dev_data *aic_dev); struct aic_dev_data *aic_dev);
static void aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd); static void aic7xxx_panic_abort(struct aic7xxx_host *p, struct scsi_cmnd *cmd);
static void aic7xxx_print_card(struct aic7xxx_host *p); static void aic7xxx_print_card(struct aic7xxx_host *p);
static void aic7xxx_print_scratch_ram(struct aic7xxx_host *p); static void aic7xxx_print_scratch_ram(struct aic7xxx_host *p);
static void aic7xxx_print_sequencer(struct aic7xxx_host *p, int downloaded); static void aic7xxx_print_sequencer(struct aic7xxx_host *p, int downloaded);
...@@ -2626,7 +2626,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p) ...@@ -2626,7 +2626,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p)
* we're finished. This function queues the completed commands. * we're finished. This function queues the completed commands.
*-F*************************************************************************/ *-F*************************************************************************/
static void static void
aic7xxx_queue_cmd_complete(struct aic7xxx_host *p, Scsi_Cmnd *cmd) aic7xxx_queue_cmd_complete(struct aic7xxx_host *p, struct scsi_cmnd *cmd)
{ {
aic7xxx_position(cmd) = SCB_LIST_NULL; aic7xxx_position(cmd) = SCB_LIST_NULL;
cmd->host_scribble = (char *)p->completeq.head; cmd->host_scribble = (char *)p->completeq.head;
...@@ -2640,15 +2640,13 @@ aic7xxx_queue_cmd_complete(struct aic7xxx_host *p, Scsi_Cmnd *cmd) ...@@ -2640,15 +2640,13 @@ aic7xxx_queue_cmd_complete(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
* Description: * Description:
* Process the completed command queue. * Process the completed command queue.
*-F*************************************************************************/ *-F*************************************************************************/
static void static void aic7xxx_done_cmds_complete(struct aic7xxx_host *p)
aic7xxx_done_cmds_complete(struct aic7xxx_host *p)
{ {
Scsi_Cmnd *cmd; struct scsi_cmnd *cmd;
while (p->completeq.head != NULL) while (p->completeq.head != NULL) {
{
cmd = p->completeq.head; cmd = p->completeq.head;
p->completeq.head = (Scsi_Cmnd *)cmd->host_scribble; p->completeq.head = (struct scsi_Cmnd *) cmd->host_scribble;
cmd->host_scribble = NULL; cmd->host_scribble = NULL;
cmd->scsi_done(cmd); cmd->scsi_done(cmd);
} }
...@@ -2687,7 +2685,7 @@ aic7xxx_free_scb(struct aic7xxx_host *p, struct aic7xxx_scb *scb) ...@@ -2687,7 +2685,7 @@ aic7xxx_free_scb(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
static void static void
aic7xxx_done(struct aic7xxx_host *p, struct aic7xxx_scb *scb) aic7xxx_done(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
{ {
Scsi_Cmnd *cmd = scb->cmd; struct scsi_cmnd *cmd = scb->cmd;
struct aic_dev_data *aic_dev = cmd->device->hostdata; struct aic_dev_data *aic_dev = cmd->device->hostdata;
int tindex = TARGET_INDEX(cmd); int tindex = TARGET_INDEX(cmd);
struct aic7xxx_scb *scbp; struct aic7xxx_scb *scbp;
...@@ -2891,7 +2889,7 @@ aic7xxx_done(struct aic7xxx_host *p, struct aic7xxx_scb *scb) ...@@ -2891,7 +2889,7 @@ aic7xxx_done(struct aic7xxx_host *p, struct aic7xxx_scb *scb)
* aic7xxx_run_done_queue * aic7xxx_run_done_queue
* *
* Description: * Description:
* Calls the aic7xxx_done() for the Scsi_Cmnd of each scb in the * Calls the aic7xxx_done() for the scsi_cmnd of each scb in the
* aborted list, and adds each scb to the free list. If complete * aborted list, and adds each scb to the free list. If complete
* is TRUE, we also process the commands complete list. * is TRUE, we also process the commands complete list.
*-F*************************************************************************/ *-F*************************************************************************/
...@@ -3827,7 +3825,7 @@ static void ...@@ -3827,7 +3825,7 @@ static void
aic7xxx_calculate_residual (struct aic7xxx_host *p, struct aic7xxx_scb *scb) aic7xxx_calculate_residual (struct aic7xxx_host *p, struct aic7xxx_scb *scb)
{ {
struct aic7xxx_hwscb *hscb; struct aic7xxx_hwscb *hscb;
Scsi_Cmnd *cmd; struct scsi_cmnd *cmd;
int actual, i; int actual, i;
cmd = scb->cmd; cmd = scb->cmd;
...@@ -4221,7 +4219,7 @@ aic7xxx_handle_seqint(struct aic7xxx_host *p, unsigned char intstat) ...@@ -4221,7 +4219,7 @@ aic7xxx_handle_seqint(struct aic7xxx_host *p, unsigned char intstat)
{ {
unsigned char scb_index; unsigned char scb_index;
struct aic7xxx_hwscb *hscb; struct aic7xxx_hwscb *hscb;
Scsi_Cmnd *cmd; struct scsi_cmnd *cmd;
/* The sequencer will notify us when a command has an error that /* The sequencer will notify us when a command has an error that
* would be of interest to the kernel. This allows us to leave * would be of interest to the kernel. This allows us to leave
...@@ -5802,7 +5800,7 @@ aic7xxx_handle_scsiint(struct aic7xxx_host *p, unsigned char intstat) ...@@ -5802,7 +5800,7 @@ aic7xxx_handle_scsiint(struct aic7xxx_host *p, unsigned char intstat)
{ {
unsigned char scbptr; unsigned char scbptr;
unsigned char nextscb; unsigned char nextscb;
Scsi_Cmnd *cmd; struct scsi_cmnd *cmd;
scbptr = aic_inb(p, WAITING_SCBH); scbptr = aic_inb(p, WAITING_SCBH);
if (scbptr > p->scb_data->maxhscbs) if (scbptr > p->scb_data->maxhscbs)
...@@ -5942,7 +5940,7 @@ aic7xxx_handle_scsiint(struct aic7xxx_host *p, unsigned char intstat) ...@@ -5942,7 +5940,7 @@ aic7xxx_handle_scsiint(struct aic7xxx_host *p, unsigned char intstat)
* Determine the bus phase and queue an appropriate message. * Determine the bus phase and queue an appropriate message.
*/ */
char *phase; char *phase;
Scsi_Cmnd *cmd; struct scsi_cmnd *cmd;
unsigned char mesg_out = MSG_NOOP; unsigned char mesg_out = MSG_NOOP;
unsigned char lastphase = aic_inb(p, LASTPHASE); unsigned char lastphase = aic_inb(p, LASTPHASE);
unsigned char sstat2 = aic_inb(p, SSTAT2); unsigned char sstat2 = aic_inb(p, SSTAT2);
...@@ -6250,7 +6248,7 @@ aic7xxx_handle_command_completion_intr(struct aic7xxx_host *p) ...@@ -6250,7 +6248,7 @@ aic7xxx_handle_command_completion_intr(struct aic7xxx_host *p)
{ {
struct aic7xxx_scb *scb = NULL; struct aic7xxx_scb *scb = NULL;
struct aic_dev_data *aic_dev; struct aic_dev_data *aic_dev;
Scsi_Cmnd *cmd; struct scsi_cmnd *cmd;
unsigned char scb_index, tindex; unsigned char scb_index, tindex;
#ifdef AIC7XXX_VERBOSE_DEBUGGING #ifdef AIC7XXX_VERBOSE_DEBUGGING
...@@ -10131,8 +10129,7 @@ aic7xxx_detect(struct scsi_host_template *template) ...@@ -10131,8 +10129,7 @@ aic7xxx_detect(struct scsi_host_template *template)
* Description: * Description:
* Build a SCB. * Build a SCB.
*-F*************************************************************************/ *-F*************************************************************************/
static void static void aic7xxx_buildscb(struct aic7xxx_host *p, struct scsi_cmnd *cmd,
aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd,
struct aic7xxx_scb *scb) struct aic7xxx_scb *scb)
{ {
unsigned short mask; unsigned short mask;
...@@ -10285,8 +10282,7 @@ aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd, ...@@ -10285,8 +10282,7 @@ aic7xxx_buildscb(struct aic7xxx_host *p, Scsi_Cmnd *cmd,
* Description: * Description:
* Queue a SCB to the controller. * Queue a SCB to the controller.
*-F*************************************************************************/ *-F*************************************************************************/
static int static int aic7xxx_queue(struct scsi_cmnd *cmd, void (*fn)(struct scsi_cmnd *))
aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *))
{ {
struct aic7xxx_host *p; struct aic7xxx_host *p;
struct aic7xxx_scb *scb; struct aic7xxx_scb *scb;
...@@ -10320,7 +10316,7 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *)) ...@@ -10320,7 +10316,7 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *))
scb->cmd = cmd; scb->cmd = cmd;
/* /*
* Make sure the Scsi_Cmnd pointer is saved, the struct it points to * Make sure the scsi_cmnd pointer is saved, the struct it points to
* is set up properly, and the parity error flag is reset, then send * is set up properly, and the parity error flag is reset, then send
* the SCB to the sequencer and watch the fun begin. * the SCB to the sequencer and watch the fun begin.
*/ */
...@@ -10356,8 +10352,7 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *)) ...@@ -10356,8 +10352,7 @@ aic7xxx_queue(Scsi_Cmnd *cmd, void (*fn)(Scsi_Cmnd *))
* aborted, then we will reset the channel and have all devices renegotiate. * aborted, then we will reset the channel and have all devices renegotiate.
* Returns an enumerated type that indicates the status of the operation. * Returns an enumerated type that indicates the status of the operation.
*-F*************************************************************************/ *-F*************************************************************************/
static int static int __aic7xxx_bus_device_reset(struct scsi_cmnd *cmd)
__aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
{ {
struct aic7xxx_host *p; struct aic7xxx_host *p;
struct aic7xxx_scb *scb; struct aic7xxx_scb *scb;
...@@ -10550,8 +10545,7 @@ __aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) ...@@ -10550,8 +10545,7 @@ __aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
return SUCCESS; return SUCCESS;
} }
static int static int aic7xxx_bus_device_reset(struct scsi_cmnd *cmd)
aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
{ {
int rc; int rc;
...@@ -10570,8 +10564,7 @@ aic7xxx_bus_device_reset(Scsi_Cmnd *cmd) ...@@ -10570,8 +10564,7 @@ aic7xxx_bus_device_reset(Scsi_Cmnd *cmd)
* Description: * Description:
* Abort the current SCSI command(s). * Abort the current SCSI command(s).
*-F*************************************************************************/ *-F*************************************************************************/
static void static void aic7xxx_panic_abort(struct aic7xxx_host *p, struct scsi_cmnd *cmd)
aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
{ {
printk("aic7xxx driver version %s\n", AIC7XXX_C_VERSION); printk("aic7xxx driver version %s\n", AIC7XXX_C_VERSION);
...@@ -10595,8 +10588,7 @@ aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd) ...@@ -10595,8 +10588,7 @@ aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
* Description: * Description:
* Abort the current SCSI command(s). * Abort the current SCSI command(s).
*-F*************************************************************************/ *-F*************************************************************************/
static int static int __aic7xxx_abort(struct scsi_cmnd *cmd)
__aic7xxx_abort(Scsi_Cmnd *cmd)
{ {
struct aic7xxx_scb *scb = NULL; struct aic7xxx_scb *scb = NULL;
struct aic7xxx_host *p; struct aic7xxx_host *p;
...@@ -10813,8 +10805,7 @@ __aic7xxx_abort(Scsi_Cmnd *cmd) ...@@ -10813,8 +10805,7 @@ __aic7xxx_abort(Scsi_Cmnd *cmd)
return SUCCESS; return SUCCESS;
} }
static int static int aic7xxx_abort(struct scsi_cmnd *cmd)
aic7xxx_abort(Scsi_Cmnd *cmd)
{ {
int rc; int rc;
...@@ -10836,8 +10827,7 @@ aic7xxx_abort(Scsi_Cmnd *cmd) ...@@ -10836,8 +10827,7 @@ aic7xxx_abort(Scsi_Cmnd *cmd)
* DEVICE RESET message - on the offending target before pulling * DEVICE RESET message - on the offending target before pulling
* the SCSI bus reset line. * the SCSI bus reset line.
*-F*************************************************************************/ *-F*************************************************************************/
static int static int aic7xxx_reset(struct scsi_cmnd *cmd)
aic7xxx_reset(Scsi_Cmnd *cmd)
{ {
struct aic7xxx_scb *scb; struct aic7xxx_scb *scb;
struct aic7xxx_host *p; struct aic7xxx_host *p;
......
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