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 "ChannelMgmt.h"
30 /* The format must be the same as struct vmdata_gpa_direct */
31 struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER
{
39 struct hv_page_buffer Range
[MAX_PAGE_BUFFER_COUNT
];
40 } __attribute__((packed
));
42 /* The format must be the same as struct vmdata_gpa_direct */
43 struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER
{
50 u32 RangeCount
; /* Always 1 in this case */
51 struct hv_multipage_buffer Range
;
52 } __attribute__((packed
));
55 extern int VmbusChannelOpen(struct vmbus_channel
*channel
,
56 u32 SendRingBufferSize
,
57 u32 RecvRingBufferSize
,
60 void(*OnChannelCallback
)(void *context
),
63 extern void VmbusChannelClose(struct vmbus_channel
*channel
);
65 extern int VmbusChannelSendPacket(struct vmbus_channel
*channel
,
69 enum vmbus_packet_type Type
,
72 extern int VmbusChannelSendPacketPageBuffer(struct vmbus_channel
*channel
,
73 struct hv_page_buffer PageBuffers
[],
79 extern int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel
*channel
,
80 struct hv_multipage_buffer
*mpb
,
85 extern int VmbusChannelEstablishGpadl(struct vmbus_channel
*channel
,
90 extern int VmbusChannelTeardownGpadl(struct vmbus_channel
*channel
,
93 extern int VmbusChannelRecvPacket(struct vmbus_channel
*channel
,
99 extern int VmbusChannelRecvPacketRaw(struct vmbus_channel
*channel
,
102 u32
*BufferActualLen
,
105 extern void VmbusChannelOnChannelEvent(struct vmbus_channel
*channel
);
107 extern void VmbusChannelGetDebugInfo(struct vmbus_channel
*channel
,
108 struct vmbus_channel_debug_info
*debug
);
110 extern void VmbusChannelOnTimer(unsigned long data
);
112 #endif /* _CHANNEL_H_ */