Home | History | Annotate | Line # | Download | only in ieee1394
      1  1.4  kiyohara /*	$NetBSD: iec68113.h,v 1.4 2010/03/29 03:05:28 kiyohara Exp $	*/
      2  1.1  kiyohara /*-
      3  1.1  kiyohara  * Copyright (c) 2003 Hidetoshi Shimokawa
      4  1.1  kiyohara  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
      5  1.1  kiyohara  * All rights reserved.
      6  1.1  kiyohara  *
      7  1.1  kiyohara  * Redistribution and use in source and binary forms, with or without
      8  1.1  kiyohara  * modification, are permitted provided that the following conditions
      9  1.1  kiyohara  * are met:
     10  1.1  kiyohara  * 1. Redistributions of source code must retain the above copyright
     11  1.1  kiyohara  *    notice, this list of conditions and the following disclaimer.
     12  1.1  kiyohara  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  kiyohara  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  kiyohara  *    documentation and/or other materials provided with the distribution.
     15  1.1  kiyohara  * 3. All advertising materials mentioning features or use of this software
     16  1.1  kiyohara  *    must display the acknowledgement as bellow:
     17  1.1  kiyohara  *
     18  1.1  kiyohara  *    This product includes software developed by K. Kobayashi and H. Shimokawa
     19  1.1  kiyohara  *
     20  1.1  kiyohara  * 4. The name of the author may not be used to endorse or promote products
     21  1.1  kiyohara  *    derived from this software without specific prior written permission.
     22  1.1  kiyohara  *
     23  1.1  kiyohara  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     24  1.1  kiyohara  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     25  1.1  kiyohara  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     26  1.1  kiyohara  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
     27  1.1  kiyohara  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     28  1.1  kiyohara  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     29  1.1  kiyohara  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     30  1.1  kiyohara  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     31  1.1  kiyohara  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     32  1.1  kiyohara  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     33  1.1  kiyohara  * POSSIBILITY OF SUCH DAMAGE.
     34  1.4  kiyohara  *
     35  1.1  kiyohara  * $FreeBSD: /repoman/r/ncvs/src/sys/dev/firewire/iec68113.h,v 1.9 2005/01/06 01:42:41 imp Exp $
     36  1.1  kiyohara  *
     37  1.1  kiyohara  */
     38  1.1  kiyohara 
     39  1.4  kiyohara #ifndef _IEC68113_H_
     40  1.4  kiyohara #define _IEC68113_H_
     41  1.4  kiyohara 
     42  1.1  kiyohara #define		DV_BROADCAST_ON (1<<30)
     43  1.1  kiyohara #define		oMPR		0x900
     44  1.1  kiyohara #define		oPCR		0x904
     45  1.1  kiyohara #define		iMPR		0x980
     46  1.1  kiyohara #define		iPCR		0x984
     47  1.1  kiyohara 
     48  1.1  kiyohara struct ciphdr {
     49  1.1  kiyohara #if BYTE_ORDER == BIG_ENDIAN
     50  1.1  kiyohara 	uint8_t eoh0:1,		/* 0 */
     51  1.1  kiyohara 		form0:1,	/* 0 */
     52  1.1  kiyohara 		src:6;
     53  1.1  kiyohara #else
     54  1.1  kiyohara 	uint8_t src:6,
     55  1.1  kiyohara 		form0:1,	/* 0 */
     56  1.1  kiyohara 		eoh0:1;		/* 0 */
     57  1.1  kiyohara #endif
     58  1.1  kiyohara 	uint8_t len;
     59  1.1  kiyohara #if BYTE_ORDER == BIG_ENDIAN
     60  1.1  kiyohara 	uint8_t fn:2,
     61  1.1  kiyohara 		qpc:3,
     62  1.1  kiyohara 		sph:1,
     63  1.1  kiyohara 		:2;
     64  1.1  kiyohara #else
     65  1.1  kiyohara 	uint8_t :2,
     66  1.1  kiyohara 		sph:1,
     67  1.1  kiyohara 		qpc:3,
     68  1.1  kiyohara 		fn:2;
     69  1.1  kiyohara #endif
     70  1.1  kiyohara 	uint8_t dbc;
     71  1.1  kiyohara #if BYTE_ORDER == BIG_ENDIAN
     72  1.1  kiyohara 	uint8_t eoh1:1,		/* 1 */
     73  1.1  kiyohara 		form1:1,	/* 0 */
     74  1.1  kiyohara 		fmt:6;
     75  1.1  kiyohara #else
     76  1.1  kiyohara 	uint8_t fmt:6,
     77  1.1  kiyohara 		form1:1,	/* 0 */
     78  1.1  kiyohara 		eoh1:1;		/* 1 */
     79  1.1  kiyohara #endif
     80  1.1  kiyohara #define CIP_FMT_DVCR	0
     81  1.1  kiyohara #define CIP_FMT_MPEG	(1<<5)
     82  1.1  kiyohara 	union {
     83  1.1  kiyohara 		struct {
     84  1.1  kiyohara #if BYTE_ORDER == BIG_ENDIAN
     85  1.1  kiyohara 			uint8_t fs:1,		/* 50/60 field system
     86  1.1  kiyohara 								NTSC/PAL */
     87  1.1  kiyohara 				stype:5,
     88  1.1  kiyohara 				:2;
     89  1.1  kiyohara #else
     90  1.1  kiyohara 			uint8_t :2,
     91  1.1  kiyohara 				stype:5,
     92  1.1  kiyohara 		  		fs:1;		/* 50/60 field system
     93  1.1  kiyohara 								NTSC/PAL */
     94  1.1  kiyohara #endif
     95  1.1  kiyohara #define	CIP_STYPE_SD	0
     96  1.1  kiyohara #define	CIP_STYPE_SDL	1
     97  1.1  kiyohara #define	CIP_STYPE_HD	2
     98  1.1  kiyohara 	  		uint16_t cyc:16;	/* take care of byte order! */
     99  1.3  gmcgarry 		} __packed dv;
    100  1.1  kiyohara 		uint8_t bytes[3];
    101  1.1  kiyohara 	} fdf;
    102  1.1  kiyohara 
    103  1.1  kiyohara };
    104  1.1  kiyohara struct dvdbc{
    105  1.1  kiyohara #if BYTE_ORDER == BIG_ENDIAN
    106  1.1  kiyohara 	uint8_t sct:3,		/* Section type */
    107  1.1  kiyohara 		:1,		/* Reserved */
    108  1.1  kiyohara 		arb:4;		/* Arbitrary bit */
    109  1.1  kiyohara #else
    110  1.1  kiyohara 	uint8_t arb:4,		/* Arbitrary bit */
    111  1.1  kiyohara 		:1,		/* Reserved */
    112  1.1  kiyohara 		sct:3;		/* Section type */
    113  1.1  kiyohara #endif
    114  1.1  kiyohara #define	DV_SCT_HEADER	0
    115  1.1  kiyohara #define	DV_SCT_SUBCODE	1
    116  1.1  kiyohara #define	DV_SCT_VAUX	2
    117  1.1  kiyohara #define	DV_SCT_AUDIO	3
    118  1.1  kiyohara #define	DV_SCT_VIDEO	4
    119  1.1  kiyohara #if BYTE_ORDER == BIG_ENDIAN
    120  1.1  kiyohara 	uint8_t dseq:4,		/* DIF sequence number */
    121  1.1  kiyohara 		fsc:1,		/* ID of a DIF block in each channel */
    122  1.1  kiyohara 		:3;
    123  1.1  kiyohara #else
    124  1.1  kiyohara 	uint8_t :3,
    125  1.1  kiyohara 		fsc:1,		/* ID of a DIF block in each channel */
    126  1.1  kiyohara 		dseq:4;		/* DIF sequence number */
    127  1.1  kiyohara #endif
    128  1.1  kiyohara 	uint8_t dbn;		/* DIF block number */
    129  1.1  kiyohara 	uint8_t payload[77];
    130  1.1  kiyohara #define	DV_DSF_12	0x80	/* PAL: payload[0] in Header DIF */
    131  1.1  kiyohara };
    132  1.4  kiyohara 
    133  1.4  kiyohara #endif	/* _IEC68113_H_ */
    134