3 * Copyright (c) 2011, 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>
21 * K. Y. Srinivasan <kys@microsoft.com>
28 #include <linux/scatterlist.h>
29 #include <linux/list.h>
30 #include <linux/uuid.h>
31 #include <linux/timer.h>
32 #include <linux/workqueue.h>
33 #include <linux/completion.h>
34 #include <linux/device.h>
37 #include <asm/hyperv.h>
40 #define MAX_PAGE_BUFFER_COUNT 16
41 #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
45 /* Single-page buffer */
46 struct hv_page_buffer
{
52 /* Multiple-page buffer */
53 struct hv_multipage_buffer
{
54 /* Length and Offset determines the # of pfns in the array */
57 u64 pfn_array
[MAX_MULTIPAGE_BUFFER_COUNT
];
60 /* 0x18 includes the proprietary packet header */
61 #define MAX_PAGE_BUFFER_PACKET (0x18 + \
62 (sizeof(struct hv_page_buffer) * \
63 MAX_PAGE_BUFFER_COUNT))
64 #define MAX_MULTIPAGE_BUFFER_PACKET (0x18 + \
65 sizeof(struct hv_multipage_buffer))
70 struct hv_ring_buffer
{
71 /* Offset in bytes from the start of ring data below */
74 /* Offset in bytes from the start of ring data below */
79 /* Pad it to PAGE_SIZE so that data starts on page boundary */
83 * The interrupt_mask field is used only for channels but since our
84 * vmbus connection also uses this data structure and its data starts
85 * here, we commented out this field.
89 * Ring data starts here + RingDataStartOffset
90 * !!! DO NOT place any fields below this !!!
95 struct hv_ring_buffer_info
{
96 struct hv_ring_buffer
*ring_buffer
;
97 u32 ring_size
; /* Include the shared header */
100 u32 ring_datasize
; /* < ring_size */
101 u32 ring_data_startoffset
;
104 struct hv_ring_buffer_debug_info
{
105 u32 current_interrupt_mask
;
106 u32 current_read_index
;
107 u32 current_write_index
;
108 u32 bytes_avail_toread
;
109 u32 bytes_avail_towrite
;
113 * We use the same version numbering for all Hyper-V modules.
115 * Definition of versioning is as follows;
117 * Major Number Changes for these scenarios;
118 * 1. When a new version of Windows Hyper-V
120 * 2. A Major change has occurred in the
122 * (For example the merge for the first time
123 * into the kernel) Every time the Major Number
124 * changes, the Revision number is reset to 0.
125 * Minor Number Changes when new functionality is added
126 * to the Linux IC's that is not a bug fix.
128 * 3.1 - Added completed hv_utils driver. Shutdown/Heartbeat/Timesync
130 #define HV_DRV_VERSION "3.1"
134 * A revision number of vmbus that is used for ensuring both ends on a
135 * partition are using compatible versions.
137 #define VMBUS_REVISION_NUMBER 13
139 /* Make maximum size of pipe payload of 16K */
140 #define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384)
142 /* Define PipeMode values. */
143 #define VMBUS_PIPE_TYPE_BYTE 0x00000000
144 #define VMBUS_PIPE_TYPE_MESSAGE 0x00000004
146 /* The size of the user defined data buffer for non-pipe offers. */
147 #define MAX_USER_DEFINED_BYTES 120
149 /* The size of the user defined data buffer for pipe offers. */
150 #define MAX_PIPE_USER_DEFINED_BYTES 116
153 * At the center of the Channel Management library is the Channel Offer. This
154 * struct contains the fundamental information about an offer.
156 struct vmbus_channel_offer
{
159 u64 int_latency
; /* in 100ns units */
161 u32 server_ctx_size
; /* in bytes */
163 u16 mmio_megabytes
; /* in bytes * 1024 * 1024 */
166 /* Non-pipes: The user has MAX_USER_DEFINED_BYTES bytes. */
168 unsigned char user_def
[MAX_USER_DEFINED_BYTES
];
173 * The following sructure is an integrated pipe protocol, which
174 * is implemented on top of standard user-defined data. Pipe
175 * clients have MAX_PIPE_USER_DEFINED_BYTES left for their own
180 unsigned char user_def
[MAX_PIPE_USER_DEFINED_BYTES
];
187 #define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1
188 #define VMBUS_CHANNEL_SERVER_SUPPORTS_TRANSFER_PAGES 2
189 #define VMBUS_CHANNEL_SERVER_SUPPORTS_GPADLS 4
190 #define VMBUS_CHANNEL_NAMED_PIPE_MODE 0x10
191 #define VMBUS_CHANNEL_LOOPBACK_OFFER 0x100
192 #define VMBUS_CHANNEL_PARENT_OFFER 0x200
193 #define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION 0x400
195 struct vmpacket_descriptor
{
203 struct vmpacket_header
{
204 u32 prev_pkt_start_offset
;
205 struct vmpacket_descriptor descriptor
;
208 struct vmtransfer_page_range
{
213 struct vmtransfer_page_packet_header
{
214 struct vmpacket_descriptor d
;
216 bool sender_owns_set
;
219 struct vmtransfer_page_range ranges
[1];
222 struct vmgpadl_packet_header
{
223 struct vmpacket_descriptor d
;
228 struct vmadd_remove_transfer_page_set
{
229 struct vmpacket_descriptor d
;
236 * This structure defines a range in guest physical space that can be made to
237 * look virtually contiguous.
246 * This is the format for an Establish Gpadl packet, which contains a handle by
247 * which this GPADL will be known and a set of GPA ranges associated with it.
248 * This can be converted to a MDL by the guest OS. If there are multiple GPA
249 * ranges, then the resulting MDL will be "chained," representing multiple VA
252 struct vmestablish_gpadl
{
253 struct vmpacket_descriptor d
;
256 struct gpa_range range
[1];
260 * This is the format for a Teardown Gpadl packet, which indicates that the
261 * GPADL handle in the Establish Gpadl packet will never be referenced again.
263 struct vmteardown_gpadl
{
264 struct vmpacket_descriptor d
;
266 u32 reserved
; /* for alignment to a 8-byte boundary */
270 * This is the format for a GPA-Direct packet, which contains a set of GPA
271 * ranges, in addition to commands and/or data.
273 struct vmdata_gpa_direct
{
274 struct vmpacket_descriptor d
;
277 struct gpa_range range
[1];
280 /* This is the format for a Additional Data Packet. */
281 struct vmadditional_data
{
282 struct vmpacket_descriptor d
;
286 unsigned char data
[1];
289 union vmpacket_largest_possible_header
{
290 struct vmpacket_descriptor simple_hdr
;
291 struct vmtransfer_page_packet_header xfer_page_hdr
;
292 struct vmgpadl_packet_header gpadl_hdr
;
293 struct vmadd_remove_transfer_page_set add_rm_xfer_page_hdr
;
294 struct vmestablish_gpadl establish_gpadl_hdr
;
295 struct vmteardown_gpadl teardown_gpadl_hdr
;
296 struct vmdata_gpa_direct data_gpa_direct_hdr
;
299 #define VMPACKET_DATA_START_ADDRESS(__packet) \
300 (void *)(((unsigned char *)__packet) + \
301 ((struct vmpacket_descriptor)__packet)->offset8 * 8)
303 #define VMPACKET_DATA_LENGTH(__packet) \
304 ((((struct vmpacket_descriptor)__packet)->len8 - \
305 ((struct vmpacket_descriptor)__packet)->offset8) * 8)
307 #define VMPACKET_TRANSFER_MODE(__packet) \
308 (((struct IMPACT)__packet)->type)
310 enum vmbus_packet_type
{
311 VM_PKT_INVALID
= 0x0,
313 VM_PKT_ADD_XFER_PAGESET
= 0x2,
314 VM_PKT_RM_XFER_PAGESET
= 0x3,
315 VM_PKT_ESTABLISH_GPADL
= 0x4,
316 VM_PKT_TEARDOWN_GPADL
= 0x5,
317 VM_PKT_DATA_INBAND
= 0x6,
318 VM_PKT_DATA_USING_XFER_PAGES
= 0x7,
319 VM_PKT_DATA_USING_GPADL
= 0x8,
320 VM_PKT_DATA_USING_GPA_DIRECT
= 0x9,
321 VM_PKT_CANCEL_REQUEST
= 0xa,
323 VM_PKT_DATA_USING_ADDITIONAL_PKT
= 0xc,
324 VM_PKT_ADDITIONAL_DATA
= 0xd
327 #define VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED 1
330 /* Version 1 messages */
331 enum vmbus_channel_message_type
{
332 CHANNELMSG_INVALID
= 0,
333 CHANNELMSG_OFFERCHANNEL
= 1,
334 CHANNELMSG_RESCIND_CHANNELOFFER
= 2,
335 CHANNELMSG_REQUESTOFFERS
= 3,
336 CHANNELMSG_ALLOFFERS_DELIVERED
= 4,
337 CHANNELMSG_OPENCHANNEL
= 5,
338 CHANNELMSG_OPENCHANNEL_RESULT
= 6,
339 CHANNELMSG_CLOSECHANNEL
= 7,
340 CHANNELMSG_GPADL_HEADER
= 8,
341 CHANNELMSG_GPADL_BODY
= 9,
342 CHANNELMSG_GPADL_CREATED
= 10,
343 CHANNELMSG_GPADL_TEARDOWN
= 11,
344 CHANNELMSG_GPADL_TORNDOWN
= 12,
345 CHANNELMSG_RELID_RELEASED
= 13,
346 CHANNELMSG_INITIATE_CONTACT
= 14,
347 CHANNELMSG_VERSION_RESPONSE
= 15,
348 CHANNELMSG_UNLOAD
= 16,
349 #ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
350 CHANNELMSG_VIEWRANGE_ADD
= 17,
351 CHANNELMSG_VIEWRANGE_REMOVE
= 18,
356 struct vmbus_channel_message_header
{
357 enum vmbus_channel_message_type msgtype
;
361 /* Query VMBus Version parameters */
362 struct vmbus_channel_query_vmbus_version
{
363 struct vmbus_channel_message_header header
;
367 /* VMBus Version Supported parameters */
368 struct vmbus_channel_version_supported
{
369 struct vmbus_channel_message_header header
;
370 bool version_supported
;
373 /* Offer Channel parameters */
374 struct vmbus_channel_offer_channel
{
375 struct vmbus_channel_message_header header
;
376 struct vmbus_channel_offer offer
;
379 bool monitor_allocated
;
382 /* Rescind Offer parameters */
383 struct vmbus_channel_rescind_offer
{
384 struct vmbus_channel_message_header header
;
389 * Request Offer -- no parameters, SynIC message contains the partition ID
390 * Set Snoop -- no parameters, SynIC message contains the partition ID
391 * Clear Snoop -- no parameters, SynIC message contains the partition ID
392 * All Offers Delivered -- no parameters, SynIC message contains the partition
394 * Flush Client -- no parameters, SynIC message contains the partition ID
397 /* Open Channel parameters */
398 struct vmbus_channel_open_channel
{
399 struct vmbus_channel_message_header header
;
401 /* Identifies the specific VMBus channel that is being opened. */
404 /* ID making a particular open request at a channel offer unique. */
407 /* GPADL for the channel's ring buffer. */
408 u32 ringbuffer_gpadlhandle
;
410 /* GPADL for the channel's server context save area. */
411 u32 server_contextarea_gpadlhandle
;
414 * The upstream ring buffer begins at offset zero in the memory
415 * described by RingBufferGpadlHandle. The downstream ring buffer
416 * follows it at this offset (in pages).
418 u32 downstream_ringbuffer_pageoffset
;
420 /* User-specific data to be passed along to the server endpoint. */
421 unsigned char userdata
[MAX_USER_DEFINED_BYTES
];
424 /* Open Channel Result parameters */
425 struct vmbus_channel_open_result
{
426 struct vmbus_channel_message_header header
;
432 /* Close channel parameters; */
433 struct vmbus_channel_close_channel
{
434 struct vmbus_channel_message_header header
;
438 /* Channel Message GPADL */
439 #define GPADL_TYPE_RING_BUFFER 1
440 #define GPADL_TYPE_SERVER_SAVE_AREA 2
441 #define GPADL_TYPE_TRANSACTION 8
444 * The number of PFNs in a GPADL message is defined by the number of
445 * pages that would be spanned by ByteCount and ByteOffset. If the
446 * implied number of PFNs won't fit in this packet, there will be a
447 * follow-up packet that contains more.
449 struct vmbus_channel_gpadl_header
{
450 struct vmbus_channel_message_header header
;
455 struct gpa_range range
[0];
458 /* This is the followup packet that contains more PFNs. */
459 struct vmbus_channel_gpadl_body
{
460 struct vmbus_channel_message_header header
;
466 struct vmbus_channel_gpadl_created
{
467 struct vmbus_channel_message_header header
;
473 struct vmbus_channel_gpadl_teardown
{
474 struct vmbus_channel_message_header header
;
479 struct vmbus_channel_gpadl_torndown
{
480 struct vmbus_channel_message_header header
;
484 #ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
485 struct vmbus_channel_view_range_add
{
486 struct vmbus_channel_message_header header
;
487 PHYSICAL_ADDRESS viewrange_base
;
488 u64 viewrange_length
;
492 struct vmbus_channel_view_range_remove
{
493 struct vmbus_channel_message_header header
;
494 PHYSICAL_ADDRESS viewrange_base
;
499 struct vmbus_channel_relid_released
{
500 struct vmbus_channel_message_header header
;
504 struct vmbus_channel_initiate_contact
{
505 struct vmbus_channel_message_header header
;
506 u32 vmbus_version_requested
;
513 struct vmbus_channel_version_response
{
514 struct vmbus_channel_message_header header
;
515 bool version_supported
;
518 enum vmbus_channel_state
{
520 CHANNEL_OPENING_STATE
,
524 struct vmbus_channel_debug_info
{
526 enum vmbus_channel_state state
;
527 uuid_le interfacetype
;
528 uuid_le interface_instance
;
530 u32 servermonitor_pending
;
531 u32 servermonitor_latency
;
532 u32 servermonitor_connectionid
;
533 u32 clientmonitor_pending
;
534 u32 clientmonitor_latency
;
535 u32 clientmonitor_connectionid
;
537 struct hv_ring_buffer_debug_info inbound
;
538 struct hv_ring_buffer_debug_info outbound
;
542 * Represents each channel msg on the vmbus connection This is a
543 * variable-size data structure depending on the msg type itself
545 struct vmbus_channel_msginfo
{
546 /* Bookkeeping stuff */
547 struct list_head msglistentry
;
549 /* So far, this is only used to handle gpadl body message */
550 struct list_head submsglist
;
552 /* Synchronize the request/response if needed */
553 struct completion waitevent
;
555 struct vmbus_channel_version_supported version_supported
;
556 struct vmbus_channel_open_result open_result
;
557 struct vmbus_channel_gpadl_torndown gpadl_torndown
;
558 struct vmbus_channel_gpadl_created gpadl_created
;
559 struct vmbus_channel_version_response version_response
;
564 * The channel message that goes out on the "wire".
565 * It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header
567 unsigned char msg
[0];
570 struct vmbus_close_msg
{
571 struct vmbus_channel_msginfo info
;
572 struct vmbus_channel_close_channel msg
;
575 struct vmbus_channel
{
576 struct list_head listentry
;
578 struct hv_device
*device_obj
;
580 struct work_struct work
;
582 enum vmbus_channel_state state
;
584 * For util channels, stash the
585 * the service index for easy access.
589 struct vmbus_channel_offer_channel offermsg
;
591 * These are based on the OfferMsg.MonitorId.
592 * Save it here for easy access.
597 u32 ringbuffer_gpadlhandle
;
599 /* Allocated memory for ring buffer */
600 void *ringbuffer_pages
;
601 u32 ringbuffer_pagecount
;
602 struct hv_ring_buffer_info outbound
; /* send to parent */
603 struct hv_ring_buffer_info inbound
; /* receive from parent */
604 spinlock_t inbound_lock
;
605 struct workqueue_struct
*controlwq
;
607 struct vmbus_close_msg close_msg
;
609 /* Channel callback are invoked in this workqueue context */
610 /* HANDLE dataWorkQueue; */
612 void (*onchannel_callback
)(void *context
);
613 void *channel_callback_context
;
616 void free_channel(struct vmbus_channel
*channel
);
618 void vmbus_onmessage(void *context
);
620 int vmbus_request_offers(void);
622 /* The format must be the same as struct vmdata_gpa_direct */
623 struct vmbus_channel_packet_page_buffer
{
631 struct hv_page_buffer range
[MAX_PAGE_BUFFER_COUNT
];
634 /* The format must be the same as struct vmdata_gpa_direct */
635 struct vmbus_channel_packet_multipage_buffer
{
642 u32 rangecount
; /* Always 1 in this case */
643 struct hv_multipage_buffer range
;
647 extern int vmbus_open(struct vmbus_channel
*channel
,
648 u32 send_ringbuffersize
,
649 u32 recv_ringbuffersize
,
652 void(*onchannel_callback
)(void *context
),
655 extern void vmbus_close(struct vmbus_channel
*channel
);
657 extern int vmbus_sendpacket(struct vmbus_channel
*channel
,
661 enum vmbus_packet_type type
,
664 extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel
*channel
,
665 struct hv_page_buffer pagebuffers
[],
671 extern int vmbus_sendpacket_multipagebuffer(struct vmbus_channel
*channel
,
672 struct hv_multipage_buffer
*mpb
,
677 extern int vmbus_establish_gpadl(struct vmbus_channel
*channel
,
682 extern int vmbus_teardown_gpadl(struct vmbus_channel
*channel
,
685 extern int vmbus_recvpacket(struct vmbus_channel
*channel
,
688 u32
*buffer_actual_len
,
691 extern int vmbus_recvpacket_raw(struct vmbus_channel
*channel
,
694 u32
*buffer_actual_len
,
698 extern void vmbus_get_debug_info(struct vmbus_channel
*channel
,
699 struct vmbus_channel_debug_info
*debug
);
701 extern void vmbus_ontimer(unsigned long data
);
704 #define LOWORD(dw) ((unsigned short)(dw))
705 #define HIWORD(dw) ((unsigned short)(((unsigned int) (dw) >> 16) & 0xFFFF))
709 #define STORVSC 0x0002
710 #define NETVSC 0x0004
711 #define INPUTVSC 0x0008
712 #define BLKVSC 0x0010
713 #define VMBUS_DRV 0x0100
714 #define STORVSC_DRV 0x0200
715 #define NETVSC_DRV 0x0400
716 #define INPUTVSC_DRV 0x0800
717 #define BLKVSC_DRV 0x1000
719 #define ALL_MODULES (VMBUS |\
732 #define WARNING_LVL 4
735 #define DEBUG_LVL_ENTEREXIT 8
736 #define DEBUG_RING_LVL 9
738 extern unsigned int vmbus_loglevel
;
740 #define DPRINT(mod, lvl, fmt, args...) do {\
741 if ((mod & (HIWORD(vmbus_loglevel))) && \
742 (lvl <= LOWORD(vmbus_loglevel))) \
743 printk(KERN_DEBUG #mod": %s() " fmt "\n", __func__, ## args);\
746 #define DPRINT_DBG(mod, fmt, args...) do {\
747 if ((mod & (HIWORD(vmbus_loglevel))) && \
748 (DEBUG_LVL <= LOWORD(vmbus_loglevel))) \
749 printk(KERN_DEBUG #mod": %s() " fmt "\n", __func__, ## args);\
752 #define DPRINT_INFO(mod, fmt, args...) do {\
753 if ((mod & (HIWORD(vmbus_loglevel))) && \
754 (INFO_LVL <= LOWORD(vmbus_loglevel))) \
755 printk(KERN_INFO #mod": " fmt "\n", ## args);\
758 #define DPRINT_WARN(mod, fmt, args...) do {\
759 if ((mod & (HIWORD(vmbus_loglevel))) && \
760 (WARNING_LVL <= LOWORD(vmbus_loglevel))) \
761 printk(KERN_WARNING #mod": WARNING! " fmt "\n", ## args);\
764 #define DPRINT_ERR(mod, fmt, args...) do {\
765 if ((mod & (HIWORD(vmbus_loglevel))) && \
766 (ERROR_LVL <= LOWORD(vmbus_loglevel))) \
767 printk(KERN_ERR #mod": %s() ERROR!! " fmt "\n", \
776 struct hv_dev_port_info
{
780 u32 bytes_avail_toread
;
781 u32 bytes_avail_towrite
;
784 struct hv_device_info
{
788 uuid_le chn_instance
;
791 u32 server_monitor_pending
;
792 u32 server_monitor_latency
;
793 u32 server_monitor_conn_id
;
794 u32 client_monitor_pending
;
795 u32 client_monitor_latency
;
796 u32 client_monitor_conn_id
;
798 struct hv_dev_port_info inbound
;
799 struct hv_dev_port_info outbound
;
802 /* Base driver object */
806 /* the device type supported by this driver */
809 struct device_driver driver
;
811 int (*probe
)(struct hv_device
*);
812 int (*remove
)(struct hv_device
*);
813 void (*shutdown
)(struct hv_device
*);
817 /* Base device object */
819 /* the device type id of this device */
822 /* the device instance id of this device */
823 uuid_le dev_instance
;
825 struct device device
;
827 struct vmbus_channel
*channel
;
829 /* Device extension; */
834 static inline struct hv_device
*device_to_hv_device(struct device
*d
)
836 return container_of(d
, struct hv_device
, device
);
839 static inline struct hv_driver
*drv_to_hv_drv(struct device_driver
*d
)
841 return container_of(d
, struct hv_driver
, driver
);
845 /* Vmbus interface */
846 int vmbus_child_driver_register(struct device_driver
*drv
);
847 void vmbus_child_driver_unregister(struct device_driver
*drv
);
850 * Common header for Hyper-V ICs
853 #define ICMSGTYPE_NEGOTIATE 0
854 #define ICMSGTYPE_HEARTBEAT 1
855 #define ICMSGTYPE_KVPEXCHANGE 2
856 #define ICMSGTYPE_SHUTDOWN 3
857 #define ICMSGTYPE_TIMESYNC 4
858 #define ICMSGTYPE_VSS 5
860 #define ICMSGHDRFLAG_TRANSACTION 1
861 #define ICMSGHDRFLAG_REQUEST 2
862 #define ICMSGHDRFLAG_RESPONSE 4
864 #define HV_S_OK 0x00000000
865 #define HV_E_FAIL 0x80004005
866 #define HV_ERROR_NOT_SUPPORTED 0x80070032
867 #define HV_ERROR_MACHINE_LOCKED 0x800704F7
869 struct vmbuspipe_hdr
{
880 struct ic_version icverframe
;
882 struct ic_version icvermsg
;
890 struct icmsg_negotiate
{
894 struct ic_version icversion_data
[1]; /* any size array */
897 struct shutdown_msg_data
{
901 u8 display_message
[2048];
904 struct heartbeat_msg_data
{
909 /* Time Sync IC defs */
910 #define ICTIMESYNCFLAG_PROBE 0
911 #define ICTIMESYNCFLAG_SYNC 1
912 #define ICTIMESYNCFLAG_SAMPLE 2
915 #define WLTIMEDELTA 116444736000000000L /* in 100ns unit */
917 #define WLTIMEDELTA 116444736000000000LL
920 struct ictimesync_data
{
927 /* Index for each IC struct in array hv_cb_utils[] */
928 #define HV_SHUTDOWN_MSG 0
929 #define HV_TIMESYNC_MSG 1
930 #define HV_HEARTBEAT_MSG 2
933 struct hyperv_service_callback
{
937 struct vmbus_channel
*channel
;
938 void (*callback
) (void *context
);
941 extern void prep_negotiate_resp(struct icmsg_hdr
*,
942 struct icmsg_negotiate
*, u8
*);
943 extern void chn_cb_negotiate(void *);
944 extern struct hyperv_service_callback hv_cb_utils
[];
946 #endif /* _HYPERV_H */