Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | \ ========== Copyright Header Begin ========================================== |
2 | \ | |
3 | \ Hypervisor Software File: vio-struct.fth | |
4 | \ | |
5 | \ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
6 | \ | |
7 | \ - Do no alter or remove copyright notices | |
8 | \ | |
9 | \ - Redistribution and use of this software in source and binary forms, with | |
10 | \ or without modification, are permitted provided that the following | |
11 | \ conditions are met: | |
12 | \ | |
13 | \ - Redistribution of source code must retain the above copyright notice, | |
14 | \ this list of conditions and the following disclaimer. | |
15 | \ | |
16 | \ - Redistribution in binary form must reproduce the above copyright notice, | |
17 | \ this list of conditions and the following disclaimer in the | |
18 | \ documentation and/or other materials provided with the distribution. | |
19 | \ | |
20 | \ Neither the name of Sun Microsystems, Inc. or the names of contributors | |
21 | \ may be used to endorse or promote products derived from this software | |
22 | \ without specific prior written permission. | |
23 | \ | |
24 | \ This software is provided "AS IS," without a warranty of any kind. | |
25 | \ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | |
26 | \ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | |
27 | \ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN | |
28 | \ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR | |
29 | \ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | |
30 | \ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN | |
31 | \ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR | |
32 | \ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE | |
33 | \ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, | |
34 | \ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF | |
35 | \ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | |
36 | \ | |
37 | \ You acknowledge that this software is not designed, licensed or | |
38 | \ intended for use in the design, construction, operation or maintenance of | |
39 | \ any nuclear facility. | |
40 | \ | |
41 | \ ========== Copyright Header End ============================================ | |
42 | id: @(#)vio-struct.fth 1.1 06/10/11 | |
43 | purpose: This file contains data structures shared by VIO devices | |
44 | copyright: Copyright 2006 Sun Microsystems, Inc. All Rights Reserved | |
45 | copyright: Use is subject to license terms. | |
46 | ||
47 | headerless | |
48 | ||
49 | \ ----------- Common to both vdisk and vnet ---------------- | |
50 | ||
51 | h# 2000 constant pagesize | |
52 | ||
53 | \ First 64 bits are common among all message | |
54 | \ types. | |
55 | struct | |
56 | /c field >vio-msgtype | |
57 | /c field >vio-subtype | |
58 | /w field >vio-subtype-env | |
59 | /l field >vio-sid | |
60 | constant /vio-msg-tag | |
61 | ||
62 | \ Message types | |
63 | 1 constant vio-msg-type-ctrl | |
64 | 2 constant vio-msg-type-data | |
65 | 4 constant vio-msg-type-err | |
66 | ||
67 | \ Message sub-types | |
68 | 1 constant vio-subtype-info | |
69 | 2 constant vio-subtype-ack | |
70 | 4 constant vio-subtype-nack | |
71 | ||
72 | \ Message sub-type envelopes | |
73 | 1 constant vio-ver-info | |
74 | 2 constant vio-attr-info | |
75 | 5 constant vio-rdx | |
76 | h# 40 constant vio-pkt-data | |
77 | h# 41 constant vio-desc-data | |
78 | ||
79 | \ dev_type | |
80 | 1 constant vdev-net-client | |
81 | 3 constant vdev-disk-client | |
82 | ||
83 | struct | |
84 | /x field >ldc-mem-caddr | |
85 | /x field >ldc-mem-csize | |
86 | constant /ldc-mem-cookie | |
87 | ||
88 | \ xfer_mode | |
89 | 1 constant vio-pkt-mode | |
90 | 2 constant vio-desc-mode | |
91 | ||
92 | \ VIO version negotation message. | |
93 | \ tag == CTRL/INFO/VIO_VER_INFO | |
94 | struct | |
95 | /vio-msg-tag field >vio-msg-tag | |
96 | /w field >vio-ver-major | |
97 | /w field >vio-ver-minor | |
98 | /c field >vio-dev-type | |
99 | d# 43 field >vio-ver-res1 \ Total size = 56 bytes, 8 byte LDC header is | |
100 | \ added on top of the structure ==> 64 bytes | |
101 | constant /vio-ver-msg | |
102 | ||
103 | \ ---------------- vdisk specific ---------------------- | |
104 | \ Definitions of the various ways vds can export disk support to vdc. | |
105 | 0 constant vd-disk-type-unk | |
106 | 1 constant vd-disk-type-slice | |
107 | 2 constant vd-disk-type-disk | |
108 | ||
109 | \ Supported versions | |
110 | 1 constant vdisk-major | |
111 | 0 constant vdisk-minor | |
112 | ||
113 | \ Currently, max xfer size is 0x8000, page size is 0x2000 | |
114 | \ Each cookie size is 1 page, so we need 4 cookies | |
115 | 4 constant vdsk-#cookies | |
116 | ||
117 | \ vdisk attribute msg format CTRL/INFO/ATTR_INFO | |
118 | struct | |
119 | /vio-msg-tag field >vdisk-vio-tag | |
120 | /c field >vdisk-xfer-mode | |
121 | /c field >vdisk-type | |
122 | /w field >vdisk-res1 | |
123 | /l field >vdisk-bsize | |
124 | /x field >vdisk-op | |
125 | /x field >vdisk-size | |
126 | /x field >vdisk-mtu | |
127 | d# 16 field >vdisk-res | |
128 | constant /vdisk-attr-msg | |
129 | ||
130 | struct | |
131 | /vio-msg-tag field >vdsk-tag | |
132 | /x field >vdsk-seq | |
133 | /x field >vdsk-desc-hdl | |
134 | /x field >vdsk-reqid | |
135 | /c field >vdsk-operation | |
136 | /c field >vdsk-slice | |
137 | /w field >vdsk-resv | |
138 | /l field >vdsk-status | |
139 | /x field >vdsk-addr | |
140 | /x field >vdsk-nbytes | |
141 | /l field >vdsk-#cookies | |
142 | /l field >vdsk-resv1 | |
143 | /ldc-mem-cookie vdsk-#cookies * field >vdsk-cookie | |
144 | constant /vdsk-descr-msg | |
145 | ||
146 | \ Operation definition | |
147 | \ There are other operations defined but we are not using them in Openboot | |
148 | 1 constant vdsi-bread | |
149 | 2 constant vdsi-write | |
150 | ||
151 | \ ------------- vnet specific --------------------- | |
152 | ||
153 | \ Supported versions | |
154 | 1 constant vnet-major | |
155 | 0 constant vnet-minor | |
156 | ||
157 | \ Ethernet frame size is 1514, each cookie is 0x2000(1 page) in size | |
158 | \ So we need 2 cookies at most | |
159 | 2 constant vnet-#cookies | |
160 | ||
161 | \ Vnet/Vswitch device attributes information message. | |
162 | \ tag == CTRL/INFO/ATTR_INFO | |
163 | \ | |
164 | struct | |
165 | /vio-msg-tag field >vnet-vio-tag | |
166 | /c field >vnet-xfer-mode | |
167 | /c field >vnet-addr-type | |
168 | /w field >vnet-ack-freq | |
169 | /l field >vnet-resv1 | |
170 | /x field >vnet-attr-addr | |
171 | /x field >vnet-attr-mtu | |
172 | d# 24 field >vnet-ldc-pkt-pad | |
173 | constant /vnet-attr-msg | |
174 | ||
175 | \ addr_type | |
176 | 1 constant addr-type-mac | |
177 | ||
178 | \ Vswitch in-band descriptor data message | |
179 | \ tag == DATA/{INFO|ACK|NACK}/DESC_DATA | |
180 | struct | |
181 | /vio-msg-tag field >vnet-tag | |
182 | /x field >vnet-seq | |
183 | /x field >vnet-desc-hdl | |
184 | /l field >vnet-ctrl-nbytes | |
185 | /l field >vnet-ctrl-#cookies | |
186 | dup constant /vnet-descr-short | |
187 | /ldc-mem-cookie vnet-#cookies * field >vnet-cookie | |
188 | constant /vnet-descr-msg | |
189 |