Commit 1516b55d authored by Henne's avatar Henne Committed by James Bottomley

[SCSI] scsi: Convertion to struct scsi_cmnd in ips-driver

Converts the obsolete Scsi_Cmnd to struct scsi_cmnd in the ips-driver.
Signed-off-by: default avatarHenrik Kretzschmar <henne@nachtwindheim.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 8f6fd19f
...@@ -250,9 +250,9 @@ module_param(ips, charp, 0); ...@@ -250,9 +250,9 @@ module_param(ips, charp, 0);
*/ */
static int ips_detect(struct scsi_host_template *); static int ips_detect(struct scsi_host_template *);
static int ips_release(struct Scsi_Host *); static int ips_release(struct Scsi_Host *);
static int ips_eh_abort(Scsi_Cmnd *); static int ips_eh_abort(struct scsi_cmnd *);
static int ips_eh_reset(Scsi_Cmnd *); static int ips_eh_reset(struct scsi_cmnd *);
static int ips_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *)); static int ips_queue(struct scsi_cmnd *, void (*)(struct scsi_cmnd *));
static const char *ips_info(struct Scsi_Host *); static const char *ips_info(struct Scsi_Host *);
static irqreturn_t do_ipsintr(int, void *, struct pt_regs *); static irqreturn_t do_ipsintr(int, void *, struct pt_regs *);
static int ips_hainit(ips_ha_t *); static int ips_hainit(ips_ha_t *);
...@@ -325,24 +325,26 @@ static uint32_t ips_statupd_copperhead_memio(ips_ha_t *); ...@@ -325,24 +325,26 @@ static uint32_t ips_statupd_copperhead_memio(ips_ha_t *);
static uint32_t ips_statupd_morpheus(ips_ha_t *); static uint32_t ips_statupd_morpheus(ips_ha_t *);
static ips_scb_t *ips_getscb(ips_ha_t *); static ips_scb_t *ips_getscb(ips_ha_t *);
static void ips_putq_scb_head(ips_scb_queue_t *, ips_scb_t *); static void ips_putq_scb_head(ips_scb_queue_t *, ips_scb_t *);
static void ips_putq_wait_tail(ips_wait_queue_t *, Scsi_Cmnd *); static void ips_putq_wait_tail(ips_wait_queue_t *, struct scsi_cmnd *);
static void ips_putq_copp_tail(ips_copp_queue_t *, static void ips_putq_copp_tail(ips_copp_queue_t *,
ips_copp_wait_item_t *); ips_copp_wait_item_t *);
static ips_scb_t *ips_removeq_scb_head(ips_scb_queue_t *); static ips_scb_t *ips_removeq_scb_head(ips_scb_queue_t *);
static ips_scb_t *ips_removeq_scb(ips_scb_queue_t *, ips_scb_t *); static ips_scb_t *ips_removeq_scb(ips_scb_queue_t *, ips_scb_t *);
static Scsi_Cmnd *ips_removeq_wait_head(ips_wait_queue_t *); static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_t *);
static Scsi_Cmnd *ips_removeq_wait(ips_wait_queue_t *, Scsi_Cmnd *); static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_t *,
struct scsi_cmnd *);
static ips_copp_wait_item_t *ips_removeq_copp(ips_copp_queue_t *, static ips_copp_wait_item_t *ips_removeq_copp(ips_copp_queue_t *,
ips_copp_wait_item_t *); ips_copp_wait_item_t *);
static ips_copp_wait_item_t *ips_removeq_copp_head(ips_copp_queue_t *); static ips_copp_wait_item_t *ips_removeq_copp_head(ips_copp_queue_t *);
static int ips_is_passthru(Scsi_Cmnd *); static int ips_is_passthru(struct scsi_cmnd *);
static int ips_make_passthru(ips_ha_t *, Scsi_Cmnd *, ips_scb_t *, int); static int ips_make_passthru(ips_ha_t *, struct scsi_cmnd *, ips_scb_t *, int);
static int ips_usrcmd(ips_ha_t *, ips_passthru_t *, ips_scb_t *); static int ips_usrcmd(ips_ha_t *, ips_passthru_t *, ips_scb_t *);
static void ips_cleanup_passthru(ips_ha_t *, ips_scb_t *); static void ips_cleanup_passthru(ips_ha_t *, ips_scb_t *);
static void ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data, static void ips_scmd_buf_write(struct scsi_cmnd * scmd, void *data,
unsigned int count); unsigned int count);
static void ips_scmd_buf_read(Scsi_Cmnd * scmd, void *data, unsigned int count); static void ips_scmd_buf_read(struct scsi_cmnd * scmd, void *data,
unsigned int count);
static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
static int ips_host_info(ips_ha_t *, char *, off_t, int); static int ips_host_info(ips_ha_t *, char *, off_t, int);
...@@ -812,8 +814,7 @@ ips_halt(struct notifier_block *nb, ulong event, void *buf) ...@@ -812,8 +814,7 @@ ips_halt(struct notifier_block *nb, ulong event, void *buf)
/* Abort a command (using the new error code stuff) */ /* Abort a command (using the new error code stuff) */
/* Note: this routine is called under the io_request_lock */ /* Note: this routine is called under the io_request_lock */
/****************************************************************************/ /****************************************************************************/
int int ips_eh_abort(struct scsi_cmnd *SC)
ips_eh_abort(Scsi_Cmnd * SC)
{ {
ips_ha_t *ha; ips_ha_t *ha;
ips_copp_wait_item_t *item; ips_copp_wait_item_t *item;
...@@ -871,8 +872,7 @@ ips_eh_abort(Scsi_Cmnd * SC) ...@@ -871,8 +872,7 @@ ips_eh_abort(Scsi_Cmnd * SC)
/* NOTE: this routine is called under the io_request_lock spinlock */ /* NOTE: this routine is called under the io_request_lock spinlock */
/* */ /* */
/****************************************************************************/ /****************************************************************************/
static int static int __ips_eh_reset(struct scsi_cmnd *SC)
__ips_eh_reset(Scsi_Cmnd * SC)
{ {
int ret; int ret;
int i; int i;
...@@ -968,7 +968,7 @@ __ips_eh_reset(Scsi_Cmnd * SC) ...@@ -968,7 +968,7 @@ __ips_eh_reset(Scsi_Cmnd * SC)
ret = (*ha->func.reset) (ha); ret = (*ha->func.reset) (ha);
if (!ret) { if (!ret) {
Scsi_Cmnd *scsi_cmd; struct scsi_cmnd *scsi_cmd;
IPS_PRINTK(KERN_NOTICE, ha->pcidev, IPS_PRINTK(KERN_NOTICE, ha->pcidev,
"Controller reset failed - controller now offline.\n"); "Controller reset failed - controller now offline.\n");
...@@ -997,7 +997,7 @@ __ips_eh_reset(Scsi_Cmnd * SC) ...@@ -997,7 +997,7 @@ __ips_eh_reset(Scsi_Cmnd * SC)
} }
if (!ips_clear_adapter(ha, IPS_INTR_IORL)) { if (!ips_clear_adapter(ha, IPS_INTR_IORL)) {
Scsi_Cmnd *scsi_cmd; struct scsi_cmnd *scsi_cmd;
IPS_PRINTK(KERN_NOTICE, ha->pcidev, IPS_PRINTK(KERN_NOTICE, ha->pcidev,
"Controller reset failed - controller now offline.\n"); "Controller reset failed - controller now offline.\n");
...@@ -1059,8 +1059,7 @@ __ips_eh_reset(Scsi_Cmnd * SC) ...@@ -1059,8 +1059,7 @@ __ips_eh_reset(Scsi_Cmnd * SC)
} }
static int static int ips_eh_reset(struct scsi_cmnd *SC)
ips_eh_reset(Scsi_Cmnd * SC)
{ {
int rc; int rc;
...@@ -1083,8 +1082,7 @@ ips_eh_reset(Scsi_Cmnd * SC) ...@@ -1083,8 +1082,7 @@ ips_eh_reset(Scsi_Cmnd * SC)
/* Linux obtains io_request_lock before calling this function */ /* Linux obtains io_request_lock before calling this function */
/* */ /* */
/****************************************************************************/ /****************************************************************************/
static int static int ips_queue(struct scsi_cmnd *SC, void (*done) (struct scsi_cmnd *))
ips_queue(Scsi_Cmnd * SC, void (*done) (Scsi_Cmnd *))
{ {
ips_ha_t *ha; ips_ha_t *ha;
ips_passthru_t *pt; ips_passthru_t *pt;
...@@ -1602,8 +1600,7 @@ ips_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, ...@@ -1602,8 +1600,7 @@ ips_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
/* Determine if the specified SCSI command is really a passthru command */ /* Determine if the specified SCSI command is really a passthru command */
/* */ /* */
/****************************************************************************/ /****************************************************************************/
static int static int ips_is_passthru(struct scsi_cmnd *SC)
ips_is_passthru(Scsi_Cmnd * SC)
{ {
unsigned long flags; unsigned long flags;
...@@ -1685,7 +1682,7 @@ ips_alloc_passthru_buffer(ips_ha_t * ha, int length) ...@@ -1685,7 +1682,7 @@ ips_alloc_passthru_buffer(ips_ha_t * ha, int length)
/* */ /* */
/****************************************************************************/ /****************************************************************************/
static int static int
ips_make_passthru(ips_ha_t * ha, Scsi_Cmnd * SC, ips_scb_t * scb, int intr) ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr)
{ {
ips_passthru_t *pt; ips_passthru_t *pt;
int length = 0; int length = 0;
...@@ -2734,9 +2731,9 @@ static void ...@@ -2734,9 +2731,9 @@ static void
ips_next(ips_ha_t * ha, int intr) ips_next(ips_ha_t * ha, int intr)
{ {
ips_scb_t *scb; ips_scb_t *scb;
Scsi_Cmnd *SC; struct scsi_cmnd *SC;
Scsi_Cmnd *p; struct scsi_cmnd *p;
Scsi_Cmnd *q; struct scsi_cmnd *q;
ips_copp_wait_item_t *item; ips_copp_wait_item_t *item;
int ret; int ret;
unsigned long cpu_flags = 0; unsigned long cpu_flags = 0;
...@@ -2847,7 +2844,7 @@ ips_next(ips_ha_t * ha, int intr) ...@@ -2847,7 +2844,7 @@ ips_next(ips_ha_t * ha, int intr)
dcdb_active[scmd_channel(p) - dcdb_active[scmd_channel(p) -
1] & (1 << scmd_id(p)))) { 1] & (1 << scmd_id(p)))) {
ips_freescb(ha, scb); ips_freescb(ha, scb);
p = (Scsi_Cmnd *) p->host_scribble; p = (struct scsi_cmnd *) p->host_scribble;
continue; continue;
} }
...@@ -2962,7 +2959,7 @@ ips_next(ips_ha_t * ha, int intr) ...@@ -2962,7 +2959,7 @@ ips_next(ips_ha_t * ha, int intr)
break; break;
} /* end case */ } /* end case */
p = (Scsi_Cmnd *) p->host_scribble; p = (struct scsi_cmnd *) p->host_scribble;
} /* end while */ } /* end while */
...@@ -3090,8 +3087,7 @@ ips_removeq_scb(ips_scb_queue_t * queue, ips_scb_t * item) ...@@ -3090,8 +3087,7 @@ ips_removeq_scb(ips_scb_queue_t * queue, ips_scb_t * item)
/* ASSUMED to be called from within the HA lock */ /* ASSUMED to be called from within the HA lock */
/* */ /* */
/****************************************************************************/ /****************************************************************************/
static void static void ips_putq_wait_tail(ips_wait_queue_t *queue, struct scsi_cmnd *item)
ips_putq_wait_tail(ips_wait_queue_t * queue, Scsi_Cmnd * item)
{ {
METHOD_TRACE("ips_putq_wait_tail", 1); METHOD_TRACE("ips_putq_wait_tail", 1);
...@@ -3122,10 +3118,9 @@ ips_putq_wait_tail(ips_wait_queue_t * queue, Scsi_Cmnd * item) ...@@ -3122,10 +3118,9 @@ ips_putq_wait_tail(ips_wait_queue_t * queue, Scsi_Cmnd * item)
/* ASSUMED to be called from within the HA lock */ /* ASSUMED to be called from within the HA lock */
/* */ /* */
/****************************************************************************/ /****************************************************************************/
static Scsi_Cmnd * static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_t *queue)
ips_removeq_wait_head(ips_wait_queue_t * queue)
{ {
Scsi_Cmnd *item; struct scsi_cmnd *item;
METHOD_TRACE("ips_removeq_wait_head", 1); METHOD_TRACE("ips_removeq_wait_head", 1);
...@@ -3135,7 +3130,7 @@ ips_removeq_wait_head(ips_wait_queue_t * queue) ...@@ -3135,7 +3130,7 @@ ips_removeq_wait_head(ips_wait_queue_t * queue)
return (NULL); return (NULL);
} }
queue->head = (Scsi_Cmnd *) item->host_scribble; queue->head = (struct scsi_cmnd *) item->host_scribble;
item->host_scribble = NULL; item->host_scribble = NULL;
if (queue->tail == item) if (queue->tail == item)
...@@ -3157,10 +3152,10 @@ ips_removeq_wait_head(ips_wait_queue_t * queue) ...@@ -3157,10 +3152,10 @@ ips_removeq_wait_head(ips_wait_queue_t * queue)
/* ASSUMED to be called from within the HA lock */ /* ASSUMED to be called from within the HA lock */
/* */ /* */
/****************************************************************************/ /****************************************************************************/
static Scsi_Cmnd * static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_t *queue,
ips_removeq_wait(ips_wait_queue_t * queue, Scsi_Cmnd * item) struct scsi_cmnd *item)
{ {
Scsi_Cmnd *p; struct scsi_cmnd *p;
METHOD_TRACE("ips_removeq_wait", 1); METHOD_TRACE("ips_removeq_wait", 1);
...@@ -3173,8 +3168,8 @@ ips_removeq_wait(ips_wait_queue_t * queue, Scsi_Cmnd * item) ...@@ -3173,8 +3168,8 @@ ips_removeq_wait(ips_wait_queue_t * queue, Scsi_Cmnd * item)
p = queue->head; p = queue->head;
while ((p) && (item != (Scsi_Cmnd *) p->host_scribble)) while ((p) && (item != (struct scsi_cmnd *) p->host_scribble))
p = (Scsi_Cmnd *) p->host_scribble; p = (struct scsi_cmnd *) p->host_scribble;
if (p) { if (p) {
/* found a match */ /* found a match */
...@@ -3659,11 +3654,10 @@ ips_send_wait(ips_ha_t * ha, ips_scb_t * scb, int timeout, int intr) ...@@ -3659,11 +3654,10 @@ ips_send_wait(ips_ha_t * ha, ips_scb_t * scb, int timeout, int intr)
/* Routine Name: ips_scmd_buf_write */ /* Routine Name: ips_scmd_buf_write */
/* */ /* */
/* Routine Description: */ /* Routine Description: */
/* Write data to Scsi_Cmnd request_buffer at proper offsets */ /* Write data to struct scsi_cmnd request_buffer at proper offsets */
/****************************************************************************/ /****************************************************************************/
static void static void
ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data, unsigned ips_scmd_buf_write(struct scsi_cmnd *scmd, void *data, unsigned int count)
int count)
{ {
if (scmd->use_sg) { if (scmd->use_sg) {
int i; int i;
...@@ -3698,11 +3692,10 @@ ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data, unsigned ...@@ -3698,11 +3692,10 @@ ips_scmd_buf_write(Scsi_Cmnd * scmd, void *data, unsigned
/* Routine Name: ips_scmd_buf_read */ /* Routine Name: ips_scmd_buf_read */
/* */ /* */
/* Routine Description: */ /* Routine Description: */
/* Copy data from a Scsi_Cmnd to a new, linear buffer */ /* Copy data from a struct scsi_cmnd to a new, linear buffer */
/****************************************************************************/ /****************************************************************************/
static void static void
ips_scmd_buf_read(Scsi_Cmnd * scmd, void *data, unsigned ips_scmd_buf_read(struct scsi_cmnd *scmd, void *data, unsigned int count)
int count)
{ {
if (scmd->use_sg) { if (scmd->use_sg) {
int i; int i;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
/* David Jeffery, Adaptec, Inc. */ /* David Jeffery, Adaptec, Inc. */
/* */ /* */
/* Copyright (C) 1999 IBM Corporation */ /* Copyright (C) 1999 IBM Corporation */
/* Copyright (C) 2003 Adaptec, Inc. */ /* Copyright (C) 2003 Adaptec, Inc. */
/* */ /* */
/* This program is free software; you can redistribute it and/or modify */ /* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */ /* it under the terms of the GNU General Public License as published by */
...@@ -1033,14 +1033,14 @@ typedef struct ips_scb_queue { ...@@ -1033,14 +1033,14 @@ typedef struct ips_scb_queue {
* Wait queue_format * Wait queue_format
*/ */
typedef struct ips_wait_queue { typedef struct ips_wait_queue {
Scsi_Cmnd *head; struct scsi_cmnd *head;
Scsi_Cmnd *tail; struct scsi_cmnd *tail;
int count; int count;
} ips_wait_queue_t; } ips_wait_queue_t;
typedef struct ips_copp_wait_item { typedef struct ips_copp_wait_item {
Scsi_Cmnd *scsi_cmd; struct scsi_cmnd *scsi_cmd;
struct ips_copp_wait_item *next; struct ips_copp_wait_item *next;
} ips_copp_wait_item_t; } ips_copp_wait_item_t;
typedef struct ips_copp_queue { typedef struct ips_copp_queue {
...@@ -1149,7 +1149,7 @@ typedef struct ips_scb { ...@@ -1149,7 +1149,7 @@ typedef struct ips_scb {
uint32_t flags; uint32_t flags;
uint32_t op_code; uint32_t op_code;
IPS_SG_LIST sg_list; IPS_SG_LIST sg_list;
Scsi_Cmnd *scsi_cmd; struct scsi_cmnd *scsi_cmd;
struct ips_scb *q_next; struct ips_scb *q_next;
ips_scb_callback callback; ips_scb_callback callback;
uint32_t sg_busaddr; uint32_t sg_busaddr;
...@@ -1175,7 +1175,7 @@ typedef struct ips_scb_pt { ...@@ -1175,7 +1175,7 @@ typedef struct ips_scb_pt {
uint32_t flags; uint32_t flags;
uint32_t op_code; uint32_t op_code;
IPS_SG_LIST *sg_list; IPS_SG_LIST *sg_list;
Scsi_Cmnd *scsi_cmd; struct scsi_cmnd *scsi_cmd;
struct ips_scb *q_next; struct ips_scb *q_next;
ips_scb_callback callback; ips_scb_callback callback;
} ips_scb_pt_t; } ips_scb_pt_t;
......
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