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"
31 /* The format must be the same as VMDATA_GPA_DIRECT */
32 struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER {
40 PAGE_BUFFER Range[MAX_PAGE_BUFFER_COUNT];
41 } __attribute__((packed));
43 /* The format must be the same as VMDATA_GPA_DIRECT */
44 struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER {
51 u32 RangeCount; /* Always 1 in this case */
52 MULTIPAGE_BUFFER Range;
53 } __attribute__((packed));
56 extern int VmbusChannelOpen(VMBUS_CHANNEL *Channel,
57 u32 SendRingBufferSize,
58 u32 RecvRingBufferSize,
61 PFN_CHANNEL_CALLBACK pfnOnChannelCallback,
64 extern void VmbusChannelClose(VMBUS_CHANNEL *Channel);
66 extern int VmbusChannelSendPacket(VMBUS_CHANNEL *Channel,
70 VMBUS_PACKET_TYPE Type,
73 extern int VmbusChannelSendPacketPageBuffer(VMBUS_CHANNEL *Channel,
74 PAGE_BUFFER PageBuffers[],
80 extern int VmbusChannelSendPacketMultiPageBuffer(VMBUS_CHANNEL *Channel,
81 MULTIPAGE_BUFFER *MultiPageBuffer,
86 extern int VmbusChannelEstablishGpadl(VMBUS_CHANNEL *Channel,
91 extern int VmbusChannelTeardownGpadl(VMBUS_CHANNEL *Channel,
94 extern int VmbusChannelRecvPacket(VMBUS_CHANNEL *Channel,
100 extern int VmbusChannelRecvPacketRaw(VMBUS_CHANNEL *Channel,
103 u32 *BufferActualLen,
106 extern void VmbusChannelOnChannelEvent(VMBUS_CHANNEL *Channel);
108 extern void VmbusChannelGetDebugInfo(VMBUS_CHANNEL *Channel,
109 VMBUS_CHANNEL_DEBUG_INFO *DebugInfo);
111 extern void VmbusChannelOnTimer(unsigned long data);
113 #endif /* _CHANNEL_H_ */