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 "channel_mgmt.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];
42
/* The format must be the same as struct vmdata_gpa_direct */
43
struct vmbus_channel_packet_multipage_buffer {
50
u32 rangecount; /* Always 1 in this case */
51
struct hv_multipage_buffer range;
55
extern int vmbus_open(struct vmbus_channel *channel,
56
u32 send_ringbuffersize,
57
u32 recv_ringbuffersize,
60
void(*onchannel_callback)(void *context),
63
extern void vmbus_close(struct vmbus_channel *channel);
65
extern int vmbus_sendpacket(struct vmbus_channel *channel,
69
enum vmbus_packet_type type,
72
extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
73
struct hv_page_buffer pagebuffers[],
79
extern int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel,
80
struct hv_multipage_buffer *mpb,
85
extern int vmbus_establish_gpadl(struct vmbus_channel *channel,
90
extern int vmbus_teardown_gpadl(struct vmbus_channel *channel,
93
extern int vmbus_recvpacket(struct vmbus_channel *channel,
96
u32 *buffer_actual_len,
99
extern int vmbus_recvpacket_raw(struct vmbus_channel *channel,
102
u32 *buffer_actual_len,
105
extern void vmbus_onchannel_event(struct vmbus_channel *channel);
107
extern void vmbus_get_debug_info(struct vmbus_channel *channel,
108
struct vmbus_channel_debug_info *debug);
110
extern void vmbus_ontimer(unsigned long data);
112
#endif /* _CHANNEL_H_ */