aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/arm
diff options
context:
space:
mode:
authorHenne <henne@nachtwindheim.de>2006-10-01 07:18:37 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-10-03 18:28:33 -0400
commitee0ca6bab394fe41a2b4de58c4532b09a41c9165 (patch)
tree93a5e2879d276c471373deda924e0c8e91fae875 /drivers/scsi/arm
parent1516b55d903a5d370859d9013e48db5caea95204 (diff)
[SCSI] scsi: Scsi_Cmnd convertion in arm subtree
Changes the obsolete Scsi_Cmnd to struct scsi_cmnd in the arm subdir of the scsi-subsys. Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Acked-by: Russell King <rmk@arm.linux.org.uk> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/arm')
-rw-r--r--drivers/scsi/arm/acornscsi.c48
-rw-r--r--drivers/scsi/arm/acornscsi.h4
-rw-r--r--drivers/scsi/arm/fas216.c50
-rw-r--r--drivers/scsi/arm/fas216.h36
-rw-r--r--drivers/scsi/arm/queue.c37
-rw-r--r--drivers/scsi/arm/queue.h28
-rw-r--r--drivers/scsi/arm/scsi.h2
7 files changed, 108 insertions, 97 deletions
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index 7621e3fa37b..0525d672e1e 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -194,7 +194,8 @@
194unsigned int sdtr_period = SDTR_PERIOD; 194unsigned int sdtr_period = SDTR_PERIOD;
195unsigned int sdtr_size = SDTR_SIZE; 195unsigned int sdtr_size = SDTR_SIZE;
196 196
197static void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result); 197static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp,
198 unsigned int result);
198static int acornscsi_reconnect_finish(AS_Host *host); 199static int acornscsi_reconnect_finish(AS_Host *host);
199static void acornscsi_dma_cleanup(AS_Host *host); 200static void acornscsi_dma_cleanup(AS_Host *host);
200static void acornscsi_abortcmd(AS_Host *host, unsigned char tag); 201static void acornscsi_abortcmd(AS_Host *host, unsigned char tag);
@@ -712,7 +713,7 @@ static
712intr_ret_t acornscsi_kick(AS_Host *host) 713intr_ret_t acornscsi_kick(AS_Host *host)
713{ 714{
714 int from_queue = 0; 715 int from_queue = 0;
715 Scsi_Cmnd *SCpnt; 716 struct scsi_cmnd *SCpnt;
716 717
717 /* first check to see if a command is waiting to be executed */ 718 /* first check to see if a command is waiting to be executed */
718 SCpnt = host->origSCpnt; 719 SCpnt = host->origSCpnt;
@@ -796,15 +797,15 @@ intr_ret_t acornscsi_kick(AS_Host *host)
796} 797}
797 798
798/* 799/*
799 * Function: void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result) 800 * Function: void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp, unsigned int result)
800 * Purpose : complete processing for command 801 * Purpose : complete processing for command
801 * Params : host - interface that completed 802 * Params : host - interface that completed
802 * result - driver byte of result 803 * result - driver byte of result
803 */ 804 */
804static 805static void acornscsi_done(AS_Host *host, struct scsi_cmnd **SCpntp,
805void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result) 806 unsigned int result)
806{ 807{
807 Scsi_Cmnd *SCpnt = *SCpntp; 808 struct scsi_cmnd *SCpnt = *SCpntp;
808 809
809 /* clean up */ 810 /* clean up */
810 sbic_arm_write(host->scsi.io_port, SBIC_SOURCEID, SOURCEID_ER | SOURCEID_DSP); 811 sbic_arm_write(host->scsi.io_port, SBIC_SOURCEID, SOURCEID_ER | SOURCEID_DSP);
@@ -1318,7 +1319,7 @@ acornscsi_write_pio(AS_Host *host, char *bytes, int *ptr, int len, unsigned int
1318static void 1319static void
1319acornscsi_sendcommand(AS_Host *host) 1320acornscsi_sendcommand(AS_Host *host)
1320{ 1321{
1321 Scsi_Cmnd *SCpnt = host->SCpnt; 1322 struct scsi_cmnd *SCpnt = host->SCpnt;
1322 1323
1323 sbic_arm_write(host->scsi.io_port, SBIC_TRANSCNTH, 0); 1324 sbic_arm_write(host->scsi.io_port, SBIC_TRANSCNTH, 0);
1324 sbic_arm_writenext(host->scsi.io_port, 0); 1325 sbic_arm_writenext(host->scsi.io_port, 0);
@@ -1693,7 +1694,7 @@ void acornscsi_message(AS_Host *host)
1693 acornscsi_sbic_issuecmd(host, CMND_ASSERTATN); 1694 acornscsi_sbic_issuecmd(host, CMND_ASSERTATN);
1694 msgqueue_addmsg(&host->scsi.msgs, 1, ABORT); 1695 msgqueue_addmsg(&host->scsi.msgs, 1, ABORT);
1695 } else { 1696 } else {
1696 Scsi_Cmnd *SCpnt = host->SCpnt; 1697 struct scsi_cmnd *SCpnt = host->SCpnt;
1697 1698
1698 acornscsi_dma_cleanup(host); 1699 acornscsi_dma_cleanup(host);
1699 1700
@@ -2509,13 +2510,14 @@ acornscsi_intr(int irq, void *dev_id, struct pt_regs *regs)
2509 */ 2510 */
2510 2511
2511/* 2512/*
2512 * Function : acornscsi_queuecmd(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) 2513 * Function : acornscsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
2513 * Purpose : queues a SCSI command 2514 * Purpose : queues a SCSI command
2514 * Params : cmd - SCSI command 2515 * Params : cmd - SCSI command
2515 * done - function called on completion, with pointer to command descriptor 2516 * done - function called on completion, with pointer to command descriptor
2516 * Returns : 0, or < 0 on error. 2517 * Returns : 0, or < 0 on error.
2517 */ 2518 */
2518int acornscsi_queuecmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 2519int acornscsi_queuecmd(struct scsi_cmnd *SCpnt,
2520 void (*done)(struct scsi_cmnd *))
2519{ 2521{
2520 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; 2522 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
2521 2523
@@ -2565,17 +2567,18 @@ int acornscsi_queuecmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
2565} 2567}
2566 2568
2567/* 2569/*
2568 * Prototype: void acornscsi_reportstatus(Scsi_Cmnd **SCpntp1, Scsi_Cmnd **SCpntp2, int result) 2570 * Prototype: void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1, struct scsi_cmnd **SCpntp2, int result)
2569 * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2 2571 * Purpose : pass a result to *SCpntp1, and check if *SCpntp1 = *SCpntp2
2570 * Params : SCpntp1 - pointer to command to return 2572 * Params : SCpntp1 - pointer to command to return
2571 * SCpntp2 - pointer to command to check 2573 * SCpntp2 - pointer to command to check
2572 * result - result to pass back to mid-level done function 2574 * result - result to pass back to mid-level done function
2573 * Returns : *SCpntp2 = NULL if *SCpntp1 is the same command structure as *SCpntp2. 2575 * Returns : *SCpntp2 = NULL if *SCpntp1 is the same command structure as *SCpntp2.
2574 */ 2576 */
2575static inline 2577static inline void acornscsi_reportstatus(struct scsi_cmnd **SCpntp1,
2576void acornscsi_reportstatus(Scsi_Cmnd **SCpntp1, Scsi_Cmnd **SCpntp2, int result) 2578 struct scsi_cmnd **SCpntp2,
2579 int result)
2577{ 2580{
2578 Scsi_Cmnd *SCpnt = *SCpntp1; 2581 struct scsi_cmnd *SCpnt = *SCpntp1;
2579 2582
2580 if (SCpnt) { 2583 if (SCpnt) {
2581 *SCpntp1 = NULL; 2584 *SCpntp1 = NULL;
@@ -2591,13 +2594,12 @@ void acornscsi_reportstatus(Scsi_Cmnd **SCpntp1, Scsi_Cmnd **SCpntp2, int result
2591enum res_abort { res_not_running, res_success, res_success_clear, res_snooze }; 2594enum res_abort { res_not_running, res_success, res_success_clear, res_snooze };
2592 2595
2593/* 2596/*
2594 * Prototype: enum res acornscsi_do_abort(Scsi_Cmnd *SCpnt) 2597 * Prototype: enum res acornscsi_do_abort(struct scsi_cmnd *SCpnt)
2595 * Purpose : abort a command on this host 2598 * Purpose : abort a command on this host
2596 * Params : SCpnt - command to abort 2599 * Params : SCpnt - command to abort
2597 * Returns : our abort status 2600 * Returns : our abort status
2598 */ 2601 */
2599static enum res_abort 2602static enum res_abort acornscsi_do_abort(AS_Host *host, struct scsi_cmnd *SCpnt)
2600acornscsi_do_abort(AS_Host *host, Scsi_Cmnd *SCpnt)
2601{ 2603{
2602 enum res_abort res = res_not_running; 2604 enum res_abort res = res_not_running;
2603 2605
@@ -2684,12 +2686,12 @@ acornscsi_do_abort(AS_Host *host, Scsi_Cmnd *SCpnt)
2684} 2686}
2685 2687
2686/* 2688/*
2687 * Prototype: int acornscsi_abort(Scsi_Cmnd *SCpnt) 2689 * Prototype: int acornscsi_abort(struct scsi_cmnd *SCpnt)
2688 * Purpose : abort a command on this host 2690 * Purpose : abort a command on this host
2689 * Params : SCpnt - command to abort 2691 * Params : SCpnt - command to abort
2690 * Returns : one of SCSI_ABORT_ macros 2692 * Returns : one of SCSI_ABORT_ macros
2691 */ 2693 */
2692int acornscsi_abort(Scsi_Cmnd *SCpnt) 2694int acornscsi_abort(struct scsi_cmnd *SCpnt)
2693{ 2695{
2694 AS_Host *host = (AS_Host *) SCpnt->device->host->hostdata; 2696 AS_Host *host = (AS_Host *) SCpnt->device->host->hostdata;
2695 int result; 2697 int result;
@@ -2770,16 +2772,16 @@ int acornscsi_abort(Scsi_Cmnd *SCpnt)
2770} 2772}
2771 2773
2772/* 2774/*
2773 * Prototype: int acornscsi_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) 2775 * Prototype: int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags)
2774 * Purpose : reset a command on this host/reset this host 2776 * Purpose : reset a command on this host/reset this host
2775 * Params : SCpnt - command causing reset 2777 * Params : SCpnt - command causing reset
2776 * result - what type of reset to perform 2778 * result - what type of reset to perform
2777 * Returns : one of SCSI_RESET_ macros 2779 * Returns : one of SCSI_RESET_ macros
2778 */ 2780 */
2779int acornscsi_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags) 2781int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags)
2780{ 2782{
2781 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata; 2783 AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
2782 Scsi_Cmnd *SCptr; 2784 struct scsi_cmnd *SCptr;
2783 2785
2784 host->stats.resets += 1; 2786 host->stats.resets += 1;
2785 2787
diff --git a/drivers/scsi/arm/acornscsi.h b/drivers/scsi/arm/acornscsi.h
index 2142290f840..d11424b89f4 100644
--- a/drivers/scsi/arm/acornscsi.h
+++ b/drivers/scsi/arm/acornscsi.h
@@ -277,8 +277,8 @@ struct status_entry {
277typedef struct acornscsi_hostdata { 277typedef struct acornscsi_hostdata {
278 /* miscellaneous */ 278 /* miscellaneous */
279 struct Scsi_Host *host; /* host */ 279 struct Scsi_Host *host; /* host */
280 Scsi_Cmnd *SCpnt; /* currently processing command */ 280 struct scsi_cmnd *SCpnt; /* currently processing command */
281 Scsi_Cmnd *origSCpnt; /* original connecting command */ 281 struct scsi_cmnd *origSCpnt; /* original connecting command */
282 282
283 /* driver information */ 283 /* driver information */
284 struct { 284 struct {
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 4cf7afc31cc..e05f0c2fc91 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -297,8 +297,8 @@ fas216_do_log(FAS216_Info *info, char target, char *fmt, va_list ap)
297 printk("scsi%d.%c: %s", info->host->host_no, target, buf); 297 printk("scsi%d.%c: %s", info->host->host_no, target, buf);
298} 298}
299 299
300static void 300static void fas216_log_command(FAS216_Info *info, int level,
301fas216_log_command(FAS216_Info *info, int level, Scsi_Cmnd *SCpnt, char *fmt, ...) 301 struct scsi_cmnd *SCpnt, char *fmt, ...)
302{ 302{
303 va_list args; 303 va_list args;
304 304
@@ -1662,7 +1662,7 @@ irqreturn_t fas216_intr(FAS216_Info *info)
1662 return handled; 1662 return handled;
1663} 1663}
1664 1664
1665static void __fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) 1665static void __fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt)
1666{ 1666{
1667 int tot_msglen; 1667 int tot_msglen;
1668 1668
@@ -1754,7 +1754,7 @@ static int parity_test(FAS216_Info *info, int target)
1754 return info->device[target].parity_check; 1754 return info->device[target].parity_check;
1755} 1755}
1756 1756
1757static void fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) 1757static void fas216_start_command(FAS216_Info *info, struct scsi_cmnd *SCpnt)
1758{ 1758{
1759 int disconnect_ok; 1759 int disconnect_ok;
1760 1760
@@ -1808,7 +1808,7 @@ static void fas216_start_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
1808 __fas216_start_command(info, SCpnt); 1808 __fas216_start_command(info, SCpnt);
1809} 1809}
1810 1810
1811static void fas216_allocate_tag(FAS216_Info *info, Scsi_Cmnd *SCpnt) 1811static void fas216_allocate_tag(FAS216_Info *info, struct scsi_cmnd *SCpnt)
1812{ 1812{
1813#ifdef SCSI2_TAG 1813#ifdef SCSI2_TAG
1814 /* 1814 /*
@@ -1842,7 +1842,8 @@ static void fas216_allocate_tag(FAS216_Info *info, Scsi_Cmnd *SCpnt)
1842 } 1842 }
1843} 1843}
1844 1844
1845static void fas216_do_bus_device_reset(FAS216_Info *info, Scsi_Cmnd *SCpnt) 1845static void fas216_do_bus_device_reset(FAS216_Info *info,
1846 struct scsi_cmnd *SCpnt)
1846{ 1847{
1847 struct message *msg; 1848 struct message *msg;
1848 1849
@@ -1890,7 +1891,7 @@ static void fas216_do_bus_device_reset(FAS216_Info *info, Scsi_Cmnd *SCpnt)
1890 */ 1891 */
1891static void fas216_kick(FAS216_Info *info) 1892static void fas216_kick(FAS216_Info *info)
1892{ 1893{
1893 Scsi_Cmnd *SCpnt = NULL; 1894 struct scsi_cmnd *SCpnt = NULL;
1894#define TYPE_OTHER 0 1895#define TYPE_OTHER 0
1895#define TYPE_RESET 1 1896#define TYPE_RESET 1
1896#define TYPE_QUEUE 2 1897#define TYPE_QUEUE 2
@@ -1978,8 +1979,8 @@ static void fas216_kick(FAS216_Info *info)
1978/* 1979/*
1979 * Clean up from issuing a BUS DEVICE RESET message to a device. 1980 * Clean up from issuing a BUS DEVICE RESET message to a device.
1980 */ 1981 */
1981static void 1982static void fas216_devicereset_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,
1982fas216_devicereset_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) 1983 unsigned int result)
1983{ 1984{
1984 fas216_log(info, LOG_ERROR, "fas216 device reset complete"); 1985 fas216_log(info, LOG_ERROR, "fas216 device reset complete");
1985 1986
@@ -1996,8 +1997,8 @@ fas216_devicereset_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result
1996 * 1997 *
1997 * Finish processing automatic request sense command 1998 * Finish processing automatic request sense command
1998 */ 1999 */
1999static void 2000static void fas216_rq_sns_done(FAS216_Info *info, struct scsi_cmnd *SCpnt,
2000fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) 2001 unsigned int result)
2001{ 2002{
2002 fas216_log_target(info, LOG_CONNECT, SCpnt->device->id, 2003 fas216_log_target(info, LOG_CONNECT, SCpnt->device->id,
2003 "request sense complete, result=0x%04x%02x%02x", 2004 "request sense complete, result=0x%04x%02x%02x",
@@ -2030,7 +2031,7 @@ fas216_rq_sns_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
2030 * Finish processing of standard command 2031 * Finish processing of standard command
2031 */ 2032 */
2032static void 2033static void
2033fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) 2034fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
2034{ 2035{
2035 info->stats.fins += 1; 2036 info->stats.fins += 1;
2036 2037
@@ -2142,8 +2143,8 @@ request_sense:
2142 */ 2143 */
2143static void fas216_done(FAS216_Info *info, unsigned int result) 2144static void fas216_done(FAS216_Info *info, unsigned int result)
2144{ 2145{
2145 void (*fn)(FAS216_Info *, Scsi_Cmnd *, unsigned int); 2146 void (*fn)(FAS216_Info *, struct scsi_cmnd *, unsigned int);
2146 Scsi_Cmnd *SCpnt; 2147 struct scsi_cmnd *SCpnt;
2147 unsigned long flags; 2148 unsigned long flags;
2148 2149
2149 fas216_checkmagic(info); 2150 fas216_checkmagic(info);
@@ -2182,7 +2183,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result)
2182 info->device[SCpnt->device->id].parity_check = 0; 2183 info->device[SCpnt->device->id].parity_check = 0;
2183 clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns); 2184 clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns);
2184 2185
2185 fn = (void (*)(FAS216_Info *, Scsi_Cmnd *, unsigned int))SCpnt->host_scribble; 2186 fn = (void (*)(FAS216_Info *, struct scsi_cmnd *, unsigned int))SCpnt->host_scribble;
2186 fn(info, SCpnt, result); 2187 fn(info, SCpnt, result);
2187 2188
2188 if (info->scsi.irq != NO_IRQ) { 2189 if (info->scsi.irq != NO_IRQ) {
@@ -2207,7 +2208,8 @@ no_command:
2207 * Returns: 0 on success, else error. 2208 * Returns: 0 on success, else error.
2208 * Notes: io_request_lock is held, interrupts are disabled. 2209 * Notes: io_request_lock is held, interrupts are disabled.
2209 */ 2210 */
2210int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 2211int fas216_queue_command(struct scsi_cmnd *SCpnt,
2212 void (*done)(struct scsi_cmnd *))
2211{ 2213{
2212 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2214 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2213 int result; 2215 int result;
@@ -2254,7 +2256,7 @@ int fas216_queue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
2254 * 2256 *
2255 * Trigger restart of a waiting thread in fas216_command 2257 * Trigger restart of a waiting thread in fas216_command
2256 */ 2258 */
2257static void fas216_internal_done(Scsi_Cmnd *SCpnt) 2259static void fas216_internal_done(struct scsi_cmnd *SCpnt)
2258{ 2260{
2259 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2261 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2260 2262
@@ -2271,7 +2273,8 @@ static void fas216_internal_done(Scsi_Cmnd *SCpnt)
2271 * Returns: scsi result code. 2273 * Returns: scsi result code.
2272 * Notes: io_request_lock is held, interrupts are disabled. 2274 * Notes: io_request_lock is held, interrupts are disabled.
2273 */ 2275 */
2274int fas216_noqueue_command(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 2276int fas216_noqueue_command(struct scsi_cmnd *SCpnt,
2277 void (*done)(struct scsi_cmnd *))
2275{ 2278{
2276 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2279 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2277 2280
@@ -2350,7 +2353,8 @@ enum res_find {
2350 * Decide how to abort a command. 2353 * Decide how to abort a command.
2351 * Returns: abort status 2354 * Returns: abort status
2352 */ 2355 */
2353static enum res_find fas216_find_command(FAS216_Info *info, Scsi_Cmnd *SCpnt) 2356static enum res_find fas216_find_command(FAS216_Info *info,
2357 struct scsi_cmnd *SCpnt)
2354{ 2358{
2355 enum res_find res = res_failed; 2359 enum res_find res = res_failed;
2356 2360
@@ -2417,7 +2421,7 @@ static enum res_find fas216_find_command(FAS216_Info *info, Scsi_Cmnd *SCpnt)
2417 * Returns: FAILED if unable to abort 2421 * Returns: FAILED if unable to abort
2418 * Notes: io_request_lock is taken, and irqs are disabled 2422 * Notes: io_request_lock is taken, and irqs are disabled
2419 */ 2423 */
2420int fas216_eh_abort(Scsi_Cmnd *SCpnt) 2424int fas216_eh_abort(struct scsi_cmnd *SCpnt)
2421{ 2425{
2422 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2426 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2423 int result = FAILED; 2427 int result = FAILED;
@@ -2474,7 +2478,7 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt)
2474 * Notes: We won't be re-entered, so we'll only have one device 2478 * Notes: We won't be re-entered, so we'll only have one device
2475 * reset on the go at one time. 2479 * reset on the go at one time.
2476 */ 2480 */
2477int fas216_eh_device_reset(Scsi_Cmnd *SCpnt) 2481int fas216_eh_device_reset(struct scsi_cmnd *SCpnt)
2478{ 2482{
2479 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2483 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2480 unsigned long flags; 2484 unsigned long flags;
@@ -2555,7 +2559,7 @@ int fas216_eh_device_reset(Scsi_Cmnd *SCpnt)
2555 * Returns: FAILED if unable to reset. 2559 * Returns: FAILED if unable to reset.
2556 * Notes: Further commands are blocked. 2560 * Notes: Further commands are blocked.
2557 */ 2561 */
2558int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt) 2562int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt)
2559{ 2563{
2560 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2564 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2561 unsigned long flags; 2565 unsigned long flags;
@@ -2655,7 +2659,7 @@ static void fas216_init_chip(FAS216_Info *info)
2655 * Returns: FAILED if unable to reset. 2659 * Returns: FAILED if unable to reset.
2656 * Notes: io_request_lock is taken, and irqs are disabled 2660 * Notes: io_request_lock is taken, and irqs are disabled
2657 */ 2661 */
2658int fas216_eh_host_reset(Scsi_Cmnd *SCpnt) 2662int fas216_eh_host_reset(struct scsi_cmnd *SCpnt)
2659{ 2663{
2660 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata; 2664 FAS216_Info *info = (FAS216_Info *)SCpnt->device->host->hostdata;
2661 2665
diff --git a/drivers/scsi/arm/fas216.h b/drivers/scsi/arm/fas216.h
index 540914d6fd3..00e5f055afd 100644
--- a/drivers/scsi/arm/fas216.h
+++ b/drivers/scsi/arm/fas216.h
@@ -218,11 +218,11 @@ typedef struct {
218 unsigned long magic_start; 218 unsigned long magic_start;
219 spinlock_t host_lock; 219 spinlock_t host_lock;
220 struct Scsi_Host *host; /* host */ 220 struct Scsi_Host *host; /* host */
221 Scsi_Cmnd *SCpnt; /* currently processing command */ 221 struct scsi_cmnd *SCpnt; /* currently processing command */
222 Scsi_Cmnd *origSCpnt; /* original connecting command */ 222 struct scsi_cmnd *origSCpnt; /* original connecting command */
223 Scsi_Cmnd *reqSCpnt; /* request sense command */ 223 struct scsi_cmnd *reqSCpnt; /* request sense command */
224 Scsi_Cmnd *rstSCpnt; /* reset command */ 224 struct scsi_cmnd *rstSCpnt; /* reset command */
225 Scsi_Cmnd *pending_SCpnt[8]; /* per-device pending commands */ 225 struct scsi_cmnd *pending_SCpnt[8]; /* per-device pending commands */
226 int next_pending; /* next pending device */ 226 int next_pending; /* next pending device */
227 227
228 /* 228 /*
@@ -328,21 +328,23 @@ extern int fas216_init (struct Scsi_Host *instance);
328 */ 328 */
329extern int fas216_add (struct Scsi_Host *instance, struct device *dev); 329extern int fas216_add (struct Scsi_Host *instance, struct device *dev);
330 330
331/* Function: int fas216_queue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 331/* Function: int fas216_queue_command(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
332 * Purpose : queue a command for adapter to process. 332 * Purpose : queue a command for adapter to process.
333 * Params : SCpnt - Command to queue 333 * Params : SCpnt - Command to queue
334 * done - done function to call once command is complete 334 * done - done function to call once command is complete
335 * Returns : 0 - success, else error 335 * Returns : 0 - success, else error
336 */ 336 */
337extern int fas216_queue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 337extern int fas216_queue_command(struct scsi_cmnd *,
338 void (*done)(struct scsi_cmnd *));
338 339
339/* Function: int fas216_noqueue_command (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 340/* Function: int fas216_noqueue_command(istruct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
340 * Purpose : queue a command for adapter to process, and process it to completion. 341 * Purpose : queue a command for adapter to process, and process it to completion.
341 * Params : SCpnt - Command to queue 342 * Params : SCpnt - Command to queue
342 * done - done function to call once command is complete 343 * done - done function to call once command is complete
343 * Returns : 0 - success, else error 344 * Returns : 0 - success, else error
344 */ 345 */
345extern int fas216_noqueue_command (Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); 346extern int fas216_noqueue_command(struct scsi_cmnd *,
347 void (*done)(struct scsi_cmnd *));
346 348
347/* Function: irqreturn_t fas216_intr (FAS216_Info *info) 349/* Function: irqreturn_t fas216_intr (FAS216_Info *info)
348 * Purpose : handle interrupts from the interface to progress a command 350 * Purpose : handle interrupts from the interface to progress a command
@@ -363,32 +365,32 @@ extern int fas216_print_host(FAS216_Info *info, char *buffer);
363extern int fas216_print_stats(FAS216_Info *info, char *buffer); 365extern int fas216_print_stats(FAS216_Info *info, char *buffer);
364extern int fas216_print_devices(FAS216_Info *info, char *buffer); 366extern int fas216_print_devices(FAS216_Info *info, char *buffer);
365 367
366/* Function: int fas216_eh_abort(Scsi_Cmnd *SCpnt) 368/* Function: int fas216_eh_abort(struct scsi_cmnd *SCpnt)
367 * Purpose : abort this command 369 * Purpose : abort this command
368 * Params : SCpnt - command to abort 370 * Params : SCpnt - command to abort
369 * Returns : FAILED if unable to abort 371 * Returns : FAILED if unable to abort
370 */ 372 */
371extern int fas216_eh_abort(Scsi_Cmnd *SCpnt); 373extern int fas216_eh_abort(struct scsi_cmnd *SCpnt);
372 374
373/* Function: int fas216_eh_device_reset(Scsi_Cmnd *SCpnt) 375/* Function: int fas216_eh_device_reset(struct scsi_cmnd *SCpnt)
374 * Purpose : Reset the device associated with this command 376 * Purpose : Reset the device associated with this command
375 * Params : SCpnt - command specifing device to reset 377 * Params : SCpnt - command specifing device to reset
376 * Returns : FAILED if unable to reset 378 * Returns : FAILED if unable to reset
377 */ 379 */
378extern int fas216_eh_device_reset(Scsi_Cmnd *SCpnt); 380extern int fas216_eh_device_reset(struct scsi_cmnd *SCpnt);
379 381
380/* Function: int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt) 382/* Function: int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt)
381 * Purpose : Reset the complete bus associated with this command 383 * Purpose : Reset the complete bus associated with this command
382 * Params : SCpnt - command specifing bus to reset 384 * Params : SCpnt - command specifing bus to reset
383 * Returns : FAILED if unable to reset 385 * Returns : FAILED if unable to reset
384 */ 386 */
385extern int fas216_eh_bus_reset(Scsi_Cmnd *SCpnt); 387extern int fas216_eh_bus_reset(struct scsi_cmnd *SCpnt);
386 388
387/* Function: int fas216_eh_host_reset(Scsi_Cmnd *SCpnt) 389/* Function: int fas216_eh_host_reset(struct scsi_cmnd *SCpnt)
388 * Purpose : Reset the host associated with this command 390 * Purpose : Reset the host associated with this command
389 * Params : SCpnt - command specifing host to reset 391 * Params : SCpnt - command specifing host to reset
390 * Returns : FAILED if unable to reset 392 * Returns : FAILED if unable to reset
391 */ 393 */
392extern int fas216_eh_host_reset(Scsi_Cmnd *SCpnt); 394extern int fas216_eh_host_reset(struct scsi_cmnd *SCpnt);
393 395
394#endif /* FAS216_H */ 396#endif /* FAS216_H */
diff --git a/drivers/scsi/arm/queue.c b/drivers/scsi/arm/queue.c
index 8caa5903ce3..cb11ccef54e 100644
--- a/drivers/scsi/arm/queue.c
+++ b/drivers/scsi/arm/queue.c
@@ -29,7 +29,7 @@
29 29
30typedef struct queue_entry { 30typedef struct queue_entry {
31 struct list_head list; 31 struct list_head list;
32 Scsi_Cmnd *SCpnt; 32 struct scsi_cmnd *SCpnt;
33#ifdef DEBUG 33#ifdef DEBUG
34 unsigned long magic; 34 unsigned long magic;
35#endif 35#endif
@@ -96,14 +96,14 @@ void queue_free (Queue_t *queue)
96 96
97 97
98/* 98/*
99 * Function: int queue_add_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) 99 * Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head)
100 * Purpose : Add a new command onto a queue, adding REQUEST_SENSE to head. 100 * Purpose : Add a new command onto a queue, adding REQUEST_SENSE to head.
101 * Params : queue - destination queue 101 * Params : queue - destination queue
102 * SCpnt - command to add 102 * SCpnt - command to add
103 * head - add command to head of queue 103 * head - add command to head of queue
104 * Returns : 0 on error, !0 on success 104 * Returns : 0 on error, !0 on success
105 */ 105 */
106int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) 106int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head)
107{ 107{
108 unsigned long flags; 108 unsigned long flags;
109 struct list_head *l; 109 struct list_head *l;
@@ -134,7 +134,7 @@ empty:
134 return ret; 134 return ret;
135} 135}
136 136
137static Scsi_Cmnd *__queue_remove(Queue_t *queue, struct list_head *ent) 137static struct scsi_cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
138{ 138{
139 QE_t *q; 139 QE_t *q;
140 140
@@ -152,17 +152,17 @@ static Scsi_Cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
152} 152}
153 153
154/* 154/*
155 * Function: Scsi_Cmnd *queue_remove_exclude (queue, exclude) 155 * Function: struct scsi_cmnd *queue_remove_exclude (queue, exclude)
156 * Purpose : remove a SCSI command from a queue 156 * Purpose : remove a SCSI command from a queue
157 * Params : queue - queue to remove command from 157 * Params : queue - queue to remove command from
158 * exclude - bit array of target&lun which is busy 158 * exclude - bit array of target&lun which is busy
159 * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 159 * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
160 */ 160 */
161Scsi_Cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude) 161struct scsi_cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
162{ 162{
163 unsigned long flags; 163 unsigned long flags;
164 struct list_head *l; 164 struct list_head *l;
165 Scsi_Cmnd *SCpnt = NULL; 165 struct scsi_cmnd *SCpnt = NULL;
166 166
167 spin_lock_irqsave(&queue->queue_lock, flags); 167 spin_lock_irqsave(&queue->queue_lock, flags);
168 list_for_each(l, &queue->head) { 168 list_for_each(l, &queue->head) {
@@ -178,15 +178,15 @@ Scsi_Cmnd *queue_remove_exclude(Queue_t *queue, unsigned long *exclude)
178} 178}
179 179
180/* 180/*
181 * Function: Scsi_Cmnd *queue_remove (queue) 181 * Function: struct scsi_cmnd *queue_remove (queue)
182 * Purpose : removes first SCSI command from a queue 182 * Purpose : removes first SCSI command from a queue
183 * Params : queue - queue to remove command from 183 * Params : queue - queue to remove command from
184 * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 184 * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
185 */ 185 */
186Scsi_Cmnd *queue_remove(Queue_t *queue) 186struct scsi_cmnd *queue_remove(Queue_t *queue)
187{ 187{
188 unsigned long flags; 188 unsigned long flags;
189 Scsi_Cmnd *SCpnt = NULL; 189 struct scsi_cmnd *SCpnt = NULL;
190 190
191 spin_lock_irqsave(&queue->queue_lock, flags); 191 spin_lock_irqsave(&queue->queue_lock, flags);
192 if (!list_empty(&queue->head)) 192 if (!list_empty(&queue->head))
@@ -197,19 +197,20 @@ Scsi_Cmnd *queue_remove(Queue_t *queue)
197} 197}
198 198
199/* 199/*
200 * Function: Scsi_Cmnd *queue_remove_tgtluntag (queue, target, lun, tag) 200 * Function: struct scsi_cmnd *queue_remove_tgtluntag (queue, target, lun, tag)
201 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag 201 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag
202 * Params : queue - queue to remove command from 202 * Params : queue - queue to remove command from
203 * target - target that we want 203 * target - target that we want
204 * lun - lun on device 204 * lun - lun on device
205 * tag - tag on device 205 * tag - tag on device
206 * Returns : Scsi_Cmnd if successful, or NULL if no command satisfies requirements 206 * Returns : struct scsi_cmnd if successful, or NULL if no command satisfies requirements
207 */ 207 */
208Scsi_Cmnd *queue_remove_tgtluntag (Queue_t *queue, int target, int lun, int tag) 208struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target, int lun,
209 int tag)
209{ 210{
210 unsigned long flags; 211 unsigned long flags;
211 struct list_head *l; 212 struct list_head *l;
212 Scsi_Cmnd *SCpnt = NULL; 213 struct scsi_cmnd *SCpnt = NULL;
213 214
214 spin_lock_irqsave(&queue->queue_lock, flags); 215 spin_lock_irqsave(&queue->queue_lock, flags);
215 list_for_each(l, &queue->head) { 216 list_for_each(l, &queue->head) {
@@ -275,13 +276,13 @@ int queue_probetgtlun (Queue_t *queue, int target, int lun)
275} 276}
276 277
277/* 278/*
278 * Function: int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt) 279 * Function: int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
279 * Purpose : remove a specific command from the queues 280 * Purpose : remove a specific command from the queues
280 * Params : queue - queue to look in 281 * Params : queue - queue to look in
281 * SCpnt - command to find 282 * SCpnt - command to find
282 * Returns : 0 if not found 283 * Returns : 0 if not found
283 */ 284 */
284int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt) 285int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt)
285{ 286{
286 unsigned long flags; 287 unsigned long flags;
287 struct list_head *l; 288 struct list_head *l;
diff --git a/drivers/scsi/arm/queue.h b/drivers/scsi/arm/queue.h
index 0c9dec4c171..3c519c9237b 100644
--- a/drivers/scsi/arm/queue.h
+++ b/drivers/scsi/arm/queue.h
@@ -32,46 +32,48 @@ extern int queue_initialise (Queue_t *queue);
32extern void queue_free (Queue_t *queue); 32extern void queue_free (Queue_t *queue);
33 33
34/* 34/*
35 * Function: Scsi_Cmnd *queue_remove (queue) 35 * Function: struct scsi_cmnd *queue_remove (queue)
36 * Purpose : removes first SCSI command from a queue 36 * Purpose : removes first SCSI command from a queue
37 * Params : queue - queue to remove command from 37 * Params : queue - queue to remove command from
38 * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 38 * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
39 */ 39 */
40extern Scsi_Cmnd *queue_remove (Queue_t *queue); 40extern struct scsi_cmnd *queue_remove (Queue_t *queue);
41 41
42/* 42/*
43 * Function: Scsi_Cmnd *queue_remove_exclude_ref (queue, exclude) 43 * Function: struct scsi_cmnd *queue_remove_exclude_ref (queue, exclude)
44 * Purpose : remove a SCSI command from a queue 44 * Purpose : remove a SCSI command from a queue
45 * Params : queue - queue to remove command from 45 * Params : queue - queue to remove command from
46 * exclude - array of busy LUNs 46 * exclude - array of busy LUNs
47 * Returns : Scsi_Cmnd if successful (and a reference), or NULL if no command available 47 * Returns : struct scsi_cmnd if successful (and a reference), or NULL if no command available
48 */ 48 */
49extern Scsi_Cmnd *queue_remove_exclude (Queue_t *queue, unsigned long *exclude); 49extern struct scsi_cmnd *queue_remove_exclude(Queue_t *queue,
50 unsigned long *exclude);
50 51
51#define queue_add_cmd_ordered(queue,SCpnt) \ 52#define queue_add_cmd_ordered(queue,SCpnt) \
52 __queue_add(queue,SCpnt,(SCpnt)->cmnd[0] == REQUEST_SENSE) 53 __queue_add(queue,SCpnt,(SCpnt)->cmnd[0] == REQUEST_SENSE)
53#define queue_add_cmd_tail(queue,SCpnt) \ 54#define queue_add_cmd_tail(queue,SCpnt) \
54 __queue_add(queue,SCpnt,0) 55 __queue_add(queue,SCpnt,0)
55/* 56/*
56 * Function: int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head) 57 * Function: int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head)
57 * Purpose : Add a new command onto a queue 58 * Purpose : Add a new command onto a queue
58 * Params : queue - destination queue 59 * Params : queue - destination queue
59 * SCpnt - command to add 60 * SCpnt - command to add
60 * head - add command to head of queue 61 * head - add command to head of queue
61 * Returns : 0 on error, !0 on success 62 * Returns : 0 on error, !0 on success
62 */ 63 */
63extern int __queue_add(Queue_t *queue, Scsi_Cmnd *SCpnt, int head); 64extern int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head);
64 65
65/* 66/*
66 * Function: Scsi_Cmnd *queue_remove_tgtluntag (queue, target, lun, tag) 67 * Function: struct scsi_cmnd *queue_remove_tgtluntag (queue, target, lun, tag)
67 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag 68 * Purpose : remove a SCSI command from the queue for a specified target/lun/tag
68 * Params : queue - queue to remove command from 69 * Params : queue - queue to remove command from
69 * target - target that we want 70 * target - target that we want
70 * lun - lun on device 71 * lun - lun on device
71 * tag - tag on device 72 * tag - tag on device
72 * Returns : Scsi_Cmnd if successful, or NULL if no command satisfies requirements 73 * Returns : struct scsi_cmnd if successful, or NULL if no command satisfies requirements
73 */ 74 */
74extern Scsi_Cmnd *queue_remove_tgtluntag (Queue_t *queue, int target, int lun, int tag); 75extern struct scsi_cmnd *queue_remove_tgtluntag(Queue_t *queue, int target,
76 int lun, int tag);
75 77
76/* 78/*
77 * Function: queue_remove_all_target(queue, target) 79 * Function: queue_remove_all_target(queue, target)
@@ -94,12 +96,12 @@ extern void queue_remove_all_target(Queue_t *queue, int target);
94extern int queue_probetgtlun (Queue_t *queue, int target, int lun); 96extern int queue_probetgtlun (Queue_t *queue, int target, int lun);
95 97
96/* 98/*
97 * Function: int queue_remove_cmd (Queue_t *queue, Scsi_Cmnd *SCpnt) 99 * Function: int queue_remove_cmd (Queue_t *queue, struct scsi_cmnd *SCpnt)
98 * Purpose : remove a specific command from the queues 100 * Purpose : remove a specific command from the queues
99 * Params : queue - queue to look in 101 * Params : queue - queue to look in
100 * SCpnt - command to find 102 * SCpnt - command to find
101 * Returns : 0 if not found 103 * Returns : 0 if not found
102 */ 104 */
103int queue_remove_cmd(Queue_t *queue, Scsi_Cmnd *SCpnt); 105int queue_remove_cmd(Queue_t *queue, struct scsi_cmnd *SCpnt);
104 106
105#endif /* QUEUE_H */ 107#endif /* QUEUE_H */
diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
index 8c2600ffc6a..3a39579bd08 100644
--- a/drivers/scsi/arm/scsi.h
+++ b/drivers/scsi/arm/scsi.h
@@ -66,7 +66,7 @@ static inline void put_next_SCp_byte(struct scsi_pointer *SCp, unsigned char c)
66 SCp->this_residual -= 1; 66 SCp->this_residual -= 1;
67} 67}
68 68
69static inline void init_SCp(Scsi_Cmnd *SCpnt) 69static inline void init_SCp(struct scsi_cmnd *SCpnt)
70{ 70{
71 memset(&SCpnt->SCp, 0, sizeof(struct scsi_pointer)); 71 memset(&SCpnt->SCp, 0, sizeof(struct scsi_pointer));
72 72