2 * Copyright (c) 2009, Microsoft Corporation.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
18 * Haiyang Zhang <haiyangz@microsoft.com>
19 * Hank Janssen <hjanssen@microsoft.com>
25 * Common header for Hyper-V ICs
27 #define ICMSGTYPE_NEGOTIATE 0
28 #define ICMSGTYPE_HEARTBEAT 1
29 #define ICMSGTYPE_KVPEXCHANGE 2
30 #define ICMSGTYPE_SHUTDOWN 3
31 #define ICMSGTYPE_TIMESYNC 4
32 #define ICMSGTYPE_VSS 5
34 #define ICMSGHDRFLAG_TRANSACTION 1
35 #define ICMSGHDRFLAG_REQUEST 2
36 #define ICMSGHDRFLAG_RESPONSE 4
38 #define HV_S_OK 0x00000000
39 #define HV_E_FAIL 0x80004005
40 #define HV_ERROR_NOT_SUPPORTED 0x80070032
41 #define HV_ERROR_MACHINE_LOCKED 0x800704F7
43 struct vmbuspipe_hdr
{
46 } __attribute__((packed
));
51 } __attribute__((packed
));
54 struct ic_version icverframe
;
56 struct ic_version icvermsg
;
62 } __attribute__((packed
));
64 struct icmsg_negotiate
{
68 struct ic_version icversion_data
[1]; /* any size array */
69 } __attribute__((packed
));
71 struct shutdown_msg_data
{
75 u8 display_message
[2048];
76 } __attribute__((packed
));
78 #define HV_SHUTDOWN_MSG 0
80 struct hyperv_service_callback
{
83 unsigned char data
[16];
84 struct vmbus_channel
*channel
;
85 void (*callback
) (void *context
);
88 extern void prep_negotiate_resp(struct icmsg_hdr
*,
89 struct icmsg_negotiate
*, u8
*);
90 extern void chn_cb_negotiate(void *);
91 extern struct hyperv_service_callback hv_cb_utils
[];
93 #endif /* __HV_UTILS_H_ */