[PATCH] char/tty_io: replace schedule_timeout() with msleep_interruptible()
[linux-2.6/verdex.git] / drivers / scsi / dtc.h
blobed73629eb2f9d6d6705b2a20e1608726f205fd1f
1 /*
2 * DTC controller, taken from T128 driver by...
3 * Copyright 1993, Drew Eckhardt
4 * Visionary Computing
5 * (Unix and Linux consulting and custom programming)
6 * drew@colorado.edu
7 * +1 (303) 440-4894
9 * DISTRIBUTION RELEASE 2.
11 * For more information, please consult
15 * and
17 * NCR 5380 Family
18 * SCSI Protocol Controller
19 * Databook
21 * NCR Microelectronics
22 * 1635 Aeroplaza Drive
23 * Colorado Springs, CO 80916
24 * 1+ (719) 578-3400
25 * 1+ (800) 334-5454
28 #ifndef DTC3280_H
29 #define DTC3280_H
31 static int dtc_abort(Scsi_Cmnd *);
32 static int dtc_biosparam(struct scsi_device *, struct block_device *,
33 sector_t, int*);
34 static int dtc_detect(Scsi_Host_Template *);
35 static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
36 static int dtc_bus_reset(Scsi_Cmnd *);
38 #ifndef CMD_PER_LUN
39 #define CMD_PER_LUN 2
40 #endif
42 #ifndef CAN_QUEUE
43 #define CAN_QUEUE 32
44 #endif
46 #define NCR5380_implementation_fields \
47 void __iomem *base
49 #define NCR5380_local_declare() \
50 void __iomem *base
52 #define NCR5380_setup(instance) \
53 base = ((struct NCR5380_hostdata *)(instance)->hostdata)->base
55 #define DTC_address(reg) (base + DTC_5380_OFFSET + reg)
57 #define dbNCR5380_read(reg) \
58 (rval=readb(DTC_address(reg)), \
59 (((unsigned char) printk("DTC : read register %d at addr %p is: %02x\n"\
60 , (reg), DTC_address(reg), rval)), rval ) )
62 #define dbNCR5380_write(reg, value) do { \
63 printk("DTC : write %02x to register %d at address %p\n", \
64 (value), (reg), DTC_address(reg)); \
65 writeb(value, DTC_address(reg));} while(0)
68 #if !(DTCDEBUG & DTCDEBUG_TRANSFER)
69 #define NCR5380_read(reg) (readb(DTC_address(reg)))
70 #define NCR5380_write(reg, value) (writeb(value, DTC_address(reg)))
71 #else
72 #define NCR5380_read(reg) (readb(DTC_address(reg)))
73 #define xNCR5380_read(reg) \
74 (((unsigned char) printk("DTC : read register %d at address %p\n"\
75 , (reg), DTC_address(reg))), readb(DTC_address(reg)))
77 #define NCR5380_write(reg, value) do { \
78 printk("DTC : write %02x to register %d at address %p\n", \
79 (value), (reg), DTC_address(reg)); \
80 writeb(value, DTC_address(reg));} while(0)
81 #endif
83 #define NCR5380_intr dtc_intr
84 #define NCR5380_queue_command dtc_queue_command
85 #define NCR5380_abort dtc_abort
86 #define NCR5380_bus_reset dtc_bus_reset
87 #define NCR5380_proc_info dtc_proc_info
89 /* 15 12 11 10
90 1001 1100 0000 0000 */
92 #define DTC_IRQS 0x9c00
95 #endif /* DTC3280_H */