Staging: hv: typedef removal for ChannelMessages.h
[deliverable/linux.git] / drivers / staging / hv / include / ChannelMessages.h
CommitLineData
565e7dc8
HJ
1/*
2 *
3 * Copyright (c) 2009, Microsoft Corporation.
4 *
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.
8 *
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
12 * more details.
13 *
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.
17 *
18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
20 * Hank Janssen <hjanssen@microsoft.com>
21 *
22 */
23
314b1c8b
GKH
24#ifndef __CHANNELMESSAGES_H
25#define __CHANNELMESSAGES_H
565e7dc8 26
09d50ff8 27#include "VmbusPacketFormat.h"
565e7dc8 28
454f18a9 29/* Version 1 messages */
82250213 30enum vmbus_channel_message_type {
314b1c8b
GKH
31 ChannelMessageInvalid = 0,
32 ChannelMessageOfferChannel = 1,
33 ChannelMessageRescindChannelOffer = 2,
34 ChannelMessageRequestOffers = 3,
35 ChannelMessageAllOffersDelivered = 4,
36 ChannelMessageOpenChannel = 5,
37 ChannelMessageOpenChannelResult = 6,
38 ChannelMessageCloseChannel = 7,
39 ChannelMessageGpadlHeader = 8,
40 ChannelMessageGpadlBody = 9,
41 ChannelMessageGpadlCreated = 10,
42 ChannelMessageGpadlTeardown = 11,
43 ChannelMessageGpadlTorndown = 12,
44 ChannelMessageRelIdReleased = 13,
45 ChannelMessageInitiateContact = 14,
46 ChannelMessageVersionResponse = 15,
47 ChannelMessageUnload = 16,
565e7dc8 48#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
314b1c8b
GKH
49 ChannelMessageViewRangeAdd = 17,
50 ChannelMessageViewRangeRemove = 18,
565e7dc8 51#endif
314b1c8b 52 ChannelMessageCount
82250213 53} __attribute__((packed));
565e7dc8 54
82250213
GKH
55struct vmbus_channel_message_header {
56 enum vmbus_channel_message_type MessageType;
314b1c8b 57 u32 Padding;
82250213 58} __attribute__((packed));
565e7dc8 59
454f18a9 60/* Query VMBus Version parameters */
82250213
GKH
61struct vmbus_channel_query_vmbus_version {
62 struct vmbus_channel_message_header Header;
314b1c8b 63 u32 Version;
82250213 64} __attribute__((packed));
565e7dc8 65
454f18a9 66/* VMBus Version Supported parameters */
82250213
GKH
67struct vmbus_channel_version_supported {
68 struct vmbus_channel_message_header Header;
314b1c8b 69 bool VersionSupported;
82250213 70} __attribute__((packed));
565e7dc8 71
454f18a9 72/* Offer Channel parameters */
82250213
GKH
73struct vmbus_channel_offer_channel {
74 struct vmbus_channel_message_header Header;
314b1c8b
GKH
75 struct vmbus_channel_offer Offer;
76 u32 ChildRelId;
77 u8 MonitorId;
78 bool MonitorAllocated;
82250213 79} __attribute__((packed));
565e7dc8 80
454f18a9 81/* Rescind Offer parameters */
82250213
GKH
82struct vmbus_channel_rescind_offer {
83 struct vmbus_channel_message_header Header;
314b1c8b 84 u32 ChildRelId;
82250213 85} __attribute__((packed));
454f18a9 86
314b1c8b
GKH
87/*
88 * Request Offer -- no parameters, SynIC message contains the partition ID
89 * Set Snoop -- no parameters, SynIC message contains the partition ID
90 * Clear Snoop -- no parameters, SynIC message contains the partition ID
91 * All Offers Delivered -- no parameters, SynIC message contains the partition
92 * ID
93 * Flush Client -- no parameters, SynIC message contains the partition ID
94 */
565e7dc8 95
314b1c8b 96/* Open Channel parameters */
82250213
GKH
97struct vmbus_channel_open_channel {
98 struct vmbus_channel_message_header Header;
454f18a9 99
314b1c8b
GKH
100 /* Identifies the specific VMBus channel that is being opened. */
101 u32 ChildRelId;
454f18a9 102
314b1c8b
GKH
103 /* ID making a particular open request at a channel offer unique. */
104 u32 OpenId;
565e7dc8 105
314b1c8b
GKH
106 /* GPADL for the channel's ring buffer. */
107 u32 RingBufferGpadlHandle;
454f18a9 108
314b1c8b
GKH
109 /* GPADL for the channel's server context save area. */
110 u32 ServerContextAreaGpadlHandle;
454f18a9 111
314b1c8b
GKH
112 /*
113 * The upstream ring buffer begins at offset zero in the memory
114 * described by RingBufferGpadlHandle. The downstream ring buffer
115 * follows it at this offset (in pages).
116 */
117 u32 DownstreamRingBufferPageOffset;
565e7dc8 118
314b1c8b
GKH
119 /* User-specific data to be passed along to the server endpoint. */
120 unsigned char UserData[MAX_USER_DEFINED_BYTES];
82250213 121} __attribute__((packed));
565e7dc8 122
454f18a9 123/* Open Channel Result parameters */
82250213
GKH
124struct vmbus_channel_open_result {
125 struct vmbus_channel_message_header Header;
314b1c8b
GKH
126 u32 ChildRelId;
127 u32 OpenId;
128 u32 Status;
82250213 129} __attribute__((packed));
565e7dc8 130
454f18a9 131/* Close channel parameters; */
82250213
GKH
132struct vmbus_channel_close_channel {
133 struct vmbus_channel_message_header Header;
314b1c8b 134 u32 ChildRelId;
82250213 135} __attribute__((packed));
565e7dc8 136
454f18a9 137/* Channel Message GPADL */
314b1c8b
GKH
138#define GPADL_TYPE_RING_BUFFER 1
139#define GPADL_TYPE_SERVER_SAVE_AREA 2
140#define GPADL_TYPE_TRANSACTION 8
454f18a9
BP
141
142/*
143 * The number of PFNs in a GPADL message is defined by the number of
144 * pages that would be spanned by ByteCount and ByteOffset. If the
145 * implied number of PFNs won't fit in this packet, there will be a
146 * follow-up packet that contains more.
147 */
82250213
GKH
148struct vmbus_channel_gpadl_header {
149 struct vmbus_channel_message_header Header;
314b1c8b
GKH
150 u32 ChildRelId;
151 u32 Gpadl;
152 u16 RangeBufLen;
153 u16 RangeCount;
154 GPA_RANGE Range[0];
82250213 155} __attribute__((packed));
454f18a9
BP
156
157/* This is the followup packet that contains more PFNs. */
82250213
GKH
158struct vmbus_channel_gpadl_body {
159 struct vmbus_channel_message_header Header;
314b1c8b
GKH
160 u32 MessageNumber;
161 u32 Gpadl;
162 u64 Pfn[0];
82250213 163} __attribute__((packed));
314b1c8b 164
82250213
GKH
165struct vmbus_channel_gpadl_created {
166 struct vmbus_channel_message_header Header;
314b1c8b
GKH
167 u32 ChildRelId;
168 u32 Gpadl;
169 u32 CreationStatus;
82250213 170} __attribute__((packed));
314b1c8b 171
82250213
GKH
172struct vmbus_channel_gpadl_teardown {
173 struct vmbus_channel_message_header Header;
314b1c8b
GKH
174 u32 ChildRelId;
175 u32 Gpadl;
82250213 176} __attribute__((packed));
314b1c8b 177
82250213
GKH
178struct vmbus_channel_gpadl_torndown {
179 struct vmbus_channel_message_header Header;
314b1c8b 180 u32 Gpadl;
82250213 181} __attribute__((packed));
565e7dc8
HJ
182
183#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
82250213
GKH
184struct vmbus_channel_view_range_add {
185 struct vmbus_channel_message_header Header;
314b1c8b
GKH
186 PHYSICAL_ADDRESS ViewRangeBase;
187 u64 ViewRangeLength;
188 u32 ChildRelId;
82250213 189} __attribute__((packed));
314b1c8b 190
82250213
GKH
191struct vmbus_channel_view_range_remove {
192 struct vmbus_channel_message_header Header;
314b1c8b
GKH
193 PHYSICAL_ADDRESS ViewRangeBase;
194 u32 ChildRelId;
82250213 195} __attribute__((packed));
565e7dc8
HJ
196#endif
197
82250213
GKH
198struct vmbus_channel_relid_released {
199 struct vmbus_channel_message_header Header;
314b1c8b 200 u32 ChildRelId;
82250213 201} __attribute__((packed));
314b1c8b 202
82250213
GKH
203struct vmbus_channel_initiate_contact {
204 struct vmbus_channel_message_header Header;
314b1c8b
GKH
205 u32 VMBusVersionRequested;
206 u32 Padding2;
207 u64 InterruptPage;
208 u64 MonitorPage1;
209 u64 MonitorPage2;
82250213 210} __attribute__((packed));
314b1c8b 211
82250213
GKH
212struct vmbus_channel_version_response {
213 struct vmbus_channel_message_header Header;
314b1c8b 214 bool VersionSupported;
82250213 215} __attribute__((packed));
565e7dc8 216
314b1c8b 217#endif
This page took 0.045422 seconds and 5 git commands to generate.