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>
23 #include <linux/kernel.h>
26 #include "vmbus_private.h"
28 static int ivmbus_open(struct hv_device
*device
, u32 sendbuffer_size
,
29 u32 recv_ringbuffer_size
, void *userdata
,
31 void (*channel_callback
)(void *context
),
34 return vmbus_open(device
->channel
, sendbuffer_size
,
35 recv_ringbuffer_size
, userdata
, userdatalen
,
36 channel_callback
, context
);
39 static void ivmbus_close(struct hv_device
*device
)
41 vmbus_close(device
->channel
);
44 static int ivmbus_sendpacket(struct hv_device
*device
, const void *buffer
,
45 u32 bufferlen
, u64 requestid
, u32 type
,
48 return vmbus_sendpacket(device
->channel
, buffer
, bufferlen
,
49 requestid
, type
, flags
);
52 static int ivmbus_sendpacket_pagebuffer(struct hv_device
*device
,
53 struct hv_page_buffer pagebuffers
[],
54 u32 pagecount
, void *buffer
,
55 u32 bufferlen
, u64 requestid
)
57 return vmbus_sendpacket_pagebuffer(device
->channel
, pagebuffers
,
58 pagecount
, buffer
, bufferlen
,
62 /* vmbus interface function pointer table */
63 const struct vmbus_channel_interface vmbus_ops
= {
65 .Close
= ivmbus_close
,
66 .SendPacket
= ivmbus_sendpacket
,
67 .SendPacketPageBuffer
= ivmbus_sendpacket_pagebuffer
,