aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sun3_scsi.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2014-11-12 00:12:12 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-20 03:11:15 -0500
commit2231ef876a0ab4ab7b344bff6cc1508d9b6c1b52 (patch)
treea28d1ea3d31db1da28365dd1e11be45ed98bd645 /drivers/scsi/sun3_scsi.c
parent0d31f8759109cbc1e6fc196d08e6b0e8a9e93b3f (diff)
sun3_scsi: Move macro definitions
The #defines in sun3_scsi.h are intended to influence subsequent #includes in sun3_scsi.c. IMHO, that's too convoluted. Move sun3_scsi.h macro definitions to sun3_scsi.c, consistent with other NCR5380 drivers. Omit the unused NCR5380_local_declare() and NCR5380_setup() macros. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/sun3_scsi.c')
-rw-r--r--drivers/scsi/sun3_scsi.c45
1 files changed, 32 insertions, 13 deletions
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index ba5169982706..6943dd6b9b56 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -33,18 +33,42 @@
33#include <asm/io.h> 33#include <asm/io.h>
34#include <asm/dvma.h> 34#include <asm/dvma.h>
35 35
36/* dma on! */
37#define REAL_DMA
38
39#include <scsi/scsi_host.h> 36#include <scsi/scsi_host.h>
40#include "sun3_scsi.h" 37#include "sun3_scsi.h"
41#include "NCR5380.h"
42 38
43extern int sun3_map_test(unsigned long, char *); 39/* Definitions for the core NCR5380 driver. */
44 40
45/*#define RESET_BOOT */ 41#define REAL_DMA
42#define RESET_RUN_DONE
46/* #define SUPPORT_TAGS */ 43/* #define SUPPORT_TAGS */
47 44
45/* #define MAX_TAGS 32 */
46
47#define NCR5380_implementation_fields /* none */
48
49#define NCR5380_read(reg) sun3scsi_read(reg)
50#define NCR5380_write(reg, value) sun3scsi_write(reg, value)
51
52#define NCR5380_queue_command sun3scsi_queue_command
53#define NCR5380_bus_reset sun3scsi_bus_reset
54#define NCR5380_abort sun3scsi_abort
55#define NCR5380_show_info sun3scsi_show_info
56#define NCR5380_info sun3scsi_info
57
58#define NCR5380_dma_read_setup(instance, data, count) \
59 sun3scsi_dma_setup(data, count, 0)
60#define NCR5380_dma_write_setup(instance, data, count) \
61 sun3scsi_dma_setup(data, count, 1)
62#define NCR5380_dma_residual(instance) \
63 sun3scsi_dma_residual(instance)
64#define NCR5380_dma_xfer_len(instance, cmd, phase) \
65 sun3scsi_dma_xfer_len(cmd->SCp.this_residual, cmd, !((phase) & SR_IO))
66
67#include "NCR5380.h"
68
69
70extern int sun3_map_test(unsigned long, char *);
71
48#ifdef SUN3_SCSI_VME 72#ifdef SUN3_SCSI_VME
49#define ENABLE_IRQ() 73#define ENABLE_IRQ()
50#else 74#else
@@ -65,9 +89,7 @@ module_param(setup_use_tagged_queuing, int, 0);
65static int setup_hostid = -1; 89static int setup_hostid = -1;
66module_param(setup_hostid, int, 0); 90module_param(setup_hostid, int, 0);
67 91
68static struct scsi_cmnd *sun3_dma_setup_done = NULL; 92/* #define RESET_BOOT */
69
70#define RESET_RUN_DONE
71 93
72#define AFTER_RESET_DELAY (HZ/2) 94#define AFTER_RESET_DELAY (HZ/2)
73 95
@@ -80,6 +102,7 @@ static struct scsi_cmnd *sun3_dma_setup_done = NULL;
80/* minimum number of bytes to do dma on */ 102/* minimum number of bytes to do dma on */
81#define SUN3_DMA_MINSIZE 128 103#define SUN3_DMA_MINSIZE 128
82 104
105static struct scsi_cmnd *sun3_dma_setup_done;
83static unsigned char *sun3_scsi_regp; 106static unsigned char *sun3_scsi_regp;
84static volatile struct sun3_dma_regs *dregs; 107static volatile struct sun3_dma_regs *dregs;
85static struct sun3_udc_regs *udc_regs; 108static struct sun3_udc_regs *udc_regs;
@@ -131,9 +154,6 @@ static inline void sun3_udc_write(unsigned short val, unsigned char reg)
131static void sun3_scsi_reset_boot(struct Scsi_Host *instance) 154static void sun3_scsi_reset_boot(struct Scsi_Host *instance)
132{ 155{
133 unsigned long end; 156 unsigned long end;
134
135 NCR5380_local_declare();
136 NCR5380_setup(instance);
137 157
138 /* 158 /*
139 * Do a SCSI reset to clean up the bus during initialization. No 159 * Do a SCSI reset to clean up the bus during initialization. No
@@ -210,7 +230,6 @@ static irqreturn_t scsi_sun3_intr(int irq, void *dummy)
210void sun3_sun3_debug (void) 230void sun3_sun3_debug (void)
211{ 231{
212 unsigned long flags; 232 unsigned long flags;
213 NCR5380_local_declare();
214 233
215 if (default_instance) { 234 if (default_instance) {
216 local_irq_save(flags); 235 local_irq_save(flags);