3 * Copyright (c) 2009, Microsoft Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
19 * Haiyang Zhang <haiyangz@microsoft.com>
20 * Hank Janssen <hjanssen@microsoft.com>
26 // allow nameless unions
27 //#pragma warning(disable : 4201)
30 // A revision number of vmbus that is used for ensuring both ends on a
31 // partition are using compatible versions.
33 #define VMBUS_REVISION_NUMBER 13
36 // Make maximum size of pipe payload of 16K
38 #define MAX_PIPE_DATA_PAYLOAD (sizeof(BYTE) * 16384)
41 // Define PipeMode values.
43 #define VMBUS_PIPE_TYPE_BYTE 0x00000000
44 #define VMBUS_PIPE_TYPE_MESSAGE 0x00000004
47 // The size of the user defined data buffer for non-pipe offers.
49 #define MAX_USER_DEFINED_BYTES 120
52 // The size of the user defined data buffer for pipe offers.
54 #define MAX_PIPE_USER_DEFINED_BYTES 116
58 // At the center of the Channel Management library is
59 // the Channel Offer. This struct contains the
60 // fundamental information about an offer.
68 GUID InterfaceInstance;
69 UINT64 InterruptLatencyIn100nsUnits;
70 u32 InterfaceRevision;
71 u32 ServerContextAreaSize; // in bytes
73 u16 MmioMegabytes; // in bytes * 1024 * 1024
78 // Non-pipes: The user has MAX_USER_DEFINED_BYTES bytes.
82 UCHAR UserDefined[MAX_USER_DEFINED_BYTES];
86 // Pipes: The following sructure is an integrated pipe protocol, which
87 // is implemented on top of standard user-defined data. Pipe clients
88 // have MAX_PIPE_USER_DEFINED_BYTES left for their own use.
93 UCHAR UserDefined[MAX_PIPE_USER_DEFINED_BYTES];
97 } VMBUS_CHANNEL_OFFER, *PVMBUS_CHANNEL_OFFER;
102 // Verify the MAX_PIPE_USER_DEFINED_BYTES value.
104 //C_ASSERT(MAX_PIPE_USER_DEFINED_BYTES ==
105 // MAX_USER_DEFINED_BYTES -
106 // (FIELD_OFFSET(VMBUS_CHANNEL_OFFER, u.Pipe.UserDefined) -
107 // FIELD_OFFSET(VMBUS_CHANNEL_OFFER, u.Standard.UserDefined)));
110 typedef u32 GPADL_HANDLE;
116 #define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1
117 #define VMBUS_CHANNEL_SERVER_SUPPORTS_TRANSFER_PAGES 2
118 #define VMBUS_CHANNEL_SERVER_SUPPORTS_GPADLS 4
119 #define VMBUS_CHANNEL_NAMED_PIPE_MODE 0x10
120 #define VMBUS_CHANNEL_LOOPBACK_OFFER 0x100
121 #define VMBUS_CHANNEL_PARENT_OFFER 0x200
122 #define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION 0x400
125 // TEMPTEMP -- move this next define to devioctl.h some day
128 #ifndef FILE_DEVICE_VMBUS
129 #define FILE_DEVICE_VMBUS 0x0000003E