xref: /freebsd/sys/dev/firewire/iec13213.h (revision a3e8fd0b7f663db7eafff527d5c3ca3bcfa8a537)
1 /*
2  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the acknowledgement as bellow:
15  *
16  *    This product includes software developed by K. Kobayashi and H. Shimokawa
17  *
18  * 4. The name of the author may not be used to endorse or promote products
19  *    derived from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  * $FreeBSD$
34  *
35  */
36 #define CSRKEY_MVID	0x3
37 #define CSRKEY_NCAP	0xc
38 #define CSRKEY_NUNQ	0x8d
39 #define CSRKEY_NPWR	0x30
40 #define CSRKEY_SPEC	0x12
41 #define	CSRVAL_1394TA	0x00a02d
42 #define	CSRVAL_ANSIT10	0x00609e
43 #define CSRKEY_VER	0x13
44 #define	CSR_PROTAVC	0x010001
45 #define	CSR_PROTCAL	0x010002
46 #define	CSR_PROTEHS	0x010004
47 #define	CSR_PROTHAVI	0x010008
48 #define	CSR_PROTCAM104	0x000100
49 #define	CSR_PROTCAM120	0x000101
50 #define	CSR_PROTCAM130	0x000102
51 #define	CSR_PROTDPP	0x0a6be2
52 #define	CSR_PROTIICP	0x4b661f
53 
54 #define	CSRVAL_T10SBP2	0x010483
55 
56 struct csrreg {
57 	u_int32_t val:24,
58 		  key:8;
59 };
60 struct csrhdr {
61 	u_int32_t crc:16,
62 		  crc_len:8,
63 		  info_len:8;
64 };
65 struct csrdirectory {
66 	u_int32_t crc:16,
67 		  crc_len:16;
68 	struct csrreg entry[0];
69 };
70 struct csrtext {
71 	u_int32_t crc:16,
72 		  crc_len:16;
73 	u_int32_t spec_id:16,
74 		  spec_type:16;
75 	u_int32_t lang_id;
76 	u_int32_t text[0];
77 };
78 struct businfo {
79 	u_int32_t crc:16,
80 		  crc_len:8,
81 		  :12,
82 		  max_rec:4,
83 		  clk_acc:8,
84 		  :4,
85 		  bmc:1,
86 		  isc:1,
87 		  cmc:1,
88 		  irmc:1;
89 	u_int32_t c_id_hi:8,
90 		  v_id:24;
91 	u_int32_t c_id_lo;
92 };
93