|
|
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: #ifndef GENERIC_NCR5380_H
29: #define GENERIC_NCR5380_H
30:
31: #include <linux/config.h>
32:
33: #define GENERIC_NCR5380_PUBLIC_RELEASE 1
34:
35: #ifdef NCR53C400
36: #define BIOSPARAM
37: #define NCR5380_BIOSPARAM generic_NCR5380_biosparam
38: #else
39: #define NCR5380_BIOSPARAM NULL
40: #endif
41:
42: #ifndef ASM
43: int generic_NCR5380_abort(Scsi_Cmnd *);
44: int generic_NCR5380_detect(Scsi_Host_Template *);
45: int generic_NCR5380_release_resources(struct Scsi_Host *);
46: int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
47: int generic_NCR5380_reset(Scsi_Cmnd *, unsigned int);
48: int notyet_generic_proc_info (char *buffer ,char **start, off_t offset,
49: int length, int hostno, int inout);
50: const char* generic_NCR5380_info(struct Scsi_Host *);
51: #ifdef BIOSPARAM
52: int generic_NCR5380_biosparam(Disk *, kdev_t, int *);
53: #endif
54:
55: int generic_NCR5380_proc_info(char* buffer, char** start, off_t offset, int length, int hostno, int inout);
56:
57: #ifndef NULL
58: #define NULL 0
59: #endif
60:
61: #ifndef CMD_PER_LUN
62: #define CMD_PER_LUN 2
63: #endif
64:
65: #ifndef CAN_QUEUE
66: #define CAN_QUEUE 16
67: #endif
68:
69: #if defined(HOSTS_C) || defined(MODULE)
70:
71: #define GENERIC_NCR5380 {NULL, NULL, NULL, \
72: generic_NCR5380_proc_info, \
73: "Generic NCR5380/NCR53C400 Scsi Driver", \
74: generic_NCR5380_detect, generic_NCR5380_release_resources, \
75: (void *)generic_NCR5380_info, NULL, \
76: generic_NCR5380_queue_command, generic_NCR5380_abort, \
77: generic_NCR5380_reset, NULL, \
78: NCR5380_BIOSPARAM, \
79: /* can queue */ CAN_QUEUE, /* id */ 7, SG_ALL, \
80: /* cmd per lun */ CMD_PER_LUN , 0, 0, DISABLE_CLUSTERING}
81:
82: #endif
83:
84: #ifndef HOSTS_C
85:
86: #define __STRVAL(x) #x
87: #define STRVAL(x) __STRVAL(x)
88:
89: #ifdef CONFIG_SCSI_G_NCR5380_PORT
90:
91: #define NCR5380_map_config port
92:
93: #define NCR5380_map_type int
94:
95: #define NCR5380_map_name port
96:
97: #define NCR5380_instance_name io_port
98:
99: #define NCR53C400_register_offset 0
100:
101: #define NCR53C400_address_adjust 8
102:
103: #ifdef NCR53C400
104: #define NCR5380_region_size 16
105: #else
106: #define NCR5380_region_size 8
107: #endif
108:
109: #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
110: #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
111:
112: #else
113: /* therefore CONFIG_SCSI_G_NCR5380_MEM */
114:
115: #define NCR5380_map_config memory
116:
117: #define NCR5380_map_type volatile unsigned char*
118:
119: #define NCR5380_map_name base
120:
121: #define NCR5380_instance_name base
122:
123: #define NCR53C400_register_offset 0x108
124:
125: #define NCR53C400_address_adjust 0
126:
127: #define NCR53C400_mem_base 0x3880
128:
129: #define NCR53C400_host_buffer 0x3900
130:
131: #define NCR5380_region_size 0x3a00
132:
133:
134: #define NCR5380_read(reg) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)))
135: #define NCR5380_write(reg, value) (*(NCR5380_map_name + NCR53C400_mem_base + (reg)) = value)
136:
137: #endif
138:
139: #define NCR5380_implementation_fields \
140: NCR5380_map_type NCR5380_map_name
141:
142: #define NCR5380_local_declare() \
143: register NCR5380_implementation_fields
144:
145: #define NCR5380_setup(instance) \
146: NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
147:
148: #define NCR5380_intr generic_NCR5380_intr
149: #define NCR5380_queue_command generic_NCR5380_queue_command
150: #define NCR5380_abort generic_NCR5380_abort
151: #define NCR5380_reset generic_NCR5380_reset
152: #define NCR5380_pread generic_NCR5380_pread
153: #define NCR5380_pwrite generic_NCR5380_pwrite
154: #define NCR5380_proc_info notyet_generic_proc_info
155:
156: #define BOARD_NCR5380 0
157: #define BOARD_NCR53C400 1
158:
159: #endif /* else def HOSTS_C */
160: #endif /* ndef ASM */
161: #endif /* GENERIC_NCR5380_H */
162:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.