fwphyreg.h revision 1.2.18.2 1 1.2.18.2 yamt /* $NetBSD: fwphyreg.h,v 1.2.18.2 2006/06/21 15:04:08 yamt Exp $ */
2 1.2.18.2 yamt /*-
3 1.2.18.2 yamt * Copyright (C) 2003
4 1.2.18.2 yamt * Hidetoshi Shimokawa. All rights reserved.
5 1.2.18.2 yamt *
6 1.2.18.2 yamt * Redistribution and use in source and binary forms, with or without
7 1.2.18.2 yamt * modification, are permitted provided that the following conditions
8 1.2.18.2 yamt * are met:
9 1.2.18.2 yamt * 1. Redistributions of source code must retain the above copyright
10 1.2.18.2 yamt * notice, this list of conditions and the following disclaimer.
11 1.2.18.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
12 1.2.18.2 yamt * notice, this list of conditions and the following disclaimer in the
13 1.2.18.2 yamt * documentation and/or other materials provided with the distribution.
14 1.2.18.2 yamt * 3. All advertising materials mentioning features or use of this software
15 1.2.18.2 yamt * must display the following acknowledgement:
16 1.2.18.2 yamt *
17 1.2.18.2 yamt * This product includes software developed by Hidetoshi Shimokawa.
18 1.2.18.2 yamt *
19 1.2.18.2 yamt * 4. Neither the name of the author nor the names of its contributors
20 1.2.18.2 yamt * may be used to endorse or promote products derived from this software
21 1.2.18.2 yamt * without specific prior written permission.
22 1.2.18.2 yamt *
23 1.2.18.2 yamt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 1.2.18.2 yamt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 1.2.18.2 yamt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 1.2.18.2 yamt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 1.2.18.2 yamt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 1.2.18.2 yamt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 1.2.18.2 yamt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 1.2.18.2 yamt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 1.2.18.2 yamt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 1.2.18.2 yamt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 1.2.18.2 yamt * SUCH DAMAGE.
34 1.2.18.2 yamt *
35 1.2.18.2 yamt * $FreeBSD: /repoman/r/ncvs/src/sys/dev/firewire/fwphyreg.h,v 1.3 2005/01/06 01:42:41 imp Exp $
36 1.2.18.2 yamt */
37 1.2.18.2 yamt
38 1.2.18.2 yamt struct phyreg_base {
39 1.2.18.2 yamt #if BYTE_ORDER == BIG_ENDIAN
40 1.2.18.2 yamt uint8_t phy_id:6,
41 1.2.18.2 yamt r:1,
42 1.2.18.2 yamt cps:1;
43 1.2.18.2 yamt uint8_t rhb:1,
44 1.2.18.2 yamt ibr:1,
45 1.2.18.2 yamt gap_count:6;
46 1.2.18.2 yamt uint8_t extended:3,
47 1.2.18.2 yamt num_ports:5;
48 1.2.18.2 yamt uint8_t phy_speed:3,
49 1.2.18.2 yamt :1,
50 1.2.18.2 yamt delay:4;
51 1.2.18.2 yamt uint8_t lctrl:1,
52 1.2.18.2 yamt c:1,
53 1.2.18.2 yamt jitter:3,
54 1.2.18.2 yamt pwr_class:3;
55 1.2.18.2 yamt uint8_t wdie:1,
56 1.2.18.2 yamt isbr:1,
57 1.2.18.2 yamt ctoi:1,
58 1.2.18.2 yamt cpsi:1,
59 1.2.18.2 yamt stoi:1,
60 1.2.18.2 yamt pei:1,
61 1.2.18.2 yamt eaa:1,
62 1.2.18.2 yamt emc:1;
63 1.2.18.2 yamt uint8_t legacy_spd:3,
64 1.2.18.2 yamt blink:1,
65 1.2.18.2 yamt bridge:2,
66 1.2.18.2 yamt :2;
67 1.2.18.2 yamt uint8_t page_select:3,
68 1.2.18.2 yamt :1,
69 1.2.18.2 yamt port_select:4;
70 1.2.18.2 yamt #else
71 1.2.18.2 yamt uint8_t cps:1,
72 1.2.18.2 yamt r:1,
73 1.2.18.2 yamt phy_id:6;
74 1.2.18.2 yamt uint8_t gap_count:6,
75 1.2.18.2 yamt ibr:1,
76 1.2.18.2 yamt rhb:1;
77 1.2.18.2 yamt uint8_t num_ports:5,
78 1.2.18.2 yamt extended:3;
79 1.2.18.2 yamt uint8_t delay:4,
80 1.2.18.2 yamt :1,
81 1.2.18.2 yamt phy_speed:3;
82 1.2.18.2 yamt uint8_t pwr_class:3,
83 1.2.18.2 yamt jitter:3,
84 1.2.18.2 yamt c:1,
85 1.2.18.2 yamt lctrl:1;
86 1.2.18.2 yamt uint8_t emc:1,
87 1.2.18.2 yamt eaa:1,
88 1.2.18.2 yamt pei:1,
89 1.2.18.2 yamt stoi:1,
90 1.2.18.2 yamt cpsi:1,
91 1.2.18.2 yamt ctoi:1,
92 1.2.18.2 yamt isbr:1,
93 1.2.18.2 yamt wdie:1;
94 1.2.18.2 yamt uint8_t :2,
95 1.2.18.2 yamt bridge:2,
96 1.2.18.2 yamt blink:1,
97 1.2.18.2 yamt legacy_spd:3;
98 1.2.18.2 yamt uint8_t port_select:4,
99 1.2.18.2 yamt :1,
100 1.2.18.2 yamt page_select:3;
101 1.2.18.2 yamt #endif
102 1.2.18.2 yamt };
103 1.2.18.2 yamt
104 1.2.18.2 yamt struct phyreg_page0 {
105 1.2.18.2 yamt #if BYTE_ORDER == BIG_ENDIAN
106 1.2.18.2 yamt uint8_t astat:2,
107 1.2.18.2 yamt bstat:2,
108 1.2.18.2 yamt ch:1,
109 1.2.18.2 yamt con:1,
110 1.2.18.2 yamt rxok:1,
111 1.2.18.2 yamt dis:1;
112 1.2.18.2 yamt uint8_t negotiated_speed:3,
113 1.2.18.2 yamt pie:1,
114 1.2.18.2 yamt fault:1,
115 1.2.18.2 yamt stanby_fault:1,
116 1.2.18.2 yamt disscrm:1,
117 1.2.18.2 yamt b_only:1;
118 1.2.18.2 yamt uint8_t dc_connected:1,
119 1.2.18.2 yamt max_port_speed:3,
120 1.2.18.2 yamt lpp:1,
121 1.2.18.2 yamt cable_speed:3;
122 1.2.18.2 yamt uint8_t connection_unreliable:1,
123 1.2.18.2 yamt :3,
124 1.2.18.2 yamt beta_mode:1,
125 1.2.18.2 yamt :3;
126 1.2.18.2 yamt uint8_t port_error;
127 1.2.18.2 yamt uint8_t :5,
128 1.2.18.2 yamt loop_disable:1,
129 1.2.18.2 yamt in_standby:1,
130 1.2.18.2 yamt hard_disable:1;
131 1.2.18.2 yamt uint8_t :8;
132 1.2.18.2 yamt uint8_t :8;
133 1.2.18.2 yamt #else
134 1.2.18.2 yamt uint8_t dis:1,
135 1.2.18.2 yamt rxok:1,
136 1.2.18.2 yamt con:1,
137 1.2.18.2 yamt ch:1,
138 1.2.18.2 yamt bstat:2,
139 1.2.18.2 yamt astat:2;
140 1.2.18.2 yamt uint8_t b_only:1,
141 1.2.18.2 yamt disscrm:1,
142 1.2.18.2 yamt stanby_fault:1,
143 1.2.18.2 yamt fault:1,
144 1.2.18.2 yamt pie:1,
145 1.2.18.2 yamt negotiated_speed:3;
146 1.2.18.2 yamt uint8_t cable_speed:3,
147 1.2.18.2 yamt lpp:1,
148 1.2.18.2 yamt max_port_speed:3,
149 1.2.18.2 yamt dc_connected:1;
150 1.2.18.2 yamt uint8_t :3,
151 1.2.18.2 yamt beta_mode:1,
152 1.2.18.2 yamt :3,
153 1.2.18.2 yamt connection_unreliable:1;
154 1.2.18.2 yamt uint8_t port_error;
155 1.2.18.2 yamt uint8_t hard_disable:1,
156 1.2.18.2 yamt in_standby:1,
157 1.2.18.2 yamt loop_disable:1,
158 1.2.18.2 yamt :5;
159 1.2.18.2 yamt uint8_t :8;
160 1.2.18.2 yamt uint8_t :8;
161 1.2.18.2 yamt #endif
162 1.2.18.2 yamt };
163 1.2.18.2 yamt
164 1.2.18.2 yamt struct phyreg_page1 {
165 1.2.18.2 yamt uint8_t compliance;
166 1.2.18.2 yamt uint8_t :8;
167 1.2.18.2 yamt uint8_t vendor_id[3];
168 1.2.18.2 yamt uint8_t product_id[3];
169 1.2.18.2 yamt };
170