summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/fdmedia.h
blob: 8d42bc4daffa955e73c4ed876fcee6deaee0a4e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright (c) 1995 by Sun Microsystems, Inc.
 * All rights reserved.
 */

#ifndef	_SYS_FDMEDIA_H
#define	_SYS_FDMEDIA_H

#pragma ident	"%W%	%E% SMI"

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * Default names for label
 */
static char deflabel_35[] = {
	"3.5\" floppy cyl %d alt 0 hd %d sec %d"
};
static char deflabel_525[] = {
	"5.25\" floppy cyl %d alt 0 hd %d sec %d"
};

/*
 * default characteristics
 */
static struct fdattr fdtypes[] = {
	{	/* [0] = struct fdattr fdattr_5H */
		360,		/* rotational speed */
		1,		/* interleave factor */
		0x1B,		/* gap 3 length */
		0x54		/* format gap 3 length */
	},
	{	/* [1] = struct fdattr fdattr_5Q */
		300,		/* rotational speed */
		1,		/* interleave factor */
		0x1B,		/* gap 3 length */
		0x54		/* format gap 3 length */
	},
	{	/* [2] = struct fdattr fdattr_5D9 */
		300,		/* rotational speed */
		1,		/* interleave factor */
		0x2A,		/* gap 3 length */
		0x50		/* format gap 3 length */
	},
	{	/* [3] = struct fdattr fdattr_5D8 */
		300,		/* rotational speed */
		1,		/* interleave factor */
		0x2A,		/* gap 3 length */
		0x50		/* format gap 3 length */
	},
	{	/* [4] = struct fdattr fdattr_5D4 */
		300,		/* rotational speed */
		1,		/* interleave factor */
		0x80,		/* gap 3 length */
		0xF0		/* format gap 3 length */
	},
	{	/* [5] = struct fdattr fdattr_5D16 */
		300,		/* rotational speed */
		1,		/* interleave factor */
		0x20,		/* gap 3 length */
		0x32		/* format gap 3 length */
	},
	{	/* [6] = struct fdattr fdattr_3E */
		300,		/* rotational speed */
		1,		/* interleave factor */
		0x1B,		/* gap 3 length */
		0x53		/* format gap 3 length */
	},
	{	/* [7] = struct fdattr fdattr_3H */
		300,		/* rotational speed */
		1,		/* interleave factor */
		0x1B,		/* gap 3 length */
		0x6C		/* format gap 3 length */
	},
	{	/* [8] = struct fdattr fdattr_3I */
		300,		/* rotational speed */
		1,		/* interleave factor */
		4,		/* gap 3 length */
		12		/* format gap 3 length */
	},
	{	/* [9] = struct fdattr fdattr_3M */
		360,		/* rotational speed */
		1,		/* interleave factor */
		0x35,		/* gap 3 length */
		0x74		/* format gap 3 length */
	},
	{	/* [10] = struct fdattr fdattr_3D */
		300,		/* rotational speed */
		1,		/* interleave factor */
		0x1B,		/* gap 3 length */
		0x50		/* format gap 3 length */
	}
};

static int nfdtypes = sizeof (fdtypes) / sizeof (fdtypes[0]);


static struct fd_char dfc_80x36 = {
		3,		/* medium */
		1000,		/* transfer rate */
		80,		/* number of cylinders */
		2,		/* number of heads */
		512,		/* sector size */
		36,		/* sectors per track */
		1,		/* # steps per data track */
};
static struct fd_char dfc_80x21 = {
		3,		/* medium */
		500,		/* transfer rate */
		80,		/* number of cylinders */
		2,		/* number of heads */
		512,		/* sector size */
		21,		/* sectors per track */
		1,		/* # steps per data track */
};
static struct fd_char dfc_80x18 = {
		3,		/* medium */
		500,		/* transfer rate */
		80,		/* number of cylinders */
		2,		/* number of heads */
		512,		/* sector size */
		18,		/* sectors per track */
		1,		/* # steps per data track */
};
static struct fd_char dfc_80x15 = {
		5,		/* medium */
		500,		/* transfer rate */
		80,		/* number of cylinders */
		2,		/* number of heads */
		512,		/* sector size */
		15,		/* sectors per track */
		1,		/* # steps per data track */
};
static struct fd_char dfc_80x9 = {
		3,		/* medium */
		250,		/* transfer rate */
		80,		/* number of cylinders */
		2,		/* number of heads */
		512,		/* sector size */
		9,		/* sectors per track */
		1,		/* # steps per data track */
};
static struct fd_char dfc_77x8 = {
		3,		/* medium */
		500,		/* transfer rate */
		77,		/* number of cylinders */
		2,		/* number of heads */
		1024,		/* sector size */
		8,		/* sectors per track */
		1,		/* # steps per data track */
};
static struct fd_char dfc_40x16 = {
		5,		/* medium */
		250,		/* transfer rate */
		40,		/* number of cylinders */
		2,		/* number of heads */
		256,		/* sector size */
		16,		/* sectors per track */
		1,		/* # steps per data track */
};
static struct fd_char dfc_40x9 = {
		5,		/* medium */
		250,		/* transfer rate */
		40,		/* number of cylinders */
		2,		/* number of heads */
		512,		/* sector size */
		9,		/* sectors per track */
		1,		/* # steps per data track */
};
static struct fd_char dfc_40x8 = {
		5,		/* medium */
		250,		/* transfer rate */
		40,		/* number of cylinders */
		2,		/* number of heads */
		512,		/* sector size */
		8,		/* sectors per track */
		1,		/* # steps per data track */
};
static struct fd_char dfc_40x4 = {
		5,		/* medium */
		250,		/* transfer rate */
		40,		/* number of cylinders */
		2,		/* number of heads */
		1024,		/* sector size */
		4,		/* sectors per track */
		1,		/* # steps per data track */
};

static struct fd_char *defchar[] = {
		&dfc_80x15,	/* FMT_5H */
		&dfc_80x9,	/* FMT_5Q */
		&dfc_40x9,	/* FMT_5D9 */
		&dfc_40x8,	/* FMT_5D8 */
		&dfc_40x4,	/* FMT_5D4 */
		&dfc_40x16,	/* FMT_5D16 */
		&dfc_80x36,	/* FMT_3E */
		&dfc_80x18,	/* FMT_3H */
		&dfc_80x21,	/* FMT_3I */
		&dfc_77x8,	/* FMT_3M */
		&dfc_80x9	/* FMT_3D */
};


static struct fd_drive dfd_350ED = {
		0,	/* ejectable,  does the drive support eject? */
		4,	/* maxsearch, size of per-unit search table */
		0,	/* cyl to start write precompensation */
		80,	/* cyl to start reducing write current */
		1,	/* step width pulse in 1 us units */
		30,	/* step rate in 100 us units */
		150,	/* head settle delay, in 100 us units */
		150,	/* head load delay, in 100 us units */
		2560,	/* head unload delay, in 100 us units */
		3,	/* motor on delay, in 100 ms units */
		20,	/* motor off delay, in 100 ms units */
		65,	/* precomp level, bit shift, in nano-secs */
		0,	/* pins, defines meaning of pin 1, 2, 4, and 34 */
		0,	/* flags, TRUE READY, Starting Sector #, & Motor On */
};
static struct fd_drive dfd_350HD = {
		0,	/* ejectable,  does the drive support eject? */
		4,	/* maxsearch, size of per-unit search table */
		0,	/* cyl to start write prcompensation */
		80,	/* cyl to start reducing write current */
		1,	/* step width pulse in 1 us units */
		30,	/* step rate in 100 us units */
		150,	/* head settle delay, in 100 us units */
		150,	/* head load delay, in 100 us units */
		2560,	/* head unload delay, in 100 us units */
		3,	/* motor on delay, in 100 ms units */
		20,	/* motor off delay, in 100 ms units */
		125,	/* precomp level, bit shift, in nano-secs */
		0,	/* pins, defines meaning of pin 1, 2, 4, and 34 */
		0,	/* flags, TRUE READY, Starting Sector #, & Motor On */
};
static struct fd_drive dfd_525HD = {
		0,	/* ejectable,  does the drive support eject? */
		6,	/* maxsearch, size of per-unit search table */
		43,	/* cyl to start write prcompensation */
		80,	/* cyl to start reducing write current */
		1,	/* step width pulse in 1 us units */
		30,	/* step rate in 100 us units */
		150,	/* head settle delay, in 100 us units */
		150,	/* head load delay, in 100 us units */
		2560,	/* head unload delay, in 100 us units */
		5,	/* motor on delay, in 100 ms units */
		20,	/* motor off delay, in 100 ms units */
		175,	/* precomp level, bit shift, in nano-secs */
		0,	/* pins, defines meaning of pin 1, 2, 4, and 34 */
		0,	/* flags, TRUE READY, Starting Sector #, & Motor On */
};
static struct fd_drive dfd_525DD = {
		0,	/* ejectable,  does the drive support eject? */
		4,	/* maxsearch, size of per-unit search table */
		22,	/* cyl to start write prcompensation */
		40,	/* cyl to start reducing write current */
		1,	/* step width pulse in 1 us units */
		60,	/* step rate in 100 us units */
		150,	/* head settle delay, in 100 us units */
		150,	/* head load delay, in 100 us units */
		2560,	/* head unload delay, in 100 us units */
		5,	/* motor on delay, in 100 ms units */
		20,	/* motor off delay, in 100 ms units */
		250,	/* precomp level, bit shift, in nano-secs */
		0,	/* pins, defines meaning of pin 1, 2, 4, and 34 */
		0,	/* flags, TRUE READY, Starting Sector #, & Motor On */
};

/*
 * Default partition maps
 */
static struct partition dpt_80x36[NDKMAP] = {
		{ 0, 0, 0,	79*2*36 },	/* part 0 - all but last cyl */
		{ 0, 0, 79*2*36, 1*2*36 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	80*2*36 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct partition dpt_80x21[NDKMAP] = {
		{ 0, 0, 0,	79*2*21 },	/* part 0 - all but last cyl */
		{ 0, 0, 79*2*21, 1*2*21 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	80*2*21 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct partition dpt_80x18[NDKMAP] = {
		{ 0, 0, 0,	79*2*18 },	/* part 0 - all but last cyl */
		{ 0, 0, 79*2*18, 1*2*18 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	80*2*18 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct partition dpt_80x15[NDKMAP] = {
		{ 0, 0, 0,	79*2*15 },	/* part 0 - all but last cyl */
		{ 0, 0, 79*2*15, 1*2*15 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	80*2*15 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct partition dpt_80x9[NDKMAP] = {
		{ 0, 0, 0,	79*2*9 },	/* part 0 - all but last cyl */
		{ 0, 0, 79*2*9,	 1*2*9 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	80*2*9 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct partition dpt_77x8[NDKMAP] = {
		/* double number of blocks since sector size is 1024 */
		{ 0, 0, 0,	 76*2*8*2 },	/* part 0 - all but last cyl */
		{ 0, 0, 76*2*8*2, 1*2*8*2 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	 77*2*8*2 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct partition dpt_40x16[NDKMAP] = {
		/* halve number of blocks since sector size is 256 */
		{ 0, 0, 0,	 39*2*16/2 },	/* part 0 - all but last cyl */
		{ 0, 0, 39*2*16/2, 1*2*16/2 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	 40*2*16/2 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct partition dpt_40x9[NDKMAP] = {
		{ 0, 0, 0,	39*2*9 },	/* part 0 - all but last cyl */
		{ 0, 0, 39*2*9,  1*2*9 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	40*2*9 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct partition dpt_40x8[NDKMAP] = {
		/* double number of blocks since sector size is 1024 */
		{ 0, 0, 0,	 39*2*8*2 },	/* part 0 - all but last cyl */
		{ 0, 0, 39*2*8*2, 1*2*8*2 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	 40*2*8*2 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};
static struct partition dpt_40x4[NDKMAP] = {
		{ 0, 0, 0,	39*2*4 },	/* part 0 - all but last cyl */
		{ 0, 0, 39*2*4,  1*2*4 },	/* part 1 - just the last cyl */
		{ 0, 0, 0,	40*2*4 },	/* part 2 - "the whole thing" */
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 },
		{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
};

static struct partition *fdparts[] = {
		dpt_80x15,	/* FMT_5H */
		dpt_80x9,	/* FMT_5Q */
		dpt_40x9,	/* FMT_5D9 */
		dpt_40x8,	/* FMT_5D8 */
		dpt_40x4,	/* FMT_5D4 */
		dpt_40x16,	/* FMT_5D16 */
		dpt_80x36,	/* FMT_3E */
		dpt_80x18,	/* FMT_3H */
		dpt_80x21,	/* FMT_3I */
		dpt_77x8,	/* FMT_3M */
		dpt_80x9	/* FMT_3D */
};

#ifdef	__cplusplus
}
#endif

#endif	/* !_SYS_FDMEDIA_H */