|
|
1.1 root 1: /*
2: * Generic Generic NCR5380 driver defines
3: *
4: * Copyright 1993, Drew Eckhardt
5: * Visionary Computing
6: * (Unix and Linux consulting and custom programming)
7: * [email protected]
8: * +1 (303) 440-4894
9: *
10: * NCR53C400 extensions (c) 1994,1995,1996, Kevin Lentin
11: * [email protected]
12: *
13: * ALPHA RELEASE 1.
14: *
15: * For more information, please consult
16: *
17: * NCR 5380 Family
18: * SCSI Protocol Controller
19: * Databook
20: *
21: * NCR Microelectronics
22: * 1635 Aeroplaza Drive
23: * Colorado Springs, CO 80916
24: * 1+ (719) 578-3400
25: * 1+ (800) 334-5454
26: */
27:
28: /*
29: * $Log: g_NCR5380.h,v $
30: * Revision 1.1.1.1 1997/02/25 21:27:49 thomas
31: * Initial source
32: *
33: * Revision 1.1.1.1 1996/10/30 01:40:05 thomas
34: * Imported from UK22
35: *
36: * Revision 1.1 1996/03/25 20:25:35 goel
37: * Linux driver merge.
38: *
39: */
40:
41: #ifndef GENERIC_NCR5380_H
42: #define GENERIC_NCR5380_H
43:
44: #define GENERIC_NCR5380_PUBLIC_RELEASE 1
45:
46: #ifdef NCR53C400
47: #define BIOSPARAM
48: #define NCR5380_BIOSPARAM generic_NCR5380_biosparam
49: #else
50: #define NCR5380_BIOSPARAM NULL
51: #endif
52:
53: #ifndef ASM
54: int generic_NCR5380_abort(Scsi_Cmnd *);
55: int generic_NCR5380_detect(Scsi_Host_Template *);
56: int generic_NCR5380_release_resources(struct Scsi_Host *);
57: int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
58: int generic_NCR5380_reset(Scsi_Cmnd *);
59: #ifdef BIOSPARAM
60: int generic_NCR5380_biosparam(Disk *, kdev_t, int *);
61: #endif
62:
63: int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout);
64:
65: #ifndef NULL
66: #define NULL 0
67: #endif
68:
69: #ifndef CMD_PER_LUN
70: #define CMD_PER_LUN 2
71: #endif
72:
73: #ifndef CAN_QUEUE
74: #define CAN_QUEUE 16
75: #endif
76:
77: #if defined(HOSTS_C) || defined(MODULE)
78:
79: #define GENERIC_NCR5380 {NULL, NULL, NULL, \
80: generic_NCR5380_proc_info, \
81: "Generic NCR5380/NCR53C400 Scsi Driver", \
82: generic_NCR5380_detect, generic_NCR5380_release_resources, \
83: generic_NCR5380_info, NULL, \
84: generic_NCR5380_queue_command, generic_NCR5380_abort, \
85: generic_NCR5380_reset, NULL, \
86: NCR5380_BIOSPARAM, \
87: /* can queue */ CAN_QUEUE, /* id */ 7, SG_ALL, \
88: /* cmd per lun */ CMD_PER_LUN , 0, 0, DISABLE_CLUSTERING}
89:
90: #endif
91:
92: #ifndef HOSTS_C
93:
94: #define __STRVAL(x) #x
95: #define STRVAL(x) __STRVAL(x)
96:
97: #ifdef CONFIG_SCSI_G_NCR5380_PORT
98:
99: #define NCR5380_map_config port
100:
101: #define NCR5380_map_type int
102:
103: #define NCR5380_map_name port
104:
105: #define NCR5380_instance_name io_port
106:
107: #define NCR53C400_register_offset 0
108:
109: #define NCR53C400_address_adjust 8
110:
111: #ifdef NCR53C400
112: #define NCR5380_region_size 16
113: #else
114: #define NCR5380_region_size 8
115: #endif
116:
117: #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
118: #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
119:
120: #else
121: /* therefore CONFIG_SCSI_G_NCR5380_MEM */
122:
123: #define NCR5380_map_config memory
124:
125: #define NCR5380_map_type volatile unsigned char*
126:
127: #define NCR5380_map_name base
128:
129: #define NCR5380_instance_name base
130:
131: #define NCR53C400_register_offset 0x108
132:
133: #define NCR53C400_address_adjust 0
134:
135: #define NCR53C400_mem_base 0x3880
136:
137: #define NCR53C400_host_buffer 0x3900
138:
139: #define NCR5380_region_size 0x3a00
140:
141:
142: #define NCR5380_read(reg) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)))
143: #define NCR5380_write(reg, value) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)) = value)
144:
145: #endif
146:
147: #define NCR5380_implementation_fields \
148: NCR5380_map_type NCR5380_map_name
149:
150: #define NCR5380_local_declare() \
151: register NCR5380_implementation_fields
152:
153: #define NCR5380_setup(instance) \
154: NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
155:
156: #define NCR5380_intr generic_NCR5380_intr
157: #define NCR5380_queue_command generic_NCR5380_queue_command
158: #define NCR5380_abort generic_NCR5380_abort
159: #define NCR5380_reset generic_NCR5380_reset
160: #define NCR5380_pread generic_NCR5380_pread
161: #define NCR5380_pwrite generic_NCR5380_pwrite
162:
163: #define BOARD_NCR5380 0
164: #define BOARD_NCR53C400 1
165:
166: #endif /* else def HOSTS_C */
167: #endif /* ndef ASM */
168: #endif /* GENERIC_NCR5380_H */
169:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.