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>
28 #include "include/osd.h"
29 #include "ChannelMgmt.h"
34 /* The format must be the same as VMDATA_GPA_DIRECT */
35 struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER {
43 PAGE_BUFFER Range[MAX_PAGE_BUFFER_COUNT];
47 /* The format must be the same as VMDATA_GPA_DIRECT */
48 struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER {
55 u32 RangeCount; /* Always 1 in this case */
56 MULTIPAGE_BUFFER Range;
67 VMBUS_CHANNEL *Channel,
68 u32 SendRingBufferSize,
69 u32 RecvRingBufferSize,
72 PFN_CHANNEL_CALLBACK pfnOnChannelCallback,
78 VMBUS_CHANNEL *Channel
82 VmbusChannelSendPacket(
83 VMBUS_CHANNEL *Channel,
87 VMBUS_PACKET_TYPE Type,
92 VmbusChannelSendPacketPageBuffer(
93 VMBUS_CHANNEL *Channel,
94 PAGE_BUFFER PageBuffers[],
102 VmbusChannelSendPacketMultiPageBuffer(
103 VMBUS_CHANNEL *Channel,
104 MULTIPAGE_BUFFER *MultiPageBuffer,
111 VmbusChannelEstablishGpadl(
112 VMBUS_CHANNEL *Channel,
113 void * Kbuffer, /* from kmalloc() */
114 u32 Size, /* page-size multiple */
119 VmbusChannelTeardownGpadl(
120 VMBUS_CHANNEL *Channel,
125 VmbusChannelRecvPacket(
126 VMBUS_CHANNEL *Channel,
129 u32* BufferActualLen,
134 VmbusChannelRecvPacketRaw(
135 VMBUS_CHANNEL *Channel,
138 u32* BufferActualLen,
143 VmbusChannelOnChannelEvent(
144 VMBUS_CHANNEL *Channel
148 VmbusChannelGetDebugInfo(
149 VMBUS_CHANNEL *Channel,
150 VMBUS_CHANNEL_DEBUG_INFO *DebugInfo
157 #endif /* _CHANNEL_H_ */