iec68113.h revision 114215
1103285Sikob/*
2113584Ssimokawa * Copyright (c) 2003 Hidetoshi Shimokawa
3113584Ssimokawa * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
4103285Sikob * All rights reserved.
5103285Sikob *
6103285Sikob * Redistribution and use in source and binary forms, with or without
7103285Sikob * modification, are permitted provided that the following conditions
8103285Sikob * are met:
9103285Sikob * 1. Redistributions of source code must retain the above copyright
10103285Sikob *    notice, this list of conditions and the following disclaimer.
11103285Sikob * 2. Redistributions in binary form must reproduce the above copyright
12103285Sikob *    notice, this list of conditions and the following disclaimer in the
13103285Sikob *    documentation and/or other materials provided with the distribution.
14103285Sikob * 3. All advertising materials mentioning features or use of this software
15103285Sikob *    must display the acknowledgement as bellow:
16103285Sikob *
17103285Sikob *    This product includes software developed by K. Kobayashi and H. Shimokawa
18103285Sikob *
19103285Sikob * 4. The name of the author may not be used to endorse or promote products
20103285Sikob *    derived from this software without specific prior written permission.
21103285Sikob *
22103285Sikob * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23103285Sikob * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24103285Sikob * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25103285Sikob * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
26103285Sikob * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27103285Sikob * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28103285Sikob * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29103285Sikob * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30103285Sikob * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31103285Sikob * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32103285Sikob * POSSIBILITY OF SUCH DAMAGE.
33103285Sikob *
34103285Sikob * $FreeBSD: head/sys/dev/firewire/iec68113.h 114215 2003-04-29 13:27:13Z simokawa $
35103285Sikob *
36103285Sikob */
37114215Ssimokawa
38114215Ssimokawa#define		DV_BROADCAST_ON (1<<30)
39114215Ssimokawa#define		oMPR		0x900
40114215Ssimokawa#define		oPCR		0x904
41114215Ssimokawa#define		iMPR		0x980
42114215Ssimokawa#define		iPCR		0x984
43114215Ssimokawa
44103285Sikobstruct ciphdr {
45113584Ssimokawa#if BYTE_ORDER == BIG_ENDIAN
46113584Ssimokawa	u_int8_t eoh0:1,	/* 0 */
47113584Ssimokawa		 form0:1,	/* 0 */
48113584Ssimokawa		 src:6;
49113584Ssimokawa#else
50109178Ssimokawa	u_int8_t src:6,
51109178Ssimokawa		 form0:1,	/* 0 */
52109178Ssimokawa		 eoh0:1;	/* 0 */
53113584Ssimokawa#endif
54109178Ssimokawa	u_int8_t len;
55113584Ssimokawa#if BYTE_ORDER == BIG_ENDIAN
56113584Ssimokawa	u_int8_t fn:2,
57113584Ssimokawa		 qpc:3,
58113584Ssimokawa		 sph:1,
59113584Ssimokawa		 :2;
60113584Ssimokawa#else
61109178Ssimokawa	u_int8_t :2,
62109178Ssimokawa		 sph:1,
63109178Ssimokawa		 qpc:3,
64111200Ssimokawa		 fn:2;
65113584Ssimokawa#endif
66109178Ssimokawa	u_int8_t dbc;
67113584Ssimokawa#if BYTE_ORDER == BIG_ENDIAN
68113584Ssimokawa	u_int8_t eoh1:1,	/* 1 */
69113584Ssimokawa		 form1:1,	/* 0 */
70113584Ssimokawa		 fmt:6;
71113584Ssimokawa#else
72109178Ssimokawa	u_int8_t fmt:6,
73113584Ssimokawa		 form1:1,	/* 0 */
74113584Ssimokawa		 eoh1:1;	/* 1 */
75113584Ssimokawa#endif
76109178Ssimokawa#define CIP_FMT_DVCR	0
77109178Ssimokawa#define CIP_FMT_MPEG	(1<<5)
78109178Ssimokawa	union {
79109178Ssimokawa		struct {
80113584Ssimokawa#if BYTE_ORDER == BIG_ENDIAN
81113584Ssimokawa			u_int8_t fs:1,		/* 50/60 field system
82113584Ssimokawa								NTSC/PAL */
83113584Ssimokawa				 stype:5,
84113584Ssimokawa				 :2;
85113584Ssimokawa#else
86113584Ssimokawa			u_int8_t :2,
87113584Ssimokawa				 stype:5,
88113584Ssimokawa		  		 fs:1;		/* 50/60 field system
89113584Ssimokawa								NTSC/PAL */
90113584Ssimokawa#endif
91109178Ssimokawa#define	CIP_STYPE_SD	0
92109178Ssimokawa#define	CIP_STYPE_SDL	1
93109178Ssimokawa#define	CIP_STYPE_HD	2
94109178Ssimokawa	  		u_int16_t cyc:16;	/* take care of byte order! */
95109178Ssimokawa		} __attribute__ ((packed)) dv;
96109178Ssimokawa		u_int8_t bytes[3];
97109178Ssimokawa	} fdf;
98109178Ssimokawa
99103285Sikob};
100103285Sikobstruct dvdbc{
101113584Ssimokawa#if BYTE_ORDER == BIG_ENDIAN
102113584Ssimokawa	u_int8_t sct:3,		/* Section type */
103113584Ssimokawa		 :1,		/* Reserved */
104113584Ssimokawa		 arb:4;		/* Arbitrary bit */
105113584Ssimokawa#else
106109178Ssimokawa	u_int8_t arb:4,		/* Arbitrary bit */
107109178Ssimokawa		 :1,		/* Reserved */
108109178Ssimokawa		 sct:3;		/* Section type */
109113584Ssimokawa#endif
110109178Ssimokawa#define	DV_SCT_HEADER	0
111109178Ssimokawa#define	DV_SCT_SUBCODE	1
112109178Ssimokawa#define	DV_SCT_VAUX	2
113109178Ssimokawa#define	DV_SCT_AUDIO	3
114109178Ssimokawa#define	DV_SCT_VIDEO	4
115113584Ssimokawa#if BYTE_ORDER == BIG_ENDIAN
116113584Ssimokawa	u_int8_t dseq:4,	/* DIF sequence number */
117113584Ssimokawa		 fsc:1,		/* ID of a DIF block in each channel */
118113584Ssimokawa		 :3;
119113584Ssimokawa#else
120109178Ssimokawa	u_int8_t :3,
121109178Ssimokawa		 fsc:1,		/* ID of a DIF block in each channel */
122109178Ssimokawa		 dseq:4;	/* DIF sequence number */
123113584Ssimokawa#endif
124109178Ssimokawa	u_int8_t dbn;		/* DIF block number */
125109178Ssimokawa	u_int8_t payload[77];
126109178Ssimokawa#define	DV_DSF_12	0x80	/* PAL: payload[0] in Header DIF */
127103285Sikob};
128