xref: /titanic_50/usr/src/uts/common/sys/fdmedia.h (revision 4445fffbbb1ea25fd0e9ea68b9380dd7a6709025)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1995 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_SYS_FDMEDIA_H
28 #define	_SYS_FDMEDIA_H
29 
30 #pragma ident	"%W%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 /*
37  * Default names for label
38  */
39 static char deflabel_35[] = {
40 	"3.5\" floppy cyl %d alt 0 hd %d sec %d"
41 };
42 static char deflabel_525[] = {
43 	"5.25\" floppy cyl %d alt 0 hd %d sec %d"
44 };
45 
46 /*
47  * default characteristics
48  */
49 static struct fdattr fdtypes[] = {
50 	{	/* [0] = struct fdattr fdattr_5H */
51 		360,		/* rotational speed */
52 		1,		/* interleave factor */
53 		0x1B,		/* gap 3 length */
54 		0x54		/* format gap 3 length */
55 	},
56 	{	/* [1] = struct fdattr fdattr_5Q */
57 		300,		/* rotational speed */
58 		1,		/* interleave factor */
59 		0x1B,		/* gap 3 length */
60 		0x54		/* format gap 3 length */
61 	},
62 	{	/* [2] = struct fdattr fdattr_5D9 */
63 		300,		/* rotational speed */
64 		1,		/* interleave factor */
65 		0x2A,		/* gap 3 length */
66 		0x50		/* format gap 3 length */
67 	},
68 	{	/* [3] = struct fdattr fdattr_5D8 */
69 		300,		/* rotational speed */
70 		1,		/* interleave factor */
71 		0x2A,		/* gap 3 length */
72 		0x50		/* format gap 3 length */
73 	},
74 	{	/* [4] = struct fdattr fdattr_5D4 */
75 		300,		/* rotational speed */
76 		1,		/* interleave factor */
77 		0x80,		/* gap 3 length */
78 		0xF0		/* format gap 3 length */
79 	},
80 	{	/* [5] = struct fdattr fdattr_5D16 */
81 		300,		/* rotational speed */
82 		1,		/* interleave factor */
83 		0x20,		/* gap 3 length */
84 		0x32		/* format gap 3 length */
85 	},
86 	{	/* [6] = struct fdattr fdattr_3E */
87 		300,		/* rotational speed */
88 		1,		/* interleave factor */
89 		0x1B,		/* gap 3 length */
90 		0x53		/* format gap 3 length */
91 	},
92 	{	/* [7] = struct fdattr fdattr_3H */
93 		300,		/* rotational speed */
94 		1,		/* interleave factor */
95 		0x1B,		/* gap 3 length */
96 		0x6C		/* format gap 3 length */
97 	},
98 	{	/* [8] = struct fdattr fdattr_3I */
99 		300,		/* rotational speed */
100 		1,		/* interleave factor */
101 		4,		/* gap 3 length */
102 		12		/* format gap 3 length */
103 	},
104 	{	/* [9] = struct fdattr fdattr_3M */
105 		360,		/* rotational speed */
106 		1,		/* interleave factor */
107 		0x35,		/* gap 3 length */
108 		0x74		/* format gap 3 length */
109 	},
110 	{	/* [10] = struct fdattr fdattr_3D */
111 		300,		/* rotational speed */
112 		1,		/* interleave factor */
113 		0x1B,		/* gap 3 length */
114 		0x50		/* format gap 3 length */
115 	}
116 };
117 
118 static int nfdtypes = sizeof (fdtypes) / sizeof (fdtypes[0]);
119 
120 
121 static struct fd_char dfc_80x36 = {
122 		3,		/* medium */
123 		1000,		/* transfer rate */
124 		80,		/* number of cylinders */
125 		2,		/* number of heads */
126 		512,		/* sector size */
127 		36,		/* sectors per track */
128 		1,		/* # steps per data track */
129 };
130 static struct fd_char dfc_80x21 = {
131 		3,		/* medium */
132 		500,		/* transfer rate */
133 		80,		/* number of cylinders */
134 		2,		/* number of heads */
135 		512,		/* sector size */
136 		21,		/* sectors per track */
137 		1,		/* # steps per data track */
138 };
139 static struct fd_char dfc_80x18 = {
140 		3,		/* medium */
141 		500,		/* transfer rate */
142 		80,		/* number of cylinders */
143 		2,		/* number of heads */
144 		512,		/* sector size */
145 		18,		/* sectors per track */
146 		1,		/* # steps per data track */
147 };
148 static struct fd_char dfc_80x15 = {
149 		5,		/* medium */
150 		500,		/* transfer rate */
151 		80,		/* number of cylinders */
152 		2,		/* number of heads */
153 		512,		/* sector size */
154 		15,		/* sectors per track */
155 		1,		/* # steps per data track */
156 };
157 static struct fd_char dfc_80x9 = {
158 		3,		/* medium */
159 		250,		/* transfer rate */
160 		80,		/* number of cylinders */
161 		2,		/* number of heads */
162 		512,		/* sector size */
163 		9,		/* sectors per track */
164 		1,		/* # steps per data track */
165 };
166 static struct fd_char dfc_77x8 = {
167 		3,		/* medium */
168 		500,		/* transfer rate */
169 		77,		/* number of cylinders */
170 		2,		/* number of heads */
171 		1024,		/* sector size */
172 		8,		/* sectors per track */
173 		1,		/* # steps per data track */
174 };
175 static struct fd_char dfc_40x16 = {
176 		5,		/* medium */
177 		250,		/* transfer rate */
178 		40,		/* number of cylinders */
179 		2,		/* number of heads */
180 		256,		/* sector size */
181 		16,		/* sectors per track */
182 		1,		/* # steps per data track */
183 };
184 static struct fd_char dfc_40x9 = {
185 		5,		/* medium */
186 		250,		/* transfer rate */
187 		40,		/* number of cylinders */
188 		2,		/* number of heads */
189 		512,		/* sector size */
190 		9,		/* sectors per track */
191 		1,		/* # steps per data track */
192 };
193 static struct fd_char dfc_40x8 = {
194 		5,		/* medium */
195 		250,		/* transfer rate */
196 		40,		/* number of cylinders */
197 		2,		/* number of heads */
198 		512,		/* sector size */
199 		8,		/* sectors per track */
200 		1,		/* # steps per data track */
201 };
202 static struct fd_char dfc_40x4 = {
203 		5,		/* medium */
204 		250,		/* transfer rate */
205 		40,		/* number of cylinders */
206 		2,		/* number of heads */
207 		1024,		/* sector size */
208 		4,		/* sectors per track */
209 		1,		/* # steps per data track */
210 };
211 
212 static struct fd_char *defchar[] = {
213 		&dfc_80x15,	/* FMT_5H */
214 		&dfc_80x9,	/* FMT_5Q */
215 		&dfc_40x9,	/* FMT_5D9 */
216 		&dfc_40x8,	/* FMT_5D8 */
217 		&dfc_40x4,	/* FMT_5D4 */
218 		&dfc_40x16,	/* FMT_5D16 */
219 		&dfc_80x36,	/* FMT_3E */
220 		&dfc_80x18,	/* FMT_3H */
221 		&dfc_80x21,	/* FMT_3I */
222 		&dfc_77x8,	/* FMT_3M */
223 		&dfc_80x9	/* FMT_3D */
224 };
225 
226 
227 static struct fd_drive dfd_350ED = {
228 		0,	/* ejectable,  does the drive support eject? */
229 		4,	/* maxsearch, size of per-unit search table */
230 		0,	/* cyl to start write precompensation */
231 		80,	/* cyl to start reducing write current */
232 		1,	/* step width pulse in 1 us units */
233 		30,	/* step rate in 100 us units */
234 		150,	/* head settle delay, in 100 us units */
235 		150,	/* head load delay, in 100 us units */
236 		2560,	/* head unload delay, in 100 us units */
237 		3,	/* motor on delay, in 100 ms units */
238 		20,	/* motor off delay, in 100 ms units */
239 		65,	/* precomp level, bit shift, in nano-secs */
240 		0,	/* pins, defines meaning of pin 1, 2, 4, and 34 */
241 		0,	/* flags, TRUE READY, Starting Sector #, & Motor On */
242 };
243 static struct fd_drive dfd_350HD = {
244 		0,	/* ejectable,  does the drive support eject? */
245 		4,	/* maxsearch, size of per-unit search table */
246 		0,	/* cyl to start write prcompensation */
247 		80,	/* cyl to start reducing write current */
248 		1,	/* step width pulse in 1 us units */
249 		30,	/* step rate in 100 us units */
250 		150,	/* head settle delay, in 100 us units */
251 		150,	/* head load delay, in 100 us units */
252 		2560,	/* head unload delay, in 100 us units */
253 		3,	/* motor on delay, in 100 ms units */
254 		20,	/* motor off delay, in 100 ms units */
255 		125,	/* precomp level, bit shift, in nano-secs */
256 		0,	/* pins, defines meaning of pin 1, 2, 4, and 34 */
257 		0,	/* flags, TRUE READY, Starting Sector #, & Motor On */
258 };
259 static struct fd_drive dfd_525HD = {
260 		0,	/* ejectable,  does the drive support eject? */
261 		6,	/* maxsearch, size of per-unit search table */
262 		43,	/* cyl to start write prcompensation */
263 		80,	/* cyl to start reducing write current */
264 		1,	/* step width pulse in 1 us units */
265 		30,	/* step rate in 100 us units */
266 		150,	/* head settle delay, in 100 us units */
267 		150,	/* head load delay, in 100 us units */
268 		2560,	/* head unload delay, in 100 us units */
269 		5,	/* motor on delay, in 100 ms units */
270 		20,	/* motor off delay, in 100 ms units */
271 		175,	/* precomp level, bit shift, in nano-secs */
272 		0,	/* pins, defines meaning of pin 1, 2, 4, and 34 */
273 		0,	/* flags, TRUE READY, Starting Sector #, & Motor On */
274 };
275 static struct fd_drive dfd_525DD = {
276 		0,	/* ejectable,  does the drive support eject? */
277 		4,	/* maxsearch, size of per-unit search table */
278 		22,	/* cyl to start write prcompensation */
279 		40,	/* cyl to start reducing write current */
280 		1,	/* step width pulse in 1 us units */
281 		60,	/* step rate in 100 us units */
282 		150,	/* head settle delay, in 100 us units */
283 		150,	/* head load delay, in 100 us units */
284 		2560,	/* head unload delay, in 100 us units */
285 		5,	/* motor on delay, in 100 ms units */
286 		20,	/* motor off delay, in 100 ms units */
287 		250,	/* precomp level, bit shift, in nano-secs */
288 		0,	/* pins, defines meaning of pin 1, 2, 4, and 34 */
289 		0,	/* flags, TRUE READY, Starting Sector #, & Motor On */
290 };
291 
292 /*
293  * Default partition maps
294  */
295 static struct partition dpt_80x36[NDKMAP] = {
296 		{ 0, 0, 0,	79*2*36 },	/* part 0 - all but last cyl */
297 		{ 0, 0, 79*2*36, 1*2*36 },	/* part 1 - just the last cyl */
298 		{ 0, 0, 0,	80*2*36 },	/* part 2 - "the whole thing" */
299 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
300 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
301 };
302 static struct partition dpt_80x21[NDKMAP] = {
303 		{ 0, 0, 0,	79*2*21 },	/* part 0 - all but last cyl */
304 		{ 0, 0, 79*2*21, 1*2*21 },	/* part 1 - just the last cyl */
305 		{ 0, 0, 0,	80*2*21 },	/* part 2 - "the whole thing" */
306 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
307 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
308 };
309 static struct partition dpt_80x18[NDKMAP] = {
310 		{ 0, 0, 0,	79*2*18 },	/* part 0 - all but last cyl */
311 		{ 0, 0, 79*2*18, 1*2*18 },	/* part 1 - just the last cyl */
312 		{ 0, 0, 0,	80*2*18 },	/* part 2 - "the whole thing" */
313 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
314 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
315 };
316 static struct partition dpt_80x15[NDKMAP] = {
317 		{ 0, 0, 0,	79*2*15 },	/* part 0 - all but last cyl */
318 		{ 0, 0, 79*2*15, 1*2*15 },	/* part 1 - just the last cyl */
319 		{ 0, 0, 0,	80*2*15 },	/* part 2 - "the whole thing" */
320 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
321 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
322 };
323 static struct partition dpt_80x9[NDKMAP] = {
324 		{ 0, 0, 0,	79*2*9 },	/* part 0 - all but last cyl */
325 		{ 0, 0, 79*2*9,	 1*2*9 },	/* part 1 - just the last cyl */
326 		{ 0, 0, 0,	80*2*9 },	/* part 2 - "the whole thing" */
327 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
328 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
329 };
330 static struct partition dpt_77x8[NDKMAP] = {
331 		/* double number of blocks since sector size is 1024 */
332 		{ 0, 0, 0,	 76*2*8*2 },	/* part 0 - all but last cyl */
333 		{ 0, 0, 76*2*8*2, 1*2*8*2 },	/* part 1 - just the last cyl */
334 		{ 0, 0, 0,	 77*2*8*2 },	/* part 2 - "the whole thing" */
335 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
336 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
337 };
338 static struct partition dpt_40x16[NDKMAP] = {
339 		/* halve number of blocks since sector size is 256 */
340 		{ 0, 0, 0,	 39*2*16/2 },	/* part 0 - all but last cyl */
341 		{ 0, 0, 39*2*16/2, 1*2*16/2 },	/* part 1 - just the last cyl */
342 		{ 0, 0, 0,	 40*2*16/2 },	/* part 2 - "the whole thing" */
343 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
344 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
345 };
346 static struct partition dpt_40x9[NDKMAP] = {
347 		{ 0, 0, 0,	39*2*9 },	/* part 0 - all but last cyl */
348 		{ 0, 0, 39*2*9,  1*2*9 },	/* part 1 - just the last cyl */
349 		{ 0, 0, 0,	40*2*9 },	/* part 2 - "the whole thing" */
350 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
351 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
352 };
353 static struct partition dpt_40x8[NDKMAP] = {
354 		/* double number of blocks since sector size is 1024 */
355 		{ 0, 0, 0,	 39*2*8*2 },	/* part 0 - all but last cyl */
356 		{ 0, 0, 39*2*8*2, 1*2*8*2 },	/* part 1 - just the last cyl */
357 		{ 0, 0, 0,	 40*2*8*2 },	/* part 2 - "the whole thing" */
358 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
359 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
360 };
361 static struct partition dpt_40x4[NDKMAP] = {
362 		{ 0, 0, 0,	39*2*4 },	/* part 0 - all but last cyl */
363 		{ 0, 0, 39*2*4,  1*2*4 },	/* part 1 - just the last cyl */
364 		{ 0, 0, 0,	40*2*4 },	/* part 2 - "the whole thing" */
365 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
366 		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
367 };
368 
369 static struct partition *fdparts[] = {
370 		dpt_80x15,	/* FMT_5H */
371 		dpt_80x9,	/* FMT_5Q */
372 		dpt_40x9,	/* FMT_5D9 */
373 		dpt_40x8,	/* FMT_5D8 */
374 		dpt_40x4,	/* FMT_5D4 */
375 		dpt_40x16,	/* FMT_5D16 */
376 		dpt_80x36,	/* FMT_3E */
377 		dpt_80x18,	/* FMT_3H */
378 		dpt_80x21,	/* FMT_3I */
379 		dpt_77x8,	/* FMT_3M */
380 		dpt_80x9	/* FMT_3D */
381 };
382 
383 #ifdef	__cplusplus
384 }
385 #endif
386 
387 #endif	/* !_SYS_FDMEDIA_H */
388