Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / obp / obp / dev / sun4v-devices / vcommon / vio-struct.fth
CommitLineData
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 ============================================
42id: @(#)vio-struct.fth 1.1 06/10/11
43purpose: This file contains data structures shared by VIO devices
44copyright: Copyright 2006 Sun Microsystems, Inc. All Rights Reserved
45copyright: Use is subject to license terms.
46
47headerless
48
49\ ----------- Common to both vdisk and vnet ----------------
50
51h# 2000 constant pagesize
52
53\ First 64 bits are common among all message
54\ types.
55struct
56 /c field >vio-msgtype
57 /c field >vio-subtype
58 /w field >vio-subtype-env
59 /l field >vio-sid
60constant /vio-msg-tag
61
62\ Message types
631 constant vio-msg-type-ctrl
642 constant vio-msg-type-data
654 constant vio-msg-type-err
66
67\ Message sub-types
681 constant vio-subtype-info
692 constant vio-subtype-ack
704 constant vio-subtype-nack
71
72\ Message sub-type envelopes
731 constant vio-ver-info
742 constant vio-attr-info
755 constant vio-rdx
76h# 40 constant vio-pkt-data
77h# 41 constant vio-desc-data
78
79\ dev_type
801 constant vdev-net-client
813 constant vdev-disk-client
82
83struct
84 /x field >ldc-mem-caddr
85 /x field >ldc-mem-csize
86constant /ldc-mem-cookie
87
88\ xfer_mode
891 constant vio-pkt-mode
902 constant vio-desc-mode
91
92\ VIO version negotation message.
93\ tag == CTRL/INFO/VIO_VER_INFO
94struct
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
101constant /vio-ver-msg
102
103\ ---------------- vdisk specific ----------------------
104\ Definitions of the various ways vds can export disk support to vdc.
1050 constant vd-disk-type-unk
1061 constant vd-disk-type-slice
1072 constant vd-disk-type-disk
108
109\ Supported versions
1101 constant vdisk-major
1110 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
1154 constant vdsk-#cookies
116
117\ vdisk attribute msg format CTRL/INFO/ATTR_INFO
118struct
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
128constant /vdisk-attr-msg
129
130struct
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
144constant /vdsk-descr-msg
145
146\ Operation definition
147\ There are other operations defined but we are not using them in Openboot
1481 constant vdsi-bread
1492 constant vdsi-write
150
151\ ------------- vnet specific ---------------------
152
153\ Supported versions
1541 constant vnet-major
1550 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
1592 constant vnet-#cookies
160
161\ Vnet/Vswitch device attributes information message.
162\ tag == CTRL/INFO/ATTR_INFO
163\
164struct
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
173constant /vnet-attr-msg
174
175\ addr_type
1761 constant addr-type-mac
177
178\ Vswitch in-band descriptor data message
179\ tag == DATA/{INFO|ACK|NACK}/DESC_DATA
180struct
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
186dup constant /vnet-descr-short
187 /ldc-mem-cookie vnet-#cookies * field >vnet-cookie
188constant /vnet-descr-msg
189