\ ========== Copyright Header Begin ==========================================
\ Hypervisor Software File: vio-struct.fth
\ Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
\ - Do no alter or remove copyright notices
\ - Redistribution and use of this software in source and binary forms, with
\ or without modification, are permitted provided that the following
\ - Redistribution of source code must retain the above copyright notice,
\ this list of conditions and the following disclaimer.
\ - Redistribution in binary form must reproduce the above copyright notice,
\ this list of conditions and the following disclaimer in the
\ documentation and/or other materials provided with the distribution.
\ Neither the name of Sun Microsystems, Inc. or the names of contributors
\ may be used to endorse or promote products derived from this software
\ without specific prior written permission.
\ This software is provided "AS IS," without a warranty of any kind.
\ ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
\ INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
\ PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
\ MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
\ ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
\ DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
\ OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
\ FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
\ DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
\ ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
\ SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
\ You acknowledge that this software is not designed, licensed or
\ intended for use in the design, construction, operation or maintenance of
\ ========== Copyright Header End ============================================
id: @(#)vio-struct.fth 1.1 06/10/11
purpose: This file contains data structures shared by VIO devices
copyright: Copyright 2006 Sun Microsystems, Inc. All Rights Reserved
copyright: Use is subject to license terms.
\ ----------- Common to both vdisk and vnet ----------------
h# 2000 constant pagesize
\ First 64 bits are common among all message
/w field >vio-subtype-env
1 constant vio-msg-type-ctrl
2 constant vio-msg-type-data
4 constant vio-msg-type-err
1 constant vio-subtype-info
2 constant vio-subtype-ack
4 constant vio-subtype-nack
\ Message sub-type envelopes
h# 40 constant vio-pkt-data
h# 41 constant vio-desc-data
1 constant vdev-net-client
3 constant vdev-disk-client
\ VIO version negotation message.
\ tag == CTRL/INFO/VIO_VER_INFO
/vio-msg-tag field >vio-msg-tag
d# 43 field >vio-ver-res1 \ Total size = 56 bytes, 8 byte LDC header is
\ added on top of the structure ==> 64 bytes
\ ---------------- vdisk specific ----------------------
\ Definitions of the various ways vds can export disk support to vdc.
0 constant vd-disk-type-unk
1 constant vd-disk-type-slice
2 constant vd-disk-type-disk
\ Currently, max xfer size is 0x8000, page size is 0x2000
\ Each cookie size is 1 page, so we need 4 cookies
\ vdisk attribute msg format CTRL/INFO/ATTR_INFO
/vio-msg-tag field >vdisk-vio-tag
/c field >vdisk-xfer-mode
/vio-msg-tag field >vdsk-tag
/ldc-mem-cookie vdsk-#cookies * field >vdsk-cookie
\ There are other operations defined but we are not using them in Openboot
\ ------------- vnet specific ---------------------
\ Ethernet frame size is 1514, each cookie is 0x2000(1 page) in size
\ So we need 2 cookies at most
\ Vnet/Vswitch device attributes information message.
\ tag == CTRL/INFO/ATTR_INFO
/vio-msg-tag field >vnet-vio-tag
d# 24 field >vnet-ldc-pkt-pad
\ Vswitch in-band descriptor data message
\ tag == DATA/{INFO|ACK|NACK}/DESC_DATA
/vio-msg-tag field >vnet-tag
/l field >vnet-ctrl-nbytes
/l field >vnet-ctrl-#cookies
dup constant /vnet-descr-short
/ldc-mem-cookie vnet-#cookies * field >vnet-cookie