File: vu_hita.h

package info (click to toggle)
xmcd 2.6-17sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,464 kB
  • ctags: 5,075
  • sloc: ansic: 51,322; sh: 4,039; makefile: 82; pascal: 67
file content (185 lines) | stat: -rw-r--r-- 6,386 bytes parent folder | download | duplicates (5)
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
/*
 *   libdi - CD Audio Player Device Interface Library
 *
 *   Copyright (C) 1993-2000  Ti Kan
 *   E-mail: ti@amb.org
 *
 *   This library is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU Library General Public
 *   License as published by the Free Software Foundation; either
 *   version 2 of the License, or (at your option) any later version.
 *
 *   This library is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *   Library General Public License for more details.
 *
 *   You should have received a copy of the GNU Library General Public
 *   License along with this library; if not, write to the Free
 *   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/* 
 *   Hitachi SCSI-1 vendor-unique support
 *
 *   The name "Hitachi" is a trademark of Hitachi Corporation, and is
 *   used here for identification purposes only.
 */
#ifndef __VU_HITA_H__
#define __VU_HITA_H__

#ifdef VENDOR_HITACHI

#ifndef LINT
static char *_vu_hita_h_ident_ = "@(#)vu_hita.h	6.10 99/12/27";
#endif


/* Hitachi vendor-unique commands */
#define OP_VH_AUDPLAY		0xe0	/* Hitachi play audio */
#define OP_VH_PAUSE		0xe1	/* Hitachi pause */
#define OP_VH_PLAYTRK		0xe2	/* Hitachi play audio track */
#define OP_VH_RDINFO		0xe3	/* Hitachi read disk info */
#define OP_VH_EJECT		0xe4	/* Hitachi eject */
#define OP_VH_RDSTAT		0xe5	/* Hitachi read audio status */
#define OP_VH_PWRSAVE		0xe6	/* Hitachi power save mode */
#define OP_VH_RDXINFO		0xe8	/* Hitachi read extended disk info */


/* Return data lengths */
#define SZ_VH_PAUSE		3	/* Hitachi pause data size */
#define SZ_VH_RDINFO		303	/* Hitachi disk info data size */
#define SZ_VH_TOCHDR		3	/* Hitachi disc info header size */
#define SZ_VH_TOCENT		3	/* Hitachi disc info per-track
					 * entry size
					 */
#define SZ_VH_RDSTAT		11	/* Hitachi audio status data size */
#define SZ_VH_RDXINFO		404	/* Hitachi ext disk info data size */
#define SZ_VH_XTOCHDR		4	/* Hitachi ext disc info header size */
#define SZ_VH_XTOCENT		4	/* Hitachi ext disc info per-track
					 * entry size
					 */

/* Macros to compute the real offset of the data area in several
 * data structures.  The pad byte in the beginning of some structures
 * are there to prevent the compiler from inserting a pad byte in
 * the middle of the structure.  The alternative is to use #pragma pack(1),
 * but that's not very portable.
 */
#define AD_VH_PAUSE(x)		(x)	/* Hitachi pause data addr */
#define AD_VH_RDINFO(x)		((x)+1)	/* Hitachi disk info data addr */
#define AD_VH_RDSTAT(x)		(x)	/* Hitachi audio status data addr */
#define AD_VH_RDXINFO(x)	(x)	/* Hitachi ext disk info data addr */


/* Hitachi MSF location */
typedef struct hmsf {
#if _BYTE_ORDER_ == _L_ENDIAN_
	unsigned int	min:7;			/* minute */
	unsigned int	data:1;			/* 0=audio 1=data */
#else	/* _BYTE_ORDER_ == _B_ENDIAN_ */
	unsigned int	data:1;			/* 0=audio 1=data */
	unsigned int	min:7;			/* minute */
#endif	/* _BYTE_ORDER_ */
	unsigned int	sec:8;			/* second */
	unsigned int	frame:8;		/* frame */
	unsigned int	res:8;			/* reserved */
} hmsf_t;


/* Hitachi extended MSF location */
typedef struct hxmsf {
#if _BYTE_ORDER_ == _L_ENDIAN_
	unsigned int	adr:4;			/* ADR code */
        unsigned int	preemph:1;		/* preemphasis */
	unsigned int	copyallow:1;		/* digital copy allow */
	unsigned int	trktype:1;		/* 0=audio 1=data */
	unsigned int	audioch:1;		/* 0=2ch 1=4ch */
#else	/* _BYTE_ORDER_ == _B_ENDIAN_ */
	unsigned int	audioch:1;		/* 0=2ch 1=4ch */
	unsigned int	trktype:1;		/* 0=audio 1=data */
	unsigned int	copyallow:1;		/* digital copy allow */
        unsigned int	preemph:1;		/* preemphasis */
	unsigned int	adr:4;			/* ADR code */
#endif	/* _BYTE_ORDER_ */
	unsigned int	min:8;			/* minute */
	unsigned int	sec:8;			/* second */
	unsigned int	frame:8;		/* frame */
} hxmsf_t;


/* Hitachi Disk Info data */
typedef struct hdiscinfo {
	unsigned int	pad0:8;			/* pad byte for alignment */
#if _BYTE_ORDER_ == _L_ENDIAN_
	unsigned int	audio:1;		/* disc has audio tracks */
	unsigned int	data:1;			/* disc has data tracks */
	unsigned int	res:6;			/* reserved */
#else	/* _BYTE_ORDER_ == _B_ENDIAN_ */
	unsigned int	res:6;			/* reserved */
	unsigned int	data:1;			/* disc has data tracks */
	unsigned int	audio:1;		/* disc has audio tracks */
#endif	/* _BYTE_ORDER_ */
	unsigned int	first_trk:8;		/* first track number */
	unsigned int	last_trk:8;		/* last track number */

	byte_t		msfdata[300];		/* Track MSF address data */
} hdiscinfo_t;


/* Hitachi Audio Status data */
typedef struct haudstat {
#if _BYTE_ORDER_ == _L_ENDIAN_
	unsigned int	playing:1;		/* Audio playing */
	unsigned int	res1:7;			/* Reserved */
	unsigned int	adr:4;			/* ADR code */
        unsigned int	preemph:1;		/* preemphasis */
	unsigned int	copyallow:1;		/* digital copy allow */
	unsigned int	trktype:1;		/* 0=audio 1=data */
	unsigned int	audioch:1;		/* 0=2ch 1=4ch */
#else	/* _BYTE_ORDER_ == _B_ENDIAN_ */
	unsigned int	res1:7;			/* Reserved */
	unsigned int	playing:1;		/* Audio playing */
	unsigned int	audioch:1;		/* 0=2ch 1=4ch */
	unsigned int	trktype:1;		/* 0=audio 1=data */
	unsigned int	copyallow:1;		/* digital copy allow */
        unsigned int	preemph:1;		/* preemphasis */
	unsigned int	adr:4;			/* ADR code */
#endif	/* _BYTE_ORDER_ */
	unsigned int	trkno:8;		/* track number */
	unsigned int	res2:8;			/* reserved */

	hmsf_t		rel_addr;		/* relative address */
	hmsf_t		abs_addr;		/* absolute address */
} haudstat_t;


/* Hitachi Extended Disk Info data */
typedef struct hxdiscinfo {
	byte_t		res[2];			/* reserved */
	byte_t		first_trk;		/* first track number */
	byte_t		last_trk;		/* last track number */

	byte_t		xmsfdata[400];		/* track MSF address data */
} hxdiscinfo_t;


/* Public function prototypes */
extern bool_t	hita_playaudio(byte_t, word32_t, word32_t, msf_t *, msf_t *,
			byte_t, byte_t);
extern bool_t	hita_pause_resume(bool_t);
extern bool_t	hita_start_stop(bool_t, bool_t);
extern bool_t	hita_get_playstatus(curstat_t *, byte_t *);
extern bool_t	hita_get_toc(curstat_t *);
extern bool_t	hita_mute(bool_t);
extern bool_t	hita_eject(void);
extern void	hita_init(void);

#else

#define hita_init	NULL

#endif	/* VENDOR_HITACHI */

#endif	/* __VU_HITA_H__ */