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/timer.h>
31 #include <linux/workqueue.h>
32 #include <linux/completion.h>
33 #include <linux/device.h>
36 #include <asm/hyperv.h>
39 unsigned char data
[16];
42 #define MAX_PAGE_BUFFER_COUNT 16
43 #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
47 /* Single-page buffer */
48 struct hv_page_buffer
{
54 /* Multiple-page buffer */
55 struct hv_multipage_buffer
{
56 /* Length and Offset determines the # of pfns in the array */
59 u64 pfn_array
[MAX_MULTIPAGE_BUFFER_COUNT
];
62 /* 0x18 includes the proprietary packet header */
63 #define MAX_PAGE_BUFFER_PACKET (0x18 + \
64 (sizeof(struct hv_page_buffer) * \
65 MAX_PAGE_BUFFER_COUNT))
66 #define MAX_MULTIPAGE_BUFFER_PACKET (0x18 + \
67 sizeof(struct hv_multipage_buffer))
72 struct hv_ring_buffer
{
73 /* Offset in bytes from the start of ring data below */
76 /* Offset in bytes from the start of ring data below */
81 /* Pad it to PAGE_SIZE so that data starts on page boundary */
85 * The interrupt_mask field is used only for channels but since our
86 * vmbus connection also uses this data structure and its data starts
87 * here, we commented out this field.
91 * Ring data starts here + RingDataStartOffset
92 * !!! DO NOT place any fields below this !!!
97 struct hv_ring_buffer_info
{
98 struct hv_ring_buffer
*ring_buffer
;
99 u32 ring_size
; /* Include the shared header */
100 spinlock_t ring_lock
;
102 u32 ring_datasize
; /* < ring_size */
103 u32 ring_data_startoffset
;
106 struct hv_ring_buffer_debug_info
{
107 u32 current_interrupt_mask
;
108 u32 current_read_index
;
109 u32 current_write_index
;
110 u32 bytes_avail_toread
;
111 u32 bytes_avail_towrite
;
115 * We use the same version numbering for all Hyper-V modules.
117 * Definition of versioning is as follows;
119 * Major Number Changes for these scenarios;
120 * 1. When a new version of Windows Hyper-V
122 * 2. A Major change has occurred in the
124 * (For example the merge for the first time
125 * into the kernel) Every time the Major Number
126 * changes, the Revision number is reset to 0.
127 * Minor Number Changes when new functionality is added
128 * to the Linux IC's that is not a bug fix.
130 * 3.1 - Added completed hv_utils driver. Shutdown/Heartbeat/Timesync
132 #define HV_DRV_VERSION "3.1"
136 * A revision number of vmbus that is used for ensuring both ends on a
137 * partition are using compatible versions.
139 #define VMBUS_REVISION_NUMBER 13
141 /* Make maximum size of pipe payload of 16K */
142 #define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384)
144 /* Define PipeMode values. */
145 #define VMBUS_PIPE_TYPE_BYTE 0x00000000
146 #define VMBUS_PIPE_TYPE_MESSAGE 0x00000004
148 /* The size of the user defined data buffer for non-pipe offers. */
149 #define MAX_USER_DEFINED_BYTES 120
151 /* The size of the user defined data buffer for pipe offers. */
152 #define MAX_PIPE_USER_DEFINED_BYTES 116
155 * At the center of the Channel Management library is the Channel Offer. This
156 * struct contains the fundamental information about an offer.
158 struct vmbus_channel_offer
{
159 struct hv_guid if_type
;
160 struct hv_guid if_instance
;
161 u64 int_latency
; /* in 100ns units */
163 u32 server_ctx_size
; /* in bytes */
165 u16 mmio_megabytes
; /* in bytes * 1024 * 1024 */
168 /* Non-pipes: The user has MAX_USER_DEFINED_BYTES bytes. */
170 unsigned char user_def
[MAX_USER_DEFINED_BYTES
];
175 * The following sructure is an integrated pipe protocol, which
176 * is implemented on top of standard user-defined data. Pipe
177 * clients have MAX_PIPE_USER_DEFINED_BYTES left for their own
182 unsigned char user_def
[MAX_PIPE_USER_DEFINED_BYTES
];
189 #define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1
190 #define VMBUS_CHANNEL_SERVER_SUPPORTS_TRANSFER_PAGES 2
191 #define VMBUS_CHANNEL_SERVER_SUPPORTS_GPADLS 4
192 #define VMBUS_CHANNEL_NAMED_PIPE_MODE 0x10
193 #define VMBUS_CHANNEL_LOOPBACK_OFFER 0x100
194 #define VMBUS_CHANNEL_PARENT_OFFER 0x200
195 #define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION 0x400
197 struct vmpacket_descriptor
{
205 struct vmpacket_header
{
206 u32 prev_pkt_start_offset
;
207 struct vmpacket_descriptor descriptor
;
210 struct vmtransfer_page_range
{
215 struct vmtransfer_page_packet_header
{
216 struct vmpacket_descriptor d
;
218 bool sender_owns_set
;
221 struct vmtransfer_page_range ranges
[1];
224 struct vmgpadl_packet_header
{
225 struct vmpacket_descriptor d
;
230 struct vmadd_remove_transfer_page_set
{
231 struct vmpacket_descriptor d
;
238 * This structure defines a range in guest physical space that can be made to
239 * look virtually contiguous.
248 * This is the format for an Establish Gpadl packet, which contains a handle by
249 * which this GPADL will be known and a set of GPA ranges associated with it.
250 * This can be converted to a MDL by the guest OS. If there are multiple GPA
251 * ranges, then the resulting MDL will be "chained," representing multiple VA
254 struct vmestablish_gpadl
{
255 struct vmpacket_descriptor d
;
258 struct gpa_range range
[1];
262 * This is the format for a Teardown Gpadl packet, which indicates that the
263 * GPADL handle in the Establish Gpadl packet will never be referenced again.
265 struct vmteardown_gpadl
{
266 struct vmpacket_descriptor d
;
268 u32 reserved
; /* for alignment to a 8-byte boundary */
272 * This is the format for a GPA-Direct packet, which contains a set of GPA
273 * ranges, in addition to commands and/or data.
275 struct vmdata_gpa_direct
{
276 struct vmpacket_descriptor d
;
279 struct gpa_range range
[1];
282 /* This is the format for a Additional Data Packet. */
283 struct vmadditional_data
{
284 struct vmpacket_descriptor d
;
288 unsigned char data
[1];
291 union vmpacket_largest_possible_header
{
292 struct vmpacket_descriptor simple_hdr
;
293 struct vmtransfer_page_packet_header xfer_page_hdr
;
294 struct vmgpadl_packet_header gpadl_hdr
;
295 struct vmadd_remove_transfer_page_set add_rm_xfer_page_hdr
;
296 struct vmestablish_gpadl establish_gpadl_hdr
;
297 struct vmteardown_gpadl teardown_gpadl_hdr
;
298 struct vmdata_gpa_direct data_gpa_direct_hdr
;
301 #define VMPACKET_DATA_START_ADDRESS(__packet) \
302 (void *)(((unsigned char *)__packet) + \
303 ((struct vmpacket_descriptor)__packet)->offset8 * 8)
305 #define VMPACKET_DATA_LENGTH(__packet) \
306 ((((struct vmpacket_descriptor)__packet)->len8 - \
307 ((struct vmpacket_descriptor)__packet)->offset8) * 8)
309 #define VMPACKET_TRANSFER_MODE(__packet) \
310 (((struct IMPACT)__packet)->type)
312 enum vmbus_packet_type
{
313 VM_PKT_INVALID
= 0x0,
315 VM_PKT_ADD_XFER_PAGESET
= 0x2,
316 VM_PKT_RM_XFER_PAGESET
= 0x3,
317 VM_PKT_ESTABLISH_GPADL
= 0x4,
318 VM_PKT_TEARDOWN_GPADL
= 0x5,
319 VM_PKT_DATA_INBAND
= 0x6,
320 VM_PKT_DATA_USING_XFER_PAGES
= 0x7,
321 VM_PKT_DATA_USING_GPADL
= 0x8,
322 VM_PKT_DATA_USING_GPA_DIRECT
= 0x9,
323 VM_PKT_CANCEL_REQUEST
= 0xa,
325 VM_PKT_DATA_USING_ADDITIONAL_PKT
= 0xc,
326 VM_PKT_ADDITIONAL_DATA
= 0xd
329 #define VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED 1
332 /* Version 1 messages */
333 enum vmbus_channel_message_type
{
334 CHANNELMSG_INVALID
= 0,
335 CHANNELMSG_OFFERCHANNEL
= 1,
336 CHANNELMSG_RESCIND_CHANNELOFFER
= 2,
337 CHANNELMSG_REQUESTOFFERS
= 3,
338 CHANNELMSG_ALLOFFERS_DELIVERED
= 4,
339 CHANNELMSG_OPENCHANNEL
= 5,
340 CHANNELMSG_OPENCHANNEL_RESULT
= 6,
341 CHANNELMSG_CLOSECHANNEL
= 7,
342 CHANNELMSG_GPADL_HEADER
= 8,
343 CHANNELMSG_GPADL_BODY
= 9,
344 CHANNELMSG_GPADL_CREATED
= 10,
345 CHANNELMSG_GPADL_TEARDOWN
= 11,
346 CHANNELMSG_GPADL_TORNDOWN
= 12,
347 CHANNELMSG_RELID_RELEASED
= 13,
348 CHANNELMSG_INITIATE_CONTACT
= 14,
349 CHANNELMSG_VERSION_RESPONSE
= 15,
350 CHANNELMSG_UNLOAD
= 16,
351 #ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
352 CHANNELMSG_VIEWRANGE_ADD
= 17,
353 CHANNELMSG_VIEWRANGE_REMOVE
= 18,
358 struct vmbus_channel_message_header
{
359 enum vmbus_channel_message_type msgtype
;
363 /* Query VMBus Version parameters */
364 struct vmbus_channel_query_vmbus_version
{
365 struct vmbus_channel_message_header header
;
369 /* VMBus Version Supported parameters */
370 struct vmbus_channel_version_supported
{
371 struct vmbus_channel_message_header header
;
372 bool version_supported
;
375 /* Offer Channel parameters */
376 struct vmbus_channel_offer_channel
{
377 struct vmbus_channel_message_header header
;
378 struct vmbus_channel_offer offer
;
381 bool monitor_allocated
;
384 /* Rescind Offer parameters */
385 struct vmbus_channel_rescind_offer
{
386 struct vmbus_channel_message_header header
;
391 * Request Offer -- no parameters, SynIC message contains the partition ID
392 * Set Snoop -- no parameters, SynIC message contains the partition ID
393 * Clear Snoop -- no parameters, SynIC message contains the partition ID
394 * All Offers Delivered -- no parameters, SynIC message contains the partition
396 * Flush Client -- no parameters, SynIC message contains the partition ID
399 /* Open Channel parameters */
400 struct vmbus_channel_open_channel
{
401 struct vmbus_channel_message_header header
;
403 /* Identifies the specific VMBus channel that is being opened. */
406 /* ID making a particular open request at a channel offer unique. */
409 /* GPADL for the channel's ring buffer. */
410 u32 ringbuffer_gpadlhandle
;
412 /* GPADL for the channel's server context save area. */
413 u32 server_contextarea_gpadlhandle
;
416 * The upstream ring buffer begins at offset zero in the memory
417 * described by RingBufferGpadlHandle. The downstream ring buffer
418 * follows it at this offset (in pages).
420 u32 downstream_ringbuffer_pageoffset
;
422 /* User-specific data to be passed along to the server endpoint. */
423 unsigned char userdata
[MAX_USER_DEFINED_BYTES
];
426 /* Open Channel Result parameters */
427 struct vmbus_channel_open_result
{
428 struct vmbus_channel_message_header header
;
434 /* Close channel parameters; */
435 struct vmbus_channel_close_channel
{
436 struct vmbus_channel_message_header header
;
440 /* Channel Message GPADL */
441 #define GPADL_TYPE_RING_BUFFER 1
442 #define GPADL_TYPE_SERVER_SAVE_AREA 2
443 #define GPADL_TYPE_TRANSACTION 8
446 * The number of PFNs in a GPADL message is defined by the number of
447 * pages that would be spanned by ByteCount and ByteOffset. If the
448 * implied number of PFNs won't fit in this packet, there will be a
449 * follow-up packet that contains more.
451 struct vmbus_channel_gpadl_header
{
452 struct vmbus_channel_message_header header
;
457 struct gpa_range range
[0];
460 /* This is the followup packet that contains more PFNs. */
461 struct vmbus_channel_gpadl_body
{
462 struct vmbus_channel_message_header header
;
468 struct vmbus_channel_gpadl_created
{
469 struct vmbus_channel_message_header header
;
475 struct vmbus_channel_gpadl_teardown
{
476 struct vmbus_channel_message_header header
;
481 struct vmbus_channel_gpadl_torndown
{
482 struct vmbus_channel_message_header header
;
486 #ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
487 struct vmbus_channel_view_range_add
{
488 struct vmbus_channel_message_header header
;
489 PHYSICAL_ADDRESS viewrange_base
;
490 u64 viewrange_length
;
494 struct vmbus_channel_view_range_remove
{
495 struct vmbus_channel_message_header header
;
496 PHYSICAL_ADDRESS viewrange_base
;
501 struct vmbus_channel_relid_released
{
502 struct vmbus_channel_message_header header
;
506 struct vmbus_channel_initiate_contact
{
507 struct vmbus_channel_message_header header
;
508 u32 vmbus_version_requested
;
515 struct vmbus_channel_version_response
{
516 struct vmbus_channel_message_header header
;
517 bool version_supported
;
520 enum vmbus_channel_state
{
522 CHANNEL_OPENING_STATE
,
526 struct vmbus_channel
{
527 struct list_head listentry
;
529 struct hv_device
*device_obj
;
531 struct timer_list poll_timer
; /* SA-111 workaround */
532 struct work_struct work
;
534 enum vmbus_channel_state state
;
536 * For util channels, stash the
537 * the service index for easy access.
541 struct vmbus_channel_offer_channel offermsg
;
543 * These are based on the OfferMsg.MonitorId.
544 * Save it here for easy access.
549 u32 ringbuffer_gpadlhandle
;
551 /* Allocated memory for ring buffer */
552 void *ringbuffer_pages
;
553 u32 ringbuffer_pagecount
;
554 struct hv_ring_buffer_info outbound
; /* send to parent */
555 struct hv_ring_buffer_info inbound
; /* receive from parent */
556 spinlock_t inbound_lock
;
557 struct workqueue_struct
*controlwq
;
559 /* Channel callback are invoked in this workqueue context */
560 /* HANDLE dataWorkQueue; */
562 void (*onchannel_callback
)(void *context
);
563 void *channel_callback_context
;
566 struct vmbus_channel_debug_info
{
568 enum vmbus_channel_state state
;
569 struct hv_guid interfacetype
;
570 struct hv_guid interface_instance
;
572 u32 servermonitor_pending
;
573 u32 servermonitor_latency
;
574 u32 servermonitor_connectionid
;
575 u32 clientmonitor_pending
;
576 u32 clientmonitor_latency
;
577 u32 clientmonitor_connectionid
;
579 struct hv_ring_buffer_debug_info inbound
;
580 struct hv_ring_buffer_debug_info outbound
;
584 * Represents each channel msg on the vmbus connection This is a
585 * variable-size data structure depending on the msg type itself
587 struct vmbus_channel_msginfo
{
588 /* Bookkeeping stuff */
589 struct list_head msglistentry
;
591 /* So far, this is only used to handle gpadl body message */
592 struct list_head submsglist
;
594 /* Synchronize the request/response if needed */
595 struct completion waitevent
;
597 struct vmbus_channel_version_supported version_supported
;
598 struct vmbus_channel_open_result open_result
;
599 struct vmbus_channel_gpadl_torndown gpadl_torndown
;
600 struct vmbus_channel_gpadl_created gpadl_created
;
601 struct vmbus_channel_version_response version_response
;
606 * The channel message that goes out on the "wire".
607 * It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header
609 unsigned char msg
[0];
613 void free_channel(struct vmbus_channel
*channel
);
615 void vmbus_onmessage(void *context
);
617 int vmbus_request_offers(void);
619 /* The format must be the same as struct vmdata_gpa_direct */
620 struct vmbus_channel_packet_page_buffer
{
628 struct hv_page_buffer range
[MAX_PAGE_BUFFER_COUNT
];
631 /* The format must be the same as struct vmdata_gpa_direct */
632 struct vmbus_channel_packet_multipage_buffer
{
639 u32 rangecount
; /* Always 1 in this case */
640 struct hv_multipage_buffer range
;
644 extern int vmbus_open(struct vmbus_channel
*channel
,
645 u32 send_ringbuffersize
,
646 u32 recv_ringbuffersize
,
649 void(*onchannel_callback
)(void *context
),
652 extern void vmbus_close(struct vmbus_channel
*channel
);
654 extern int vmbus_sendpacket(struct vmbus_channel
*channel
,
658 enum vmbus_packet_type type
,
661 extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel
*channel
,
662 struct hv_page_buffer pagebuffers
[],
668 extern int vmbus_sendpacket_multipagebuffer(struct vmbus_channel
*channel
,
669 struct hv_multipage_buffer
*mpb
,
674 extern int vmbus_establish_gpadl(struct vmbus_channel
*channel
,
679 extern int vmbus_teardown_gpadl(struct vmbus_channel
*channel
,
682 extern int vmbus_recvpacket(struct vmbus_channel
*channel
,
685 u32
*buffer_actual_len
,
688 extern int vmbus_recvpacket_raw(struct vmbus_channel
*channel
,
691 u32
*buffer_actual_len
,
694 extern void vmbus_onchannel_event(struct vmbus_channel
*channel
);
696 extern void vmbus_get_debug_info(struct vmbus_channel
*channel
,
697 struct vmbus_channel_debug_info
*debug
);
699 extern void vmbus_ontimer(unsigned long data
);
702 #define LOWORD(dw) ((unsigned short)(dw))
703 #define HIWORD(dw) ((unsigned short)(((unsigned int) (dw) >> 16) & 0xFFFF))
707 #define STORVSC 0x0002
708 #define NETVSC 0x0004
709 #define INPUTVSC 0x0008
710 #define BLKVSC 0x0010
711 #define VMBUS_DRV 0x0100
712 #define STORVSC_DRV 0x0200
713 #define NETVSC_DRV 0x0400
714 #define INPUTVSC_DRV 0x0800
715 #define BLKVSC_DRV 0x1000
717 #define ALL_MODULES (VMBUS |\
730 #define WARNING_LVL 4
733 #define DEBUG_LVL_ENTEREXIT 8
734 #define DEBUG_RING_LVL 9
736 extern unsigned int vmbus_loglevel
;
738 #define DPRINT(mod, lvl, fmt, args...) do {\
739 if ((mod & (HIWORD(vmbus_loglevel))) && \
740 (lvl <= LOWORD(vmbus_loglevel))) \
741 printk(KERN_DEBUG #mod": %s() " fmt "\n", __func__, ## args);\
744 #define DPRINT_DBG(mod, fmt, args...) do {\
745 if ((mod & (HIWORD(vmbus_loglevel))) && \
746 (DEBUG_LVL <= LOWORD(vmbus_loglevel))) \
747 printk(KERN_DEBUG #mod": %s() " fmt "\n", __func__, ## args);\
750 #define DPRINT_INFO(mod, fmt, args...) do {\
751 if ((mod & (HIWORD(vmbus_loglevel))) && \
752 (INFO_LVL <= LOWORD(vmbus_loglevel))) \
753 printk(KERN_INFO #mod": " fmt "\n", ## args);\
756 #define DPRINT_WARN(mod, fmt, args...) do {\
757 if ((mod & (HIWORD(vmbus_loglevel))) && \
758 (WARNING_LVL <= LOWORD(vmbus_loglevel))) \
759 printk(KERN_WARNING #mod": WARNING! " fmt "\n", ## args);\
762 #define DPRINT_ERR(mod, fmt, args...) do {\
763 if ((mod & (HIWORD(vmbus_loglevel))) && \
764 (ERROR_LVL <= LOWORD(vmbus_loglevel))) \
765 printk(KERN_ERR #mod": %s() ERROR!! " fmt "\n", \
774 struct hv_dev_port_info
{
778 u32 bytes_avail_toread
;
779 u32 bytes_avail_towrite
;
782 struct hv_device_info
{
785 struct hv_guid chn_type
;
786 struct hv_guid chn_instance
;
789 u32 server_monitor_pending
;
790 u32 server_monitor_latency
;
791 u32 server_monitor_conn_id
;
792 u32 client_monitor_pending
;
793 u32 client_monitor_latency
;
794 u32 client_monitor_conn_id
;
796 struct hv_dev_port_info inbound
;
797 struct hv_dev_port_info outbound
;
800 /* Base driver object */
804 /* the device type supported by this driver */
805 struct hv_guid dev_type
;
807 struct device_driver driver
;
809 int (*probe
)(struct hv_device
*);
810 int (*remove
)(struct hv_device
*);
811 void (*shutdown
)(struct hv_device
*);
815 /* Base device object */
817 /* the device type id of this device */
818 struct hv_guid dev_type
;
820 /* the device instance id of this device */
821 struct hv_guid dev_instance
;
823 struct device device
;
825 struct vmbus_channel
*channel
;
827 /* Device extension; */
832 static inline struct hv_device
*device_to_hv_device(struct device
*d
)
834 return container_of(d
, struct hv_device
, device
);
837 static inline struct hv_driver
*drv_to_hv_drv(struct device_driver
*d
)
839 return container_of(d
, struct hv_driver
, driver
);
843 /* Vmbus interface */
844 int vmbus_child_driver_register(struct device_driver
*drv
);
845 void vmbus_child_driver_unregister(struct device_driver
*drv
);
848 * Common header for Hyper-V ICs
851 #define ICMSGTYPE_NEGOTIATE 0
852 #define ICMSGTYPE_HEARTBEAT 1
853 #define ICMSGTYPE_KVPEXCHANGE 2
854 #define ICMSGTYPE_SHUTDOWN 3
855 #define ICMSGTYPE_TIMESYNC 4
856 #define ICMSGTYPE_VSS 5
858 #define ICMSGHDRFLAG_TRANSACTION 1
859 #define ICMSGHDRFLAG_REQUEST 2
860 #define ICMSGHDRFLAG_RESPONSE 4
862 #define HV_S_OK 0x00000000
863 #define HV_E_FAIL 0x80004005
864 #define HV_ERROR_NOT_SUPPORTED 0x80070032
865 #define HV_ERROR_MACHINE_LOCKED 0x800704F7
867 struct vmbuspipe_hdr
{
878 struct ic_version icverframe
;
880 struct ic_version icvermsg
;
888 struct icmsg_negotiate
{
892 struct ic_version icversion_data
[1]; /* any size array */
895 struct shutdown_msg_data
{
899 u8 display_message
[2048];
902 struct heartbeat_msg_data
{
907 /* Time Sync IC defs */
908 #define ICTIMESYNCFLAG_PROBE 0
909 #define ICTIMESYNCFLAG_SYNC 1
910 #define ICTIMESYNCFLAG_SAMPLE 2
913 #define WLTIMEDELTA 116444736000000000L /* in 100ns unit */
915 #define WLTIMEDELTA 116444736000000000LL
918 struct ictimesync_data
{
925 /* Index for each IC struct in array hv_cb_utils[] */
926 #define HV_SHUTDOWN_MSG 0
927 #define HV_TIMESYNC_MSG 1
928 #define HV_HEARTBEAT_MSG 2
931 struct hyperv_service_callback
{
934 unsigned char data
[16];
935 struct vmbus_channel
*channel
;
936 void (*callback
) (void *context
);
939 extern void prep_negotiate_resp(struct icmsg_hdr
*,
940 struct icmsg_negotiate
*, u8
*);
941 extern void chn_cb_negotiate(void *);
942 extern struct hyperv_service_callback hv_cb_utils
[];
944 #endif /* _HYPERV_H */