Deleted Added
full compact
hv_vmbus_priv.h (301019) hv_vmbus_priv.h (301106)
1/*-
2 * Copyright (c) 2009-2012,2016 Microsoft Corp.
3 * Copyright (c) 2012 NetApp Inc.
4 * Copyright (c) 2012 Citrix Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 2009-2012,2016 Microsoft Corp.
3 * Copyright (c) 2012 NetApp Inc.
4 * Copyright (c) 2012 Citrix Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h 301019 2016-05-31 05:18:55Z sephe $
28 * $FreeBSD: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h 301106 2016-06-01 06:51:44Z sephe $
29 */
30
31#ifndef __HYPERV_PRIV_H__
32#define __HYPERV_PRIV_H__
33
34#include <sys/param.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

--- 9 unchanged lines hidden (view full) ---

46typedef uint16_t hv_vmbus_status;
47
48#define HV_MESSAGE_SIZE (256)
49#define HV_MESSAGE_PAYLOAD_BYTE_COUNT (240)
50#define HV_MESSAGE_PAYLOAD_QWORD_COUNT (30)
51#define HV_ANY_VP (0xFFFFFFFF)
52
53/*
29 */
30
31#ifndef __HYPERV_PRIV_H__
32#define __HYPERV_PRIV_H__
33
34#include <sys/param.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

--- 9 unchanged lines hidden (view full) ---

46typedef uint16_t hv_vmbus_status;
47
48#define HV_MESSAGE_SIZE (256)
49#define HV_MESSAGE_PAYLOAD_BYTE_COUNT (240)
50#define HV_MESSAGE_PAYLOAD_QWORD_COUNT (30)
51#define HV_ANY_VP (0xFFFFFFFF)
52
53/*
54 * Synthetic interrupt controller flag constants.
55 */
56
57#define HV_EVENT_FLAGS_COUNT (256 * 8)
58#define HV_EVENT_FLAGS_BYTE_COUNT (256)
59#define HV_EVENT_FLAGS_DWORD_COUNT (256 / sizeof(uint32_t))
60#define HV_EVENT_FLAGS_ULONG_COUNT (256 / sizeof(unsigned long))
61
62/**
63 * max channel count <== event_flags_dword_count * bit_of_dword
64 */
65#ifdef __LP64__
66#define HV_CHANNEL_ULONG_LEN (64)
67#define HV_CHANNEL_ULONG_SHIFT (6)
68#else
69#define HV_CHANNEL_ULONG_LEN (32)
70#define HV_CHANNEL_ULONG_SHIFT (5)
71#endif
72#define HV_CHANNEL_DWORD_LEN (32)
73#define HV_CHANNEL_MAX_COUNT \
74 ((HV_EVENT_FLAGS_DWORD_COUNT) * HV_CHANNEL_DWORD_LEN)
75/*
76 * MessageId: HV_STATUS_INSUFFICIENT_BUFFERS
77 * MessageText:
78 * You did not supply enough message buffers to send a message.
79 */
80
81#define HV_STATUS_SUCCESS ((uint16_t)0)
82#define HV_STATUS_INSUFFICIENT_BUFFERS ((uint16_t)0x0013)
83

--- 106 unchanged lines hidden (view full) ---

190 HV_VMBUS_MONITOR_CONNECTION_ID = 3,
191 HV_VMBUS_MONITOR_PORT_ID = 3,
192};
193
194#define HV_PRESENT_BIT 0x80000000
195
196#define HV_HYPERCALL_PARAM_ALIGN sizeof(uint64_t)
197
54 * MessageId: HV_STATUS_INSUFFICIENT_BUFFERS
55 * MessageText:
56 * You did not supply enough message buffers to send a message.
57 */
58
59#define HV_STATUS_SUCCESS ((uint16_t)0)
60#define HV_STATUS_INSUFFICIENT_BUFFERS ((uint16_t)0x0013)
61

--- 106 unchanged lines hidden (view full) ---

168 HV_VMBUS_MONITOR_CONNECTION_ID = 3,
169 HV_VMBUS_MONITOR_PORT_ID = 3,
170};
171
172#define HV_PRESENT_BIT 0x80000000
173
174#define HV_HYPERCALL_PARAM_ALIGN sizeof(uint64_t)
175
198struct vmbus_message;
199union vmbus_event_flags;
200
201/*
202 * Define hypervisor message types
203 */
204typedef enum {
205
206 HV_MESSAGE_TYPE_NONE = 0x00000000,
207
208 /*

--- 40 unchanged lines hidden (view full) ---

249 uint32_t id:24;
250 uint32_t reserved:8;
251 } u ;
252} hv_vmbus_port_id;
253
254typedef uint64_t hv_vmbus_partition_id;
255
256/*
176/*
177 * Define hypervisor message types
178 */
179typedef enum {
180
181 HV_MESSAGE_TYPE_NONE = 0x00000000,
182
183 /*

--- 40 unchanged lines hidden (view full) ---

224 uint32_t id:24;
225 uint32_t reserved:8;
226 } u ;
227} hv_vmbus_port_id;
228
229typedef uint64_t hv_vmbus_partition_id;
230
231/*
257 * Maximum channels is determined by the size of the interrupt
258 * page which is PAGE_SIZE. 1/2 of PAGE_SIZE is for
259 * send endpoint interrupt and the other is receive
260 * endpoint interrupt.
261 *
262 * Note: (PAGE_SIZE >> 1) << 3 allocates 16348 channels
263 */
264#define HV_MAX_NUM_CHANNELS (PAGE_SIZE >> 1) << 3
265
266/*
267 * (The value here must be in multiple of 32)
268 */
269#define HV_MAX_NUM_CHANNELS_SUPPORTED 256
270
271/*
272 * VM Bus connection states
273 */
274typedef enum {
275 HV_DISCONNECTED,
276 HV_CONNECTING,
277 HV_CONNECTED,
278 HV_DISCONNECTING
279} hv_vmbus_connect_state;

--- 106 unchanged lines hidden (view full) ---

386 hv_vmbus_connection_id connection_id;
387 uint32_t reserved;
388 hv_vmbus_msg_type message_type;
389 uint32_t payload_size;
390 uint64_t payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
391} hv_vmbus_input_post_message;
392
393/*
232 * VM Bus connection states
233 */
234typedef enum {
235 HV_DISCONNECTED,
236 HV_CONNECTING,
237 HV_CONNECTED,
238 HV_DISCONNECTING
239} hv_vmbus_connect_state;

--- 106 unchanged lines hidden (view full) ---

346 hv_vmbus_connection_id connection_id;
347 uint32_t reserved;
348 hv_vmbus_msg_type message_type;
349 uint32_t payload_size;
350 uint64_t payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT];
351} hv_vmbus_input_post_message;
352
353/*
394 * Define the synthetic interrupt controller event flags format
395 */
396typedef union vmbus_event_flags {
397 uint8_t flags8[HV_EVENT_FLAGS_BYTE_COUNT];
398 uint32_t flags32[HV_EVENT_FLAGS_DWORD_COUNT];
399 unsigned long flagsul[HV_EVENT_FLAGS_ULONG_COUNT];
400} hv_vmbus_synic_event_flags;
401CTASSERT(sizeof(hv_vmbus_synic_event_flags) == HV_EVENT_FLAGS_BYTE_COUNT);
402
403/*
404 * Declare the various hypercall operations
405 */
406typedef enum {
407 HV_CALL_POST_MESSAGE = 0x005c,
408 HV_CALL_SIGNAL_EVENT = 0x005d,
409} hv_vmbus_call_code;
410
411/**

--- 100 unchanged lines hidden ---
354 * Declare the various hypercall operations
355 */
356typedef enum {
357 HV_CALL_POST_MESSAGE = 0x005c,
358 HV_CALL_SIGNAL_EVENT = 0x005d,
359} hv_vmbus_call_code;
360
361/**

--- 100 unchanged lines hidden ---