Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f825e40b authored by Finn Thain's avatar Finn Thain Committed by Martin K. Petersen
Browse files

ncr5380: Remove PSEUDO_DMA macro



For those wrapper drivers which only implement Programmed IO, have
NCR5380_dma_xfer_len() evaluate to zero. That allows PDMA to be easily
disabled at run-time and so the PSEUDO_DMA macro is no longer needed.

Also remove the spin counters used for debugging pseudo DMA drivers.

Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Tested-by: default avatarMichael Schmitz <schmitzmic@gmail.com>
Tested-by: default avatarOndrej Zary <linux@rainbow-software.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 1bb46002
Loading
Loading
Loading
Loading
+1 −31
Original line number Diff line number Diff line
@@ -468,35 +468,10 @@ static void prepare_info(struct Scsi_Host *instance)
#endif
#ifdef PARITY
	         "PARITY "
#endif
#ifdef PSEUDO_DMA
	         "PSEUDO_DMA "
#endif
	         "");
}

#ifdef PSEUDO_DMA
static int __maybe_unused NCR5380_write_info(struct Scsi_Host *instance,
	char *buffer, int length)
{
	struct NCR5380_hostdata *hostdata = shost_priv(instance);

	hostdata->spin_max_r = 0;
	hostdata->spin_max_w = 0;
	return 0;
}

static int __maybe_unused NCR5380_show_info(struct seq_file *m,
                                            struct Scsi_Host *instance)
{
	struct NCR5380_hostdata *hostdata = shost_priv(instance);

	seq_printf(m, "Highwater I/O busy spin counts: write %d, read %d\n",
	        hostdata->spin_max_w, hostdata->spin_max_r);
	return 0;
}
#endif

/**
 * NCR5380_init - initialise an NCR5380
 * @instance: adapter to configure
@@ -1436,7 +1411,6 @@ static int do_abort(struct Scsi_Host *instance)
	return -1;
}

#if defined(PSEUDO_DMA)
/*
 * Function : int NCR5380_transfer_dma (struct Scsi_Host *instance,
 * unsigned char *phase, int *count, unsigned char **data)
@@ -1592,7 +1566,6 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
	*phase = NCR5380_read(STATUS_REG) & PHASE_MASK;
	return foo;
}
#endif /* PSEUDO_DMA */

/*
 * Function : NCR5380_information_transfer (struct Scsi_Host *instance)
@@ -1683,7 +1656,6 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
				 * in an unconditional loop.
				 */

#if defined(PSEUDO_DMA)
				transfersize = 0;
				if (!cmd->device->borken)
					transfersize = NCR5380_dma_xfer_len(instance, cmd, phase);
@@ -1706,9 +1678,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
						/* XXX - need to source or sink data here, as appropriate */
					} else
						cmd->SCp.this_residual -= transfersize - len;
				} else
#endif /* PSEUDO_DMA */
				{
				} else {
					/* Break up transfer into 3 ms chunks,
					 * presuming 6 accesses per handshake.
					 */
+0 −4
Original line number Diff line number Diff line
@@ -256,10 +256,6 @@ struct NCR5380_hostdata {
	struct work_struct main_task;
#ifdef SUPPORT_TAGS
	struct tag_alloc TagAlloc[8][8];	/* 8 targets and 8 LUNs */
#endif
#ifdef PSEUDO_DMA
	unsigned spin_max_r;
	unsigned spin_max_w;
#endif
	struct workqueue_struct *work_q;
	unsigned long accesses_per_ms;	/* chip register accesses per ms */
+0 −2
Original line number Diff line number Diff line
@@ -13,8 +13,6 @@

#include <scsi/scsi_host.h>

#define PSEUDO_DMA

#define priv(host)			((struct NCR5380_hostdata *)(host)->hostdata)
#define NCR5380_read(reg)		cumanascsi_read(instance, reg)
#define NCR5380_write(reg, value)	cumanascsi_write(instance, reg, value)
+1 −2
Original line number Diff line number Diff line
@@ -14,7 +14,6 @@

#include <scsi/scsi_host.h>

/*#define PSEUDO_DMA*/
#define DONT_USE_INTR

#define priv(host)			((struct NCR5380_hostdata *)(host)->hostdata)
@@ -24,7 +23,7 @@
#define NCR5380_write(reg, value) \
	writeb(value, priv(instance)->base + ((reg) << 2))

#define NCR5380_dma_xfer_len(instance, cmd, phase)	(cmd->transfersize)
#define NCR5380_dma_xfer_len(instance, cmd, phase)	(0)

#define NCR5380_queue_command		oakscsi_queue_command
#define NCR5380_info			oakscsi_info
+4 −0
Original line number Diff line number Diff line
@@ -39,6 +39,10 @@
#define NCR5380_read(reg)		inb(instance->io_port + reg)
#define NCR5380_write(reg, value)	outb(value, instance->io_port + reg)

#define NCR5380_dma_xfer_len(instance, cmd, phase)	(0)
#define NCR5380_pread(instance, dst, len)		(0)
#define NCR5380_pwrite(instance, src, len)		(0)

#define NCR5380_implementation_fields	/* none */

#include "NCR5380.h"
Loading