FreeBSD/Linux Kernel Cross Reference
sys/sqtzdc/zdbad.h
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: zdbad.h,v $
32 * Revision 2.3 91/07/31 18:08:16 dbg
33 * Changed copyright.
34 * [91/07/31 dbg]
35 *
36 * Revision 2.2 91/05/08 13:08:08 dbg
37 * Adapted for pure Mach kernel.
38 * [90/10/04 dbg]
39 *
40 */
41
42 /*
43 * $Header: zdbad.h,v 2.3 91/07/31 18:08:16 dbg Exp $
44 *
45 * zdbad.h
46 * ZDC bad block list and MFG defect list structure definitions
47 */
48
49 /*
50 * Revision 1.1 89/07/05 13:21:05 kak
51 * Initial revision
52 *
53 */
54 #ifndef _SQTZDC_ZDBAD_H_
55 #define _SQTZDC_ZDBAD_H_
56
57 #include <sys/types.h>
58
59 #define BZ_NBADCOPY 5 /* number of bad block list copies */
60
61 /*
62 * structure of bad block list
63 */
64
65 struct zdbad {
66 long bz_csn; /* bad block list checksum */
67 u_short bz_nelem; /* nbr of elements in list */
68 u_short bz_nsnf; /* nbr of BZ_SNF entries in list */
69 struct bz_bad {
70 struct bz_diskaddr {
71 u_char bd_sect; /* sector */
72 u_char bd_head; /* head */
73 u_short bd_cyl : 13, /* cylinder */
74 bd_rtype : 2, /* replacement type */
75 bd_ftype : 1; /* failure type */
76 } bz_badaddr; /* Bad disk address */
77 struct diskaddr bz_rpladdr; /* Replacement disk address */
78 } bz_bad[1]; /* size is disk type dependent */
79 };
80
81 #define bz_cyl bz_badaddr.bd_cyl
82 #define bz_head bz_badaddr.bd_head
83 #define bz_sect bz_badaddr.bd_sect
84 #define bz_rtype bz_badaddr.bd_rtype
85 #define bz_ftype bz_badaddr.bd_ftype
86
87 /*
88 * Replacement types
89 */
90 #define BZ_PHYS 0x0 /* Physical disk address */
91 #define BZ_AUTOREVECT 0x1 /* Autorevector for replacement */
92 #define BZ_SNF 0x2 /* SNF - driver must revector */
93
94 /*
95 * Failure types
96 */
97 #define BZ_BADHEAD 0x0
98 #define BZ_BADDATA 0x1
99
100 /*
101 * Structure of manufacturer's defect list.
102 */
103
104 struct bad_mfg {
105 long bm_csn; /* mfg's defect list checksum */
106 u_short bm_nelem; /* number of entries in bm_mfgbad */
107
108 /* defect location */
109 struct bm_mfgbad {
110 u_short bm_cyl; /* cylinder */
111 u_short bm_len; /* length of defect */
112 u_int bm_pos : 24, /* bytes from index */
113 bm_head : 8; /* head */
114 } bm_mfgbad[1]; /* size is disk type dependent */
115 };
116
117 #endif /* _SQTZDC_ZDBAD_H_ */
Cache object: f4c0c749bd05ea6e9362ae29d7fea6f1
|