Merge from vendor branch AWK:
[dragonfly.git] / sys / sys / wormio.h
CommitLineData
984263bc
MD
1/* Shared between kernel & process */
2/* $FreeBSD: src/sys/sys/wormio.h,v 1.6 1999/10/01 14:10:50 peter Exp $ */
1de703da 3/* $DragonFly: src/sys/sys/Attic/wormio.h,v 1.2 2003/06/17 04:28:59 dillon Exp $ */
984263bc
MD
4
5#ifndef _SYS_WORMIO_H_
6#define _SYS_WORMIO_H_
7
8#include <sys/ioccom.h>
9
10/***************************************************************\
11* Ioctls for the WORM drive *
12\***************************************************************/
13
14
15/*
16 * Prepare disk-wide parameters.
17 */
18
19struct wormio_prepare_disk
20{
21 int dummy; /* use dummy writes, laser turned off */
22 int speed; /* drive speed selection */
23};
24
25#define WORMIOCPREPDISK _IOW('W', 20, struct wormio_prepare_disk)
26
27/*
28 * Prepare track-specific parameters.
29 */
30
31struct wormio_prepare_track
32{
33 int audio; /* audio track (data track if 0) */
34 int preemp; /* audio with preemphasis */
35#define BLOCK_RAW 0 /* 2352 bytes, raw data */
36#define BLOCK_RAWPQ 1 /* 2368 bytes, raw data with P and Q subchannels */
37#define BLOCK_RAWPW 2 /* 2448 bytes, raw data with P-W subchannel appended */
38#define BLOCK_MODE_1 8 /* 2048 bytes, mode 1 (ISO/IEC 10149) */
39#define BLOCK_MODE_2 9 /* 2336 bytes, mode 2 (ISO/IEC 10149) */
40#define BLOCK_MODE_2_FORM_1 10 /* 2048 bytes, CD-ROM XA form 1 */
41#define BLOCK_MODE_2_FORM_1b 11 /* 2056 bytes, CD-ROM XA form 1 */
42#define BLOCK_MODE_2_FORM_2 12 /* 2324 bytes, CD-ROM XA form 2 */
43#define BLOCK_MODE_2_FORM_2b 13 /* 2332 bytes, CD-ROM XA form 2 */
44 int track_type; /* defines the number of bytes in a block */
45#define COPY_INHIBIT 0 /* no copy allowed */
46#define COPY_PERMITTED 1 /* track can be copied */
47#define COPY_SCMS 2 /* alternate copy */
48 int copy_bits; /* define the possibilities for copying */
49 int track_number;
50 char ISRC_country[2]; /* country code (2 chars) */
51 char ISRC_owner[3]; /* owner code (3 chars) */
52 int ISRC_year; /* year of recording */
53 char ISRC_serial[5]; /* serial number */
54};
55#define WORMIOCPREPTRACK _IOW('W', 21, struct wormio_prepare_track)
56
57
58/*
59 * Fixation: write leadins and leadouts. Select table-of-contents
60 * type for this session. If onp is != 0, another session will be
61 * opened.
62 */
63
64struct wormio_fixation
65{
66 int toc_type; /* TOC type */
67 int onp; /* open next program area */
68};
69
70#define WORMIOCFIXATION _IOW('W', 22, struct wormio_fixation)
71
72/*
73 * Finalize track
74 */
75#define WORMIOCFINISHTRACK _IO('W', 23)
76
77
78struct wormio_session_info {
79 u_short lead_in;
80 u_short lead_out;
81};
82#define WORMIOCREADSESSIONINFO _IOR('W', 31, struct wormio_session_info)
83
84struct wormio_write_session {
85 int toc_type;
86 int onp;
87 int lofp;
88 int length;
89 char catalog[13];
90 u_char *track_desc;
91};
92#define WORMIOCWRITESESSION _IOW('W', 32, struct wormio_write_session)
93
94struct wormio_first_writable_addr {
95 int track;
96 int mode;
97 int raw;
98 int audio;
99 int *addr;
100};
101#define WORMIOCFIRSTWRITABLEADDR _IOWR('W', 33, struct wormio_first_writable_addr)
102
103#define CDRIOCBLANK _IO('c', 100)
104#define CDRIOCNEXTWRITEABLEADDR _IOR('c', 101, int)
105
106/* Errors/warnings */
107#define WORM_SEQUENCE_ERROR 1
108#define WORM_DUMMY_BLOCKS_ADDED 2
109#define WORM_CALIBRATION_AREA_ALMOST_FULL 3
110#define WORM_CALIBRATION_AREA_FULL 4
111#define WORM_BUFFER_UNDERRUN 5
112#define WORM_ABSORPTION_CONTROL_ERROR 6
113#define WORM_END_OF_MEDIUM 7
114#define WORM_OPTIMUM_POWER_CALIBRATION_ERROR 8
115
116#define WORMIOERROR _IOR('W', 24, int)
117
118#endif /* !_SYS_WORMIO_H_ */