aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/arm/acornscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/arm/acornscsi.c')
-rw-r--r--drivers/scsi/arm/acornscsi.c48
1 files changed, 25 insertions, 23 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