FreeBSD/Linux Kernel Cross Reference
sys/sqtconf/conf_sd.c
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991 Carnegie Mellon University
4 * Copyright (c) 1991 Sequent Computer Systems
5 * All Rights Reserved.
6 *
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation is hereby granted, provided that both the copyright
9 * notice and this permission notice appear in all copies of the
10 * software, derivative works or modified versions, and any portions
11 * thereof, and that both notices appear in supporting documentation.
12 *
13 * CARNEGIE MELLON AND SEQUENT COMPUTER SYSTEMS ALLOW FREE USE OF
14 * THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON AND
15 * SEQUENT COMPUTER SYSTEMS DISCLAIM ANY LIABILITY OF ANY KIND FOR
16 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 *
18 * Carnegie Mellon requests users of this software to return to
19 *
20 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
24 *
25 * any improvements or extensions that they make and grant Carnegie Mellon
26 * the rights to redistribute these changes.
27 */
28
29 /*
30 * HISTORY
31 * $Log: conf_sd.c,v $
32 * Revision 2.4 93/01/14 17:56:14 danner
33 * Added vm_types.h include.
34 * [93/01/14 danner]
35 *
36 * Revision 2.3 91/07/31 18:05:33 dbg
37 * Changed copyright.
38 * [91/07/31 dbg]
39 *
40 * Revision 2.2 91/05/08 13:02:49 dbg
41 * Adapted for pure Mach kernel.
42 * [90/10/04 dbg]
43 *
44 */
45
46 #ifndef lint
47 static char rcsid[] = "$Header: conf_sd.c,v 2.4 93/01/14 17:56:14 danner Exp $";
48 #endif
49
50 /*
51 * conf_sd.c - scsi disk device driver configuration file
52 */
53
54 /*
55 * Revision 1.1 89/07/05 13:17:40 kak
56 * Initial revision
57 *
58 */
59
60 #include <mach/machine/vm_types.h>
61 #include <sqt/mutex.h> /* gate_t */
62 #include <sqt/ioconf.h> /* IO Configuration Definitions */
63 #include <sqtsec/sec.h> /* scsi common data structures */
64 #include <sqtsec/sd.h> /* driver local structures */
65
66 /*
67 * Partition tables.
68 * NOTE: Should be cleanly merged with the standalone.
69 * These partitions that go to the end of the disk are grossly
70 * exaggerated so that varying disk sizes can be used.
71 * NOTE: The newfs utility ASSUMES that the 'c' partition starts at the
72 * beginning of the disk when writing the bootstrap program.
73 * The bootstrap program is written when a root filesystem is created.
74 * The newfs utility ASSUMES that the 'a' partition is the root
75 * filesystem. However, by writing the bootstrap to partition 'c' the
76 * 'a' partition may be moved to the middle of the disk to reduce
77 * seek latency.
78 * If the 'c' partition is changed so that it does not include the
79 * start of the disk, then be sure to use the "-n" option to newfs
80 * and use /stand/installboot to write the bootstrap program (at least
81 * 1 partition must start at the beginning of the disk).
82 * NOTE: Disk partitions that extend to the end of the disk are sized
83 * as SD_END which allows several different sized drives to work with
84 * the same partition table. DYNIX adjusts to the actual size of the
85 * drive.
86 */
87 struct sd_partition sdpart0[] = {
88 /*
89 start, length, */
90 0, 15884, /* minor 0 ('a') */
91 15884, 33440, /* minor 1 ('b') */
92 0, SD_END, /* minor 2 ('c') */
93 15884+33440, 15884, /* minor 3 ('d') */
94 15884+33440+15884, SD_END, /* minor 4 ('e') */
95 0, 0, /* minor 5 ('f') */
96 15884+33440, SD_END, /* minor 6 ('g') */
97 0, 0, /* minor 7 ('h') */
98 };
99
100 /*
101 * Configure the device's tuning parameters.
102 *
103 * The number to the far right in the table below will be the
104 * unit number portion of the devices major/minor pair.
105 *
106 * The structure of the minor number is
107 * bits 0-2 are the partition table index; 3-7 is the index into
108 * the binary configuration table.
109 *
110 * buf_sz: currently used to handle ioctl return information.
111 * partab: partition table entry for each unit.
112 * num_iat: number of iat's which are calloc'd for operation.
113 * This parameter must be large enough to handle all device
114 * programs allocated to allow low and thresh to work properly and
115 * should be set to (num_device_progs*(CLSIZE>=7?7:CLSIZE))
116 * Where the maximum raw transfer size will be constrained to
117 * a minimum of ((num_iat-1)*CLBYTES).
118 * low: once all device programs have been filled out the interrupt
119 * procedure will not queue any more until the queue has drained
120 * off to below low. Minimum value is 2.
121 * thresh: number of device programs to place in the queue maximum on
122 * each strategy or interrupt call to the start procedure. This
123 * allow the queue to be filled up at a controlled rate.
124 *
125 * NOTE: The partition table entry(below) must contain a valid partition
126 * table that has the proper number of entries(above).
127 * UNPREDICTABLE DRIVER ACTION AND RESULTS WILL OCCUR OTHERWISE.
128 */
129 struct sd_bconf sdbconf[] = { /*
130 buf_sz, partab, num_iat, low, thresh, bps */
131 {128, sdpart0, 129, 5, 2, 60*17 }, /**/
132 {128, sdpart0, 129, 5, 2, 60*17 }, /*1*/
133 {128, sdpart0, 129, 5, 2, 60*17 }, /*2*/
134 {128, sdpart0, 129, 5, 2, 60*17 }, /*3*/
135 {128, sdpart0, 129, 5, 2, 60*17 }, /*4*/
136 {128, sdpart0, 129, 5, 2, 60*17 }, /*5*/
137 {128, sdpart0, 129, 5, 2, 60*17 }, /*6*/
138 {128, sdpart0, 129, 5, 2, 60*17 }, /*7*/
139 };
140
141 int sdretrys = 4; /* Number of retrys before allowing a hard error */
142 gate_t sdgate = 58; /* gate for this device driver */
143
144 #ifdef SDDEBUG
145 /*
146 * spin time for async timeouts which should never occur in a
147 * production system unless there is bad hardware (target adapter)
148 * which never comes back or timeouts.
149 */
150 int sdspintime = 2000000;
151 #endif SDDEBUG
152
153 /*
154 * bit patterns expected in results from INQUIRY command. To identify
155 * units on a target adaptor, byte 3 must be sdinq_targformat; CCS
156 * disks will have byte 3 = sdinq_ccsformat. Byte 0 must be sddevtype
157 * on all recognized SCSI disks.
158 */
159
160 u_char sddevtype = 0;
161 u_char sdinq_targformat = 0x0;
162 u_char sdinq_ccsformat = 0x1;
163
164 /*
165 * DON'T CHANGE ANY THING BELOW THIS LINE OR ALL BETS ARE OFF!
166 */
167 int sdmaxminor = sizeof(sdbconf)/sizeof(struct sd_bconf);
168 int sdsensebuf_sz = 32 * sizeof(char);
Cache object: eee4f9bb33b1bc9243dabcd5c4614e4e
|