Print this page
cstyle sort of updates
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/cdio.h
+++ new/usr/src/uts/common/sys/cdio.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 #ifndef _SYS_CDIO_H
28 28 #define _SYS_CDIO_H
29 29
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 30 #ifdef __cplusplus
33 31 extern "C" {
34 32 #endif
35 33
36 34 /*
37 35 * CDROM io controls type definitions
38 36 */
39 37 struct cdrom_msf {
40 38 unsigned char cdmsf_min0; /* starting minute */
41 39 unsigned char cdmsf_sec0; /* starting second */
42 40 unsigned char cdmsf_frame0; /* starting frame */
43 41 unsigned char cdmsf_min1; /* ending minute */
44 42 unsigned char cdmsf_sec1; /* ending second */
45 43 unsigned char cdmsf_frame1; /* ending frame */
46 44 };
47 45
48 46 struct cdrom_ti {
49 47 unsigned char cdti_trk0; /* starting track */
50 48 unsigned char cdti_ind0; /* starting index */
51 49 unsigned char cdti_trk1; /* ending track */
52 50 unsigned char cdti_ind1; /* ending index */
53 51 };
54 52
55 53 struct cdrom_tochdr {
56 54 unsigned char cdth_trk0; /* starting track */
57 55 unsigned char cdth_trk1; /* ending track */
58 56 };
59 57
60 58 struct cdrom_tocentry {
61 59 unsigned char cdte_track;
62 60 unsigned cdte_adr :4;
63 61 unsigned cdte_ctrl :4;
64 62 unsigned char cdte_format;
65 63 union {
66 64 struct {
67 65 unsigned char minute;
68 66 unsigned char second;
69 67 unsigned char frame;
70 68 } msf;
71 69 int lba;
72 70 } cdte_addr;
73 71 unsigned char cdte_datamode;
74 72 };
75 73
76 74 /*
77 75 * CDROM address format definition, for use with struct cdrom_tocentry
78 76 */
79 77 #define CDROM_LBA 0x01
80 78 #define CDROM_MSF 0x02
81 79
82 80 /*
83 81 * Bitmask for CD-ROM data track in the cdte_ctrl field
84 82 * A track is either data or audio.
85 83 */
86 84 #define CDROM_DATA_TRACK 0x04
87 85
88 86 /*
89 87 * For CDROMREADTOCENTRY, set the cdte_track to CDROM_LEADOUT to get
90 88 * the information for the leadout track.
91 89 */
92 90 #define CDROM_LEADOUT 0xAA
93 91
94 92 struct cdrom_subchnl {
95 93 unsigned char cdsc_format;
96 94 unsigned char cdsc_audiostatus;
97 95 unsigned cdsc_adr: 4;
98 96 unsigned cdsc_ctrl: 4;
99 97 unsigned char cdsc_trk;
100 98 unsigned char cdsc_ind;
101 99 union {
102 100 struct {
103 101 unsigned char minute;
104 102 unsigned char second;
105 103 unsigned char frame;
106 104 } msf;
107 105 int lba;
108 106 } cdsc_absaddr;
109 107 union {
110 108 struct {
111 109 unsigned char minute;
112 110 unsigned char second;
113 111 unsigned char frame;
114 112 } msf;
115 113 int lba;
116 114 } cdsc_reladdr;
117 115 };
118 116
119 117 /*
120 118 * Definition for audio status returned from Read Sub-channel
121 119 */
122 120 #define CDROM_AUDIO_INVALID 0x00 /* audio status not supported */
123 121 #define CDROM_AUDIO_PLAY 0x11 /* audio play operation in progress */
124 122 #define CDROM_AUDIO_PAUSED 0x12 /* audio play operation paused */
125 123 #define CDROM_AUDIO_COMPLETED 0x13 /* audio play successfully completed */
126 124 #define CDROM_AUDIO_ERROR 0x14 /* audio play stopped due to error */
127 125 #define CDROM_AUDIO_NO_STATUS 0x15 /* no current audio status to return */
128 126
129 127 /*
130 128 * definition of audio volume control structure
131 129 */
132 130 struct cdrom_volctrl {
133 131 unsigned char channel0;
134 132 unsigned char channel1;
135 133 unsigned char channel2;
136 134 unsigned char channel3;
137 135 };
138 136
139 137 struct cdrom_read {
140 138 int cdread_lba;
141 139 caddr_t cdread_bufaddr;
142 140 int cdread_buflen;
143 141 };
144 142
145 143 #if defined(_SYSCALL32)
146 144
147 145 struct cdrom_read32 {
148 146 int cdread_lba;
149 147 caddr32_t cdread_bufaddr;
150 148 int cdread_buflen;
151 149 };
152 150
153 151 #define cdrom_read32tocdrom_read(cdrd32, cdrd) \
154 152 cdrd->cdread_lba = cdrd32->cdread_lba; \
155 153 cdrd->cdread_bufaddr = (caddr_t)(uintptr_t)cdrd32->cdread_bufaddr; \
156 154 cdrd->cdread_buflen = cdrd32->cdread_buflen
157 155
158 156 #define cdrom_readtocdrom_read32(cdrd, cdrd32) \
159 157 cdrd32->cdread_lba = cdrd->cdread_lba; \
160 158 cdrd32->cdread_bufaddr = (caddr32_t)(uintptr_t)cdrd->cdread_bufaddr; \
161 159 cdrd32->cdread_buflen = cdrd->cdread_buflen
162 160
163 161 #endif /* _SYSCALL32 */
164 162
165 163 /*
166 164 * Definition of CD/DA structure
167 165 */
168 166 struct cdrom_cdda {
169 167 unsigned int cdda_addr;
170 168 unsigned int cdda_length;
171 169 caddr_t cdda_data;
172 170 unsigned char cdda_subcode;
173 171 };
174 172
175 173 #if defined(_SYSCALL32)
176 174 struct cdrom_cdda32 {
177 175 unsigned int cdda_addr;
178 176 unsigned int cdda_length;
179 177 caddr32_t cdda_data;
180 178 unsigned char cdda_subcode;
181 179 };
182 180
183 181 #define cdrom_cdda32tocdrom_cdda(cdda32, cdda) \
184 182 cdda->cdda_addr = cdda32->cdda_addr; \
185 183 cdda->cdda_length = cdda32->cdda_length; \
186 184 cdda->cdda_data = (caddr_t)(uintptr_t)cdda32->cdda_data; \
187 185 cdda->cdda_subcode = cdda32->cdda_subcode
188 186
189 187 #define cdrom_cddatocdrom_cdda32(cdda, cdda32) \
190 188 cdda32->cdda_addr = cdda->cdda_addr; \
191 189 cdda32->cdda_length = cdda->cdda_length; \
192 190 cdda32->cdda_data = (caddr32_t)(uintptr_t)cdda->cdda_data; \
193 191 cdda32->cdda_subcode = cdda->cdda_subcode
194 192
195 193 #endif /* _SYSCALL32 */
196 194
197 195 /*
198 196 * Definitions for cdda_subcode field
199 197 */
200 198 #define CDROM_DA_NO_SUBCODE 0x00 /* CD/DA data with no subcode */
201 199 #define CDROM_DA_SUBQ 0x01 /* CD/DA data with sub Q code */
202 200 #define CDROM_DA_ALL_SUBCODE 0x02 /* CD/DA data with all subcode */
203 201 #define CDROM_DA_SUBCODE_ONLY 0x03 /* All subcode only */
204 202
205 203 /*
206 204 * Definition of CD/XA structure
207 205 */
208 206 struct cdrom_cdxa {
209 207 unsigned int cdxa_addr;
210 208 unsigned int cdxa_length;
211 209 caddr_t cdxa_data;
212 210 unsigned char cdxa_format;
213 211 };
214 212
215 213 #if defined(_SYSCALL32)
216 214
217 215 struct cdrom_cdxa32 {
218 216 unsigned int cdxa_addr;
219 217 unsigned int cdxa_length;
220 218 caddr32_t cdxa_data;
221 219 unsigned char cdxa_format;
222 220 };
223 221
224 222 #define cdrom_cdxa32tocdrom_cdxa(cdxa32, cdxa) \
225 223 cdxa->cdxa_addr = cdxa32->cdxa_addr; \
226 224 cdxa->cdxa_length = cdxa32->cdxa_length; \
227 225 cdxa->cdxa_data = (caddr_t)(uintptr_t)cdxa32->cdxa_data; \
228 226 cdxa->cdxa_format = cdxa32->cdxa_format
229 227
230 228 #define cdrom_cdxatocdrom_cdxa32(cdxa, cdxa32) \
231 229 cdxa32->cdxa_addr = cdxa->cdxa_addr; \
232 230 cdxa32->cdxa_length = cdxa->cdxa_length; \
233 231 cdxa32->cdxa_data = (caddr32_t)(uintptr_t)cdxa->cdxa_data; \
234 232 cdxa32->cdxa_format = cdxa->cdxa_format
235 233
236 234 #endif /* _SYSCALL32 */
237 235
238 236 /*
239 237 * Definitions for cdxa_format field
240 238 */
241 239 #define CDROM_XA_DATA 0x00 /* CD/XA data only */
242 240 #define CDROM_XA_SECTOR_DATA 0x01 /* CD/XA all sector data */
243 241 #define CDROM_XA_DATA_W_ERROR 0x02 /* CD/XA data with error flags data */
244 242
245 243 /*
246 244 * Definition of subcode structure
247 245 */
248 246 struct cdrom_subcode {
249 247 unsigned int cdsc_length;
250 248 caddr_t cdsc_addr;
251 249 };
252 250
253 251 #if defined(_SYSCALL32)
254 252
255 253 struct cdrom_subcode32 {
256 254 unsigned int cdsc_length;
257 255 caddr32_t cdsc_addr;
258 256 };
259 257
260 258 #define cdrom_subcode32tocdrom_subcode(cdsc32, cdsc) \
261 259 cdsc->cdsc_length = cdsc32->cdsc_length; \
262 260 cdsc->cdsc_addr = (caddr_t)(uintptr_t)cdsc32->cdsc_addr
263 261
264 262 #define cdrom_subcodetocdrom_subcode32(cdsc, cdsc32) \
265 263 cdsc32->cdsc_length = cdsc->cdsc_length; \
266 264 cdsc32->cdsc_addr = (caddr32_t)(uintptr_t)cdsc->cdsc_addr
267 265
268 266 #endif /* _SYSCALL32 */
269 267
270 268 /*
271 269 * Definitions for block size supported
272 270 */
273 271 #define CDROM_BLK_512 512
274 272 #define CDROM_BLK_1024 1024
275 273 #define CDROM_BLK_2048 2048
276 274 #define CDROM_BLK_2056 2056
277 275 #define CDROM_BLK_2324 2324
278 276 #define CDROM_BLK_2336 2336
279 277 #define CDROM_BLK_2340 2340
280 278 #define CDROM_BLK_2352 2352
281 279 #define CDROM_BLK_2368 2368
282 280 #define CDROM_BLK_2448 2448
283 281 #define CDROM_BLK_2646 2646
284 282 #define CDROM_BLK_2647 2647
285 283 #define CDROM_BLK_SUBCODE 96
286 284
287 285 /*
288 286 * Definitions for drive speed supported
289 287 */
290 288 #define CDROM_NORMAL_SPEED 0x00
291 289 #define CDROM_DOUBLE_SPEED 0x01
292 290 #define CDROM_QUAD_SPEED 0x03
293 291 #define CDROM_TWELVE_SPEED 0x0C
294 292 #define CDROM_MAXIMUM_SPEED 0xff
295 293
296 294 /*
297 295 * CDROM io control commands
298 296 */
299 297 #define CDIOC (0x04 << 8)
300 298 #define CDROMPAUSE (CDIOC|151) /* Pause Audio Operation */
301 299 #define CDROMRESUME (CDIOC|152) /* Resume paused Audio Operation */
302 300 #define CDROMPLAYMSF (CDIOC|153) /* Play Audio MSF */
303 301 #define CDROMPLAYTRKIND (CDIOC|154) /* Play Audio Track/index */
304 302 #define CDROMREADTOCHDR (CDIOC|155) /* Read TOC header */
305 303 #define CDROMREADTOCENTRY (CDIOC|156) /* Read a TOC entry */
306 304 #define CDROMSTOP (CDIOC|157) /* Stop the cdrom drive */
307 305 #define CDROMSTART (CDIOC|158) /* Start the cdrom drive */
308 306 #define CDROMEJECT (CDIOC|159) /* Ejects the cdrom caddy */
309 307 #define CDROMVOLCTRL (CDIOC|160) /* control output volume */
310 308 #define CDROMSUBCHNL (CDIOC|161) /* read the subchannel data */
311 309 #define CDROMREADMODE2 (CDIOC|162) /* read CDROM mode 2 data */
312 310 #define CDROMREADMODE1 (CDIOC|163) /* read CDROM mode 1 data */
313 311
314 312 #define CDROMREADOFFSET (CDIOC|164) /* read multi-session offset */
315 313
316 314 #define CDROMGBLKMODE (CDIOC|165) /* get current block mode */
317 315 #define CDROMSBLKMODE (CDIOC|166) /* set current block mode */
318 316 #define CDROMCDDA (CDIOC|167) /* read CD/DA data */
319 317 #define CDROMCDXA (CDIOC|168) /* read CD/XA data */
320 318 #define CDROMSUBCODE (CDIOC|169) /* read subcode */
321 319 #define CDROMGDRVSPEED (CDIOC|170) /* get current drive speed */
322 320 #define CDROMSDRVSPEED (CDIOC|171) /* set current drive speed */
323 321
324 322 #define CDROMCLOSETRAY (CDIOC|172) /* close cd tray,load media */
325 323
326 324 /*
327 325 * Additional commands for CD-ROM
328 326 */
329 327 /*
330 328 *
331 329 * Group 2 Commands
332 330 *
333 331 */
334 332 #define SCMD_READ_SUBCHANNEL 0x42 /* optional SCSI command */
335 333 #define SCMD_READ_TOC 0x43 /* optional SCSI command */
336 334 #define SCMD_READ_HEADER 0x44 /* optional SCSI command */
337 335 #define SCMD_PLAYAUDIO10 0x45 /* optional SCSI command */
338 336 #define SCMD_PLAYAUDIO_MSF 0x47 /* optional SCSI command */
339 337 #define SCMD_PLAYAUDIO_TI 0x48 /* optional SCSI command */
340 338 #define SCMD_PLAYTRACK_REL10 0x49 /* optional SCSI command */
341 339 #define SCMD_PAUSE_RESUME 0x4B /* optional SCSI command */
342 340
343 341 /*
344 342 *
345 343 * Group 5 Commands
346 344 *
347 345 */
348 346 #define SCMD_PLAYAUDIO12 0xA5 /* optional SCSI command */
349 347 #define SCMD_PLAYTRACK_REL12 0xA9 /* optional SCSI command */
350 348 #define SCMD_SET_CDROM_SPEED 0xBB /* optional SCSI command */
351 349 #define SCMD_READ_CD 0xBE /* Universal way of accessing CD data */
352 350
353 351 /*
354 352 * These defines are for SCMD_READ_CD command.
355 353 * See Expected Sector Type Field Definition (SCSI MMC-2 Spec section 6.1.15)
356 354 * This information is used to figure out which block size to use.
357 355 */
358 356 #define READ_CD_EST_ALLTYPE 0x0 /* All Types */
359 357 #define READ_CD_EST_CDDA 0x1 /* Only CD-DA */
360 358 #define READ_CD_EST_MODE1 0x2 /* Only Yellow Book 2048 bytes */
361 359 #define READ_CD_EST_MODE2 0x3 /* Only Yellow Book 2336 byte sectors */
362 360 #define READ_CD_EST_MODE2FORM1 0x4 /* Only sectors with 2048 bytes */
363 361 #define READ_CD_EST_MODE2FORM2 0x5 /* Only sectors with 2324 bytes */
364 362 #define READ_CD_EST_RSVD1 0x6 /* reserved */
365 363 #define READ_CD_EST_RSVD2 0x7 /* reserved */
366 364
367 365
368 366 /*
369 367 *
370 368 * Group 6 Commands
371 369 *
372 370 */
373 371 #define SCMD_CD_PLAYBACK_CONTROL 0xC9 /* SONY unique SCSI command */
374 372 #define SCMD_CD_PLAYBACK_STATUS 0xC4 /* SONY unique SCSI command */
↓ open down ↓ |
333 lines elided |
↑ open up ↑ |
375 373 #define SCMD_READ_CDDA 0xD8 /* Vendor unique SCSI command */
376 374 #define SCMD_READ_CDXA 0xDB /* Vendor unique SCSI command */
377 375 #define SCMD_READ_ALL_SUBCODES 0xDF /* Vendor unique SCSI command */
378 376
379 377 #define CDROM_MODE2_SIZE 2336
380 378
381 379 /*
382 380 * scsi_key_strings for CDROM cdio SCMD_ definitions
383 381 */
384 382 #define SCSI_CMDS_KEY_STRINGS_CDIO \
385 -/* 0x42 */ SCMD_READ_SUBCHANNEL, "read_subchannel", \
386 -/* 0x43 */ SCMD_READ_TOC, "read_toc", \
387 -/* 0x44 */ SCMD_REPORT_DENSITIES | \
388 - SCMD_READ_HEADER, "report_densities/read_header", \
389 -/* 0x45 */ SCMD_PLAYAUDIO10, "playaudio", \
390 -/* 0x46 */ SCMD_GET_CONFIGURATION, "get_configuration", \
391 -/* 0x47 */ SCMD_PLAYAUDIO_MSF, "playaudio_msf", \
392 -/* 0x48 */ SCMD_PLAYAUDIO_TI, "playaudio_ti", \
393 -/* 0x49 */ SCMD_PLAYTRACK_REL10, "playaudio_rel", \
394 -/* 0x4b */ SCMD_PAUSE_RESUME, "pause_resume", \
383 +/* 0x42 */ { SCMD_READ_SUBCHANNEL, "read_subchannel" }, \
384 +/* 0x43 */ { SCMD_READ_TOC, "read_toc" }, \
385 +/* 0x44 */ { SCMD_REPORT_DENSITIES | \
386 + SCMD_READ_HEADER, "report_densities/read_header" }, \
387 +/* 0x45 */ { SCMD_PLAYAUDIO10, "playaudio" }, \
388 +/* 0x46 */ { SCMD_GET_CONFIGURATION, "get_configuration" }, \
389 +/* 0x47 */ { SCMD_PLAYAUDIO_MSF, "playaudio_msf" }, \
390 +/* 0x48 */ { SCMD_PLAYAUDIO_TI, "playaudio_ti" }, \
391 +/* 0x49 */ { SCMD_PLAYTRACK_REL10, "playaudio_rel" }, \
392 +/* 0x4b */ { SCMD_PAUSE_RESUME, "pause_resume" }, \
395 393 \
396 -/* 0xa5 */ SCMD_PLAYAUDIO12, "playaudio(12)", \
397 -/* 0xa9 */ SCMD_PLAYTRACK_REL12, "playtrack_rel", \
398 -/* 0xbb */ SCMD_SET_CDROM_SPEED, "set_cd_speed", \
399 -/* 0xbe */ SCMD_READ_CD, "read_cd", \
394 +/* 0xa5 */ { SCMD_PLAYAUDIO12, "playaudio(12)" }, \
395 +/* 0xa9 */ { SCMD_PLAYTRACK_REL12, "playtrack_rel" }, \
396 +/* 0xbb */ { SCMD_SET_CDROM_SPEED, "set_cd_speed" }, \
397 +/* 0xbe */ { SCMD_READ_CD, "read_cd" }, \
400 398 \
401 -/* 0xc4 */ SCMD_CD_PLAYBACK_STATUS, "cd_playback_status", \
402 -/* 0xc9 */ SCMD_CD_PLAYBACK_CONTROL, "cd_playback_control", \
403 -/* 0xd8 */ SCMD_READ_CDDA, "read_cdda", \
404 -/* 0xdb */ SCMD_READ_CDXA, "read_cdxa", \
405 -/* 0xdf */ SCMD_READ_ALL_SUBCODES, "read_all_subcodes"
399 +/* 0xc4 */ { SCMD_CD_PLAYBACK_STATUS, "cd_playback_status" }, \
400 +/* 0xc9 */ { SCMD_CD_PLAYBACK_CONTROL, "cd_playback_control" }, \
401 +/* 0xd8 */ { SCMD_READ_CDDA, "read_cdda" }, \
402 +/* 0xdb */ { SCMD_READ_CDXA, "read_cdxa" }, \
403 +/* 0xdf */ { SCMD_READ_ALL_SUBCODES, "read_all_subcodes" }
406 404
407 405 #ifdef __cplusplus
408 406 }
409 407 #endif
410 408
411 409 #endif /* _SYS_CDIO_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX