Skip to content

Commit

Permalink
[ARM] rpc: acornscsi: fixup abort/reset methods, fix build errors
Browse files Browse the repository at this point in the history
Revive the AcornSCSI driver, update it for the replacement command
abort and host reset methods, and fix the build errors in
acornscsi-io.S.

Acked-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Jul 3, 2008
1 parent d8f8eb4 commit 324b933
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 30 deletions.
2 changes: 1 addition & 1 deletion drivers/scsi/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
config SCSI_ACORNSCSI_3
tristate "Acorn SCSI card (aka30) support"
depends on ARCH_ACORN && SCSI && BROKEN
depends on ARCH_ACORN && SCSI
select SCSI_SPI_ATTRS
help
This enables support for the Acorn SCSI card (aka30). If you have an
Expand Down
6 changes: 6 additions & 0 deletions drivers/scsi/arm/acornscsi-io.S
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
#include <asm/assembler.h>
#include <asm/hardware.h>

#if defined(__APCS_32__)
#define LOADREGS(t,r,l...) ldm##t r, l
#elif defined(__APCS_26__)
#define LOADREGS(t,r,l...) ldm##t r, l##^
#endif

@ Purpose: transfer a block of data from the acorn scsi card to memory
@ Proto : void acornscsi_in(unsigned int addr_start, char *buffer, int length)
@ Returns: nothing
Expand Down
38 changes: 9 additions & 29 deletions drivers/scsi/arm/acornscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2731,9 +2731,7 @@ int acornscsi_abort(struct scsi_cmnd *SCpnt)
//#if (DEBUG & DEBUG_ABORT)
printk("success\n");
//#endif
SCpnt->result = DID_ABORT << 16;
SCpnt->scsi_done(SCpnt);
result = SCSI_ABORT_SUCCESS;
result = SUCCESS;
break;

/*
Expand All @@ -2745,7 +2743,7 @@ int acornscsi_abort(struct scsi_cmnd *SCpnt)
//#if (DEBUG & DEBUG_ABORT)
printk("snooze\n");
//#endif
result = SCSI_ABORT_SNOOZE;
result = FAILED;
break;

/*
Expand All @@ -2755,11 +2753,7 @@ int acornscsi_abort(struct scsi_cmnd *SCpnt)
default:
case res_not_running:
acornscsi_dumplog(host, SCpnt->device->id);
#if (DEBUG & DEBUG_ABORT)
result = SCSI_ABORT_SNOOZE;
#else
result = SCSI_ABORT_NOT_RUNNING;
#endif
result = FAILED;
//#if (DEBUG & DEBUG_ABORT)
printk("not running\n");
//#endif
Expand All @@ -2770,13 +2764,12 @@ int acornscsi_abort(struct scsi_cmnd *SCpnt)
}

/*
* Prototype: int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags)
* Prototype: int acornscsi_reset(struct scsi_cmnd *SCpnt)
* Purpose : reset a command on this host/reset this host
* Params : SCpnt - command causing reset
* result - what type of reset to perform
* Returns : one of SCSI_RESET_ macros
*/
int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags)
int acornscsi_bus_reset(struct scsi_cmnd *SCpnt)
{
AS_Host *host = (AS_Host *)SCpnt->device->host->hostdata;
struct scsi_cmnd *SCptr;
Expand All @@ -2798,28 +2791,16 @@ int acornscsi_reset(struct scsi_cmnd *SCpnt, unsigned int reset_flags)

acornscsi_dma_stop(host);

SCptr = host->SCpnt;

/*
* do hard reset. This resets all devices on this host, and so we
* must set the reset status on all commands.
*/
acornscsi_resetcard(host);

/*
* report reset on commands current connected/disconnected
*/
acornscsi_reportstatus(&host->SCpnt, &SCptr, DID_RESET);

while ((SCptr = queue_remove(&host->queues.disconnected)) != NULL)
acornscsi_reportstatus(&SCptr, &SCpnt, DID_RESET);

if (SCpnt) {
SCpnt->result = DID_RESET << 16;
SCpnt->scsi_done(SCpnt);
}
;

return SCSI_RESET_BUS_RESET | SCSI_RESET_HOST_RESET | SCSI_RESET_SUCCESS;
return SUCCESS;
}

/*==============================================================================================
Expand Down Expand Up @@ -2976,9 +2957,8 @@ static struct scsi_host_template acornscsi_template = {
.name = "AcornSCSI",
.info = acornscsi_info,
.queuecommand = acornscsi_queuecmd,
#warning fixme
.abort = acornscsi_abort,
.reset = acornscsi_reset,
.eh_abort_handler = acornscsi_abort,
.eh_bus_reset_handler = acornscsi_bus_reset,
.can_queue = 16,
.this_id = 7,
.sg_tablesize = SG_ALL,
Expand Down

0 comments on commit 324b933

Please sign in to comment.