Staging: hv: Add a subset of definitions from vmbus_api.h to hyperv.h
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / staging / hv / hyperv.h
CommitLineData
5c473400
S
1/*
2 *
3 * Copyright (c) 2011, Microsoft Corporation.
4 *
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.
8 *
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
12 * more details.
13 *
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.
17 *
18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
20 * Hank Janssen <hjanssen@microsoft.com>
21 * K. Y. Srinivasan <kys@microsoft.com>
22 *
23 */
3f335ea2
S
24
25#ifndef _HYPERV_H
26#define _HYPERV_H
27
28struct hv_guid {
29 unsigned char data[16];
30};
31
a363bf7b
S
32#define MAX_PAGE_BUFFER_COUNT 16
33#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
34
35#pragma pack(push, 1)
36
37/* Single-page buffer */
38struct hv_page_buffer {
39 u32 len;
40 u32 offset;
41 u64 pfn;
42};
43
44/* Multiple-page buffer */
45struct hv_multipage_buffer {
46 /* Length and Offset determines the # of pfns in the array */
47 u32 len;
48 u32 offset;
49 u64 pfn_array[MAX_MULTIPAGE_BUFFER_COUNT];
50};
51
52/* 0x18 includes the proprietary packet header */
53#define MAX_PAGE_BUFFER_PACKET (0x18 + \
54 (sizeof(struct hv_page_buffer) * \
55 MAX_PAGE_BUFFER_COUNT))
56#define MAX_MULTIPAGE_BUFFER_PACKET (0x18 + \
57 sizeof(struct hv_multipage_buffer))
58
59
60#pragma pack(pop)
61
3f335ea2
S
62
63#endif /* _HYPERV_H */