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_debug_info
{
528 enum vmbus_channel_state state
;
529 struct hv_guid interfacetype
;
530 struct hv_guid interface_instance
;
532 u32 servermonitor_pending
;
533 u32 servermonitor_latency
;
534 u32 servermonitor_connectionid
;
535 u32 clientmonitor_pending
;
536 u32 clientmonitor_latency
;
537 u32 clientmonitor_connectionid
;
539 struct hv_ring_buffer_debug_info inbound
;
540 struct hv_ring_buffer_debug_info outbound
;
544 * Represents each channel msg on the vmbus connection This is a
545 * variable-size data structure depending on the msg type itself
547 struct vmbus_channel_msginfo
{
548 /* Bookkeeping stuff */
549 struct list_head msglistentry
;
551 /* So far, this is only used to handle gpadl body message */
552 struct list_head submsglist
;
554 /* Synchronize the request/response if needed */
555 struct completion waitevent
;
557 struct vmbus_channel_version_supported version_supported
;
558 struct vmbus_channel_open_result open_result
;
559 struct vmbus_channel_gpadl_torndown gpadl_torndown
;
560 struct vmbus_channel_gpadl_created gpadl_created
;
561 struct vmbus_channel_version_response version_response
;
566 * The channel message that goes out on the "wire".
567 * It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header
569 unsigned char msg
[0];
572 struct vmbus_close_msg
{
573 struct vmbus_channel_msginfo info
;
574 struct vmbus_channel_close_channel msg
;
577 struct vmbus_channel
{
578 struct list_head listentry
;
580 struct hv_device
*device_obj
;
582 struct work_struct work
;
584 enum vmbus_channel_state state
;
586 * For util channels, stash the
587 * the service index for easy access.
591 struct vmbus_channel_offer_channel offermsg
;
593 * These are based on the OfferMsg.MonitorId.
594 * Save it here for easy access.
599 u32 ringbuffer_gpadlhandle
;
601 /* Allocated memory for ring buffer */
602 void *ringbuffer_pages
;
603 u32 ringbuffer_pagecount
;
604 struct hv_ring_buffer_info outbound
; /* send to parent */
605 struct hv_ring_buffer_info inbound
; /* receive from parent */
606 spinlock_t inbound_lock
;
607 struct workqueue_struct
*controlwq
;
609 struct vmbus_close_msg close_msg
;
611 /* Channel callback are invoked in this workqueue context */
612 /* HANDLE dataWorkQueue; */
614 void (*onchannel_callback
)(void *context
);
615 void *channel_callback_context
;
618 void free_channel(struct vmbus_channel
*channel
);
620 void vmbus_onmessage(void *context
);
622 int vmbus_request_offers(void);
624 /* The format must be the same as struct vmdata_gpa_direct */
625 struct vmbus_channel_packet_page_buffer
{
633 struct hv_page_buffer range
[MAX_PAGE_BUFFER_COUNT
];
636 /* The format must be the same as struct vmdata_gpa_direct */
637 struct vmbus_channel_packet_multipage_buffer
{
644 u32 rangecount
; /* Always 1 in this case */
645 struct hv_multipage_buffer range
;
649 extern int vmbus_open(struct vmbus_channel
*channel
,
650 u32 send_ringbuffersize
,
651 u32 recv_ringbuffersize
,
654 void(*onchannel_callback
)(void *context
),
657 extern void vmbus_close(struct vmbus_channel
*channel
);
659 extern int vmbus_sendpacket(struct vmbus_channel
*channel
,
663 enum vmbus_packet_type type
,
666 extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel
*channel
,
667 struct hv_page_buffer pagebuffers
[],
673 extern int vmbus_sendpacket_multipagebuffer(struct vmbus_channel
*channel
,
674 struct hv_multipage_buffer
*mpb
,
679 extern int vmbus_establish_gpadl(struct vmbus_channel
*channel
,
684 extern int vmbus_teardown_gpadl(struct vmbus_channel
*channel
,
687 extern int vmbus_recvpacket(struct vmbus_channel
*channel
,
690 u32
*buffer_actual_len
,
693 extern int vmbus_recvpacket_raw(struct vmbus_channel
*channel
,
696 u32
*buffer_actual_len
,
700 extern void vmbus_get_debug_info(struct vmbus_channel
*channel
,
701 struct vmbus_channel_debug_info
*debug
);
703 extern void vmbus_ontimer(unsigned long data
);
706 #define LOWORD(dw) ((unsigned short)(dw))
707 #define HIWORD(dw) ((unsigned short)(((unsigned int) (dw) >> 16) & 0xFFFF))
711 #define STORVSC 0x0002
712 #define NETVSC 0x0004
713 #define INPUTVSC 0x0008
714 #define BLKVSC 0x0010
715 #define VMBUS_DRV 0x0100
716 #define STORVSC_DRV 0x0200
717 #define NETVSC_DRV 0x0400
718 #define INPUTVSC_DRV 0x0800
719 #define BLKVSC_DRV 0x1000
721 #define ALL_MODULES (VMBUS |\
734 #define WARNING_LVL 4
737 #define DEBUG_LVL_ENTEREXIT 8
738 #define DEBUG_RING_LVL 9
740 extern unsigned int vmbus_loglevel
;
742 #define DPRINT(mod, lvl, fmt, args...) do {\
743 if ((mod & (HIWORD(vmbus_loglevel))) && \
744 (lvl <= LOWORD(vmbus_loglevel))) \
745 printk(KERN_DEBUG #mod": %s() " fmt "\n", __func__, ## args);\
748 #define DPRINT_DBG(mod, fmt, args...) do {\
749 if ((mod & (HIWORD(vmbus_loglevel))) && \
750 (DEBUG_LVL <= LOWORD(vmbus_loglevel))) \
751 printk(KERN_DEBUG #mod": %s() " fmt "\n", __func__, ## args);\
754 #define DPRINT_INFO(mod, fmt, args...) do {\
755 if ((mod & (HIWORD(vmbus_loglevel))) && \
756 (INFO_LVL <= LOWORD(vmbus_loglevel))) \
757 printk(KERN_INFO #mod": " fmt "\n", ## args);\
760 #define DPRINT_WARN(mod, fmt, args...) do {\
761 if ((mod & (HIWORD(vmbus_loglevel))) && \
762 (WARNING_LVL <= LOWORD(vmbus_loglevel))) \
763 printk(KERN_WARNING #mod": WARNING! " fmt "\n", ## args);\
766 #define DPRINT_ERR(mod, fmt, args...) do {\
767 if ((mod & (HIWORD(vmbus_loglevel))) && \
768 (ERROR_LVL <= LOWORD(vmbus_loglevel))) \
769 printk(KERN_ERR #mod": %s() ERROR!! " fmt "\n", \
778 struct hv_dev_port_info
{
782 u32 bytes_avail_toread
;
783 u32 bytes_avail_towrite
;
786 struct hv_device_info
{
789 struct hv_guid chn_type
;
790 struct hv_guid chn_instance
;
793 u32 server_monitor_pending
;
794 u32 server_monitor_latency
;
795 u32 server_monitor_conn_id
;
796 u32 client_monitor_pending
;
797 u32 client_monitor_latency
;
798 u32 client_monitor_conn_id
;
800 struct hv_dev_port_info inbound
;
801 struct hv_dev_port_info outbound
;
804 /* Base driver object */
808 /* the device type supported by this driver */
809 struct hv_guid dev_type
;
811 struct device_driver driver
;
813 int (*probe
)(struct hv_device
*);
814 int (*remove
)(struct hv_device
*);
815 void (*shutdown
)(struct hv_device
*);
819 /* Base device object */
821 /* the device type id of this device */
822 struct hv_guid dev_type
;
824 /* the device instance id of this device */
825 struct hv_guid dev_instance
;
827 struct device device
;
829 struct vmbus_channel
*channel
;
831 /* Device extension; */
836 static inline struct hv_device
*device_to_hv_device(struct device
*d
)
838 return container_of(d
, struct hv_device
, device
);
841 static inline struct hv_driver
*drv_to_hv_drv(struct device_driver
*d
)
843 return container_of(d
, struct hv_driver
, driver
);
847 /* Vmbus interface */
848 int vmbus_child_driver_register(struct device_driver
*drv
);
849 void vmbus_child_driver_unregister(struct device_driver
*drv
);
852 * Common header for Hyper-V ICs
855 #define ICMSGTYPE_NEGOTIATE 0
856 #define ICMSGTYPE_HEARTBEAT 1
857 #define ICMSGTYPE_KVPEXCHANGE 2
858 #define ICMSGTYPE_SHUTDOWN 3
859 #define ICMSGTYPE_TIMESYNC 4
860 #define ICMSGTYPE_VSS 5
862 #define ICMSGHDRFLAG_TRANSACTION 1
863 #define ICMSGHDRFLAG_REQUEST 2
864 #define ICMSGHDRFLAG_RESPONSE 4
866 #define HV_S_OK 0x00000000
867 #define HV_E_FAIL 0x80004005
868 #define HV_ERROR_NOT_SUPPORTED 0x80070032
869 #define HV_ERROR_MACHINE_LOCKED 0x800704F7
871 struct vmbuspipe_hdr
{
882 struct ic_version icverframe
;
884 struct ic_version icvermsg
;
892 struct icmsg_negotiate
{
896 struct ic_version icversion_data
[1]; /* any size array */
899 struct shutdown_msg_data
{
903 u8 display_message
[2048];
906 struct heartbeat_msg_data
{
911 /* Time Sync IC defs */
912 #define ICTIMESYNCFLAG_PROBE 0
913 #define ICTIMESYNCFLAG_SYNC 1
914 #define ICTIMESYNCFLAG_SAMPLE 2
917 #define WLTIMEDELTA 116444736000000000L /* in 100ns unit */
919 #define WLTIMEDELTA 116444736000000000LL
922 struct ictimesync_data
{
929 /* Index for each IC struct in array hv_cb_utils[] */
930 #define HV_SHUTDOWN_MSG 0
931 #define HV_TIMESYNC_MSG 1
932 #define HV_HEARTBEAT_MSG 2
935 struct hyperv_service_callback
{
938 unsigned char data
[16];
939 struct vmbus_channel
*channel
;
940 void (*callback
) (void *context
);
943 extern void prep_negotiate_resp(struct icmsg_hdr
*,
944 struct icmsg_negotiate
*, u8
*);
945 extern void chn_cb_negotiate(void *);
946 extern struct hyperv_service_callback hv_cb_utils
[];
948 #endif /* _HYPERV_H */