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 #include <sys/types.h>
36
37 struct bio_common {
38 void *bc_cookie;
39 };
40
41
42 #define BIOCLOCATE _IOWR('B', 0, struct bio_locate)
43 struct bio_locate {
44 void *bl_cookie;
45 char *bl_name;
46 };
47
48 #ifdef _KERNEL
49 int bio_register(struct device *, int (*)(struct device *, u_long,
50 caddr_t));
51 void bio_unregister(struct device *);
52 #endif
53
54 #define BIOCINQ _IOWR('B', 32, struct bioc_inq)
55 struct bioc_inq {
56 void *bi_cookie;
57
58 char bi_dev[16];
59 int bi_novol;
60 int bi_nodisk;
61 };
62
63 #define BIOCDISK _IOWR('B', 33, struct bioc_disk)
64
65 struct bioc_disk {
66 void *bd_cookie;
67
68 u_int16_t bd_channel;
69 u_int16_t bd_target;
70 u_int16_t bd_lun;
71 u_int16_t bd_other_id;
72
73 int bd_volid;
74 int bd_diskid;
75 int bd_status;
76 #define BIOC_SDONLINE 0x00
77 #define BIOC_SDONLINE_S "Online"
78 #define BIOC_SDOFFLINE 0x01
79 #define BIOC_SDOFFLINE_S "Offline"
80 #define BIOC_SDFAILED 0x02
81 #define BIOC_SDFAILED_S "Failed"
82 #define BIOC_SDREBUILD 0x03
83 #define BIOC_SDREBUILD_S "Rebuild"
84 #define BIOC_SDHOTSPARE 0x04
85 #define BIOC_SDHOTSPARE_S "Hot spare"
86 #define BIOC_SDUNUSED 0x05
87 #define BIOC_SDUNUSED_S "Unused"
88 #define BIOC_SDSCRUB 0x06
89 #define BIOC_SDSCRUB_S "Scrubbing"
90 #define BIOC_SDINVALID 0xff
91 #define BIOC_SDINVALID_S "Invalid"
92 u_quad_t bd_size;
93
94 char bd_vendor[32];
95 char bd_serial[32];
96 char bd_procdev[16];
97 };
98
99 #define BIOCVOL _IOWR('B', 34, struct bioc_vol)
100
101 struct bioc_vol {
102 void *bv_cookie;
103 int bv_volid;
104
105 int16_t bv_percent;
106 u_int16_t bv_seconds;
107
108 int bv_status;
109 #define BIOC_SVONLINE 0x00
110 #define BIOC_SVONLINE_S "Online"
111 #define BIOC_SVOFFLINE 0x01
112 #define BIOC_SVOFFLINE_S "Offline"
113 #define BIOC_SVDEGRADED 0x02
114 #define BIOC_SVDEGRADED_S "Degraded"
115 #define BIOC_SVBUILDING 0x03
116 #define BIOC_SVBUILDING_S "Building"
117 #define BIOC_SVSCRUB 0x04
118 #define BIOC_SVSCRUB_S "Scrubbing"
119 #define BIOC_SVREBUILD 0x05
120 #define BIOC_SVREBUILD_S "Rebuild"
121 #define BIOC_SVINVALID 0xff
122 #define BIOC_SVINVALID_S "Invalid"
123 u_quad_t bv_size;
124 int bv_level;
125 int bv_nodisk;
126
127 char bv_dev[16];
128 char bv_vendor[32];
129 };
130
131 #define BIOCALARM _IOWR('B', 35, struct bioc_alarm)
132 struct bioc_alarm {
133 void *ba_cookie;
134 int ba_opcode;
135
136 int ba_status;
137 #define BIOC_SADISABLE 0x00
138 #define BIOC_SAENABLE 0x01
139 #define BIOC_SASILENCE 0x02
140 #define BIOC_GASTATUS 0x03
141 #define BIOC_SATEST 0x04
142 };
143
144 #define BIOCBLINK _IOWR('B', 36, struct bioc_blink)
145 struct bioc_blink {
146 void *bb_cookie;
147 u_int16_t bb_channel;
148 u_int16_t bb_target;
149
150 int bb_status;
151 #define BIOC_SBUNBLINK 0x00
152 #define BIOC_SBBLINK 0x01
153 #define BIOC_SBALARM 0x02
154 };
155
156 #define BIOCSETSTATE _IOWR('B', 37, struct bioc_setstate)
157 struct bioc_setstate {
158 void *bs_cookie;
159 u_int16_t bs_channel;
160 u_int16_t bs_target;
161 u_int16_t bs_lun;
162 u_int16_t bs_other_id;
163
164 int bs_status;
165 #define BIOC_SSONLINE 0x00
166 #define BIOC_SSOFFLINE 0x01
167 #define BIOC_SSHOTSPARE 0x02
168 #define BIOC_SSREBUILD 0x03
169 int bs_volid;
170 };
171
172 #define BIOCCREATERAID _IOWR('B', 38, struct bioc_createraid)
173 struct bioc_createraid {
174 void *bc_cookie;
175 void *bc_dev_list;
176 u_int16_t bc_dev_list_len;
177 #define BIOC_CRMAXLEN 1024
178 u_int16_t bc_level;
179 u_int32_t bc_flags;
180 #define BIOC_SCFORCE 0x01
181 #define BIOC_SCDEVT 0x02
182 #define BIOC_SCNOAUTOASSEMBLE 0x04
183 };
184
185
186 #define BIOC_INQ 0x0001
187 #define BIOC_DISK 0x0002
188 #define BIOC_VOL 0x0004
189 #define BIOC_ALARM 0x0008
190 #define BIOC_BLINK 0x0010
191 #define BIOC_SETSTATE 0x0020
192 #define BIOC_CREATERAID 0x0040
193
194
195 #define BIOC_DEVLIST 0x10000