diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2016-03-23 06:10:12 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-04-11 16:57:09 -0400 |
commit | e4dec6806aceca768b74c1c6402e6d31ecf3c960 (patch) | |
tree | 97e7286f3af77f0ddef34974163964c5db64bd6c /drivers/scsi/NCR5380.h | |
parent | 7e9ec8d9cc18a85e8a4c28aef9136867b46aba42 (diff) |
ncr5380: Remove REAL_DMA and REAL_DMA_POLL macros
For the NCR5380.c core driver, these macros are never used.
If REAL_DMA were to be defined, compilation would fail.
For the atari_NCR5380.c core driver, REAL_DMA is always defined.
Hence these macros are pointless.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/NCR5380.h')
-rw-r--r-- | drivers/scsi/NCR5380.h | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h index a79288682a74..0b03ba25bd66 100644 --- a/drivers/scsi/NCR5380.h +++ b/drivers/scsi/NCR5380.h | |||
@@ -239,9 +239,7 @@ struct NCR5380_hostdata { | |||
239 | struct Scsi_Host *host; /* Host backpointer */ | 239 | struct Scsi_Host *host; /* Host backpointer */ |
240 | unsigned char id_mask, id_higher_mask; /* 1 << id, all bits greater */ | 240 | unsigned char id_mask, id_higher_mask; /* 1 << id, all bits greater */ |
241 | unsigned char busy[8]; /* index = target, bit = lun */ | 241 | unsigned char busy[8]; /* index = target, bit = lun */ |
242 | #if defined(REAL_DMA) || defined(REAL_DMA_POLL) | ||
243 | int dma_len; /* requested length of DMA */ | 242 | int dma_len; /* requested length of DMA */ |
244 | #endif | ||
245 | unsigned char last_message; /* last message OUT */ | 243 | unsigned char last_message; /* last message OUT */ |
246 | struct scsi_cmnd *connected; /* currently connected cmnd */ | 244 | struct scsi_cmnd *connected; /* currently connected cmnd */ |
247 | struct scsi_cmnd *selecting; /* cmnd to be connected */ | 245 | struct scsi_cmnd *selecting; /* cmnd to be connected */ |
@@ -319,118 +317,8 @@ static void NCR5380_main(struct work_struct *work); | |||
319 | static const char *NCR5380_info(struct Scsi_Host *instance); | 317 | static const char *NCR5380_info(struct Scsi_Host *instance); |
320 | static void NCR5380_reselect(struct Scsi_Host *instance); | 318 | static void NCR5380_reselect(struct Scsi_Host *instance); |
321 | static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *, struct scsi_cmnd *); | 319 | static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *, struct scsi_cmnd *); |
322 | #if defined(PSEUDO_DMA) || defined(REAL_DMA) || defined(REAL_DMA_POLL) | ||
323 | static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data); | 320 | static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data); |
324 | #endif | ||
325 | static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data); | 321 | static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data); |
326 | 322 | ||
327 | #if (defined(REAL_DMA) || defined(REAL_DMA_POLL)) | ||
328 | |||
329 | #if defined(i386) || defined(__alpha__) | ||
330 | |||
331 | /** | ||
332 | * NCR5380_pc_dma_setup - setup ISA DMA | ||
333 | * @instance: adapter to set up | ||
334 | * @ptr: block to transfer (virtual address) | ||
335 | * @count: number of bytes to transfer | ||
336 | * @mode: DMA controller mode to use | ||
337 | * | ||
338 | * Program the DMA controller ready to perform an ISA DMA transfer | ||
339 | * on this chip. | ||
340 | * | ||
341 | * Locks: takes and releases the ISA DMA lock. | ||
342 | */ | ||
343 | |||
344 | static __inline__ int NCR5380_pc_dma_setup(struct Scsi_Host *instance, unsigned char *ptr, unsigned int count, unsigned char mode) | ||
345 | { | ||
346 | unsigned limit; | ||
347 | unsigned long bus_addr = virt_to_bus(ptr); | ||
348 | unsigned long flags; | ||
349 | |||
350 | if (instance->dma_channel <= 3) { | ||
351 | if (count > 65536) | ||
352 | count = 65536; | ||
353 | limit = 65536 - (bus_addr & 0xFFFF); | ||
354 | } else { | ||
355 | if (count > 65536 * 2) | ||
356 | count = 65536 * 2; | ||
357 | limit = 65536 * 2 - (bus_addr & 0x1FFFF); | ||
358 | } | ||
359 | |||
360 | if (count > limit) | ||
361 | count = limit; | ||
362 | |||
363 | if ((count & 1) || (bus_addr & 1)) | ||
364 | panic("scsi%d : attempted unaligned DMA transfer\n", instance->host_no); | ||
365 | |||
366 | flags=claim_dma_lock(); | ||
367 | disable_dma(instance->dma_channel); | ||
368 | clear_dma_ff(instance->dma_channel); | ||
369 | set_dma_addr(instance->dma_channel, bus_addr); | ||
370 | set_dma_count(instance->dma_channel, count); | ||
371 | set_dma_mode(instance->dma_channel, mode); | ||
372 | enable_dma(instance->dma_channel); | ||
373 | release_dma_lock(flags); | ||
374 | |||
375 | return count; | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * NCR5380_pc_dma_write_setup - setup ISA DMA write | ||
380 | * @instance: adapter to set up | ||
381 | * @ptr: block to transfer (virtual address) | ||
382 | * @count: number of bytes to transfer | ||
383 | * | ||
384 | * Program the DMA controller ready to perform an ISA DMA write to the | ||
385 | * SCSI controller. | ||
386 | * | ||
387 | * Locks: called routines take and release the ISA DMA lock. | ||
388 | */ | ||
389 | |||
390 | static __inline__ int NCR5380_pc_dma_write_setup(struct Scsi_Host *instance, unsigned char *src, unsigned int count) | ||
391 | { | ||
392 | return NCR5380_pc_dma_setup(instance, src, count, DMA_MODE_WRITE); | ||
393 | } | ||
394 | |||
395 | /** | ||
396 | * NCR5380_pc_dma_read_setup - setup ISA DMA read | ||
397 | * @instance: adapter to set up | ||
398 | * @ptr: block to transfer (virtual address) | ||
399 | * @count: number of bytes to transfer | ||
400 | * | ||
401 | * Program the DMA controller ready to perform an ISA DMA read from the | ||
402 | * SCSI controller. | ||
403 | * | ||
404 | * Locks: called routines take and release the ISA DMA lock. | ||
405 | */ | ||
406 | |||
407 | static __inline__ int NCR5380_pc_dma_read_setup(struct Scsi_Host *instance, unsigned char *src, unsigned int count) | ||
408 | { | ||
409 | return NCR5380_pc_dma_setup(instance, src, count, DMA_MODE_READ); | ||
410 | } | ||
411 | |||
412 | /** | ||
413 | * NCR5380_pc_dma_residual - return bytes left | ||
414 | * @instance: adapter | ||
415 | * | ||
416 | * Reports the number of bytes left over after the DMA was terminated. | ||
417 | * | ||
418 | * Locks: takes and releases the ISA DMA lock. | ||
419 | */ | ||
420 | |||
421 | static __inline__ int NCR5380_pc_dma_residual(struct Scsi_Host *instance) | ||
422 | { | ||
423 | unsigned long flags; | ||
424 | int tmp; | ||
425 | |||
426 | flags = claim_dma_lock(); | ||
427 | clear_dma_ff(instance->dma_channel); | ||
428 | tmp = get_dma_residue(instance->dma_channel); | ||
429 | release_dma_lock(flags); | ||
430 | |||
431 | return tmp; | ||
432 | } | ||
433 | #endif /* defined(i386) || defined(__alpha__) */ | ||
434 | #endif /* defined(REAL_DMA) */ | ||
435 | #endif /* __KERNEL__ */ | 323 | #endif /* __KERNEL__ */ |
436 | #endif /* NCR5380_H */ | 324 | #endif /* NCR5380_H */ |