hyperv.h (307306) | hyperv.h (307307) |
---|---|
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: stable/11/sys/dev/hyperv/include/hyperv.h 307306 2016-10-14 08:34:44Z sephe $ | 28 * $FreeBSD: stable/11/sys/dev/hyperv/include/hyperv.h 307307 2016-10-14 08:45:53Z sephe $ |
29 */ 30 31/** 32 * HyperV definitions for messages that are sent between instances of the 33 * Channel Management Library in separate partitions, or in some cases, 34 * back to itself. 35 */ 36 --- 357 unchanged lines hidden (view full) --- 394 395typedef struct { 396 hv_vmbus_channel_msg_header header; 397 uint32_t child_rel_id; 398} __packed hv_vmbus_channel_relid_released; 399 400#define HW_MACADDR_LEN 6 401 | 29 */ 30 31/** 32 * HyperV definitions for messages that are sent between instances of the 33 * Channel Management Library in separate partitions, or in some cases, 34 * back to itself. 35 */ 36 --- 357 unchanged lines hidden (view full) --- 394 395typedef struct { 396 hv_vmbus_channel_msg_header header; 397 uint32_t child_rel_id; 398} __packed hv_vmbus_channel_relid_released; 399 400#define HW_MACADDR_LEN 6 401 |
402enum { 403 HV_VMBUS_IVAR_TYPE, 404 HV_VMBUS_IVAR_INSTANCE, 405 HV_VMBUS_IVAR_NODE, 406 HV_VMBUS_IVAR_DEVCTX 407}; 408 409#define HV_VMBUS_ACCESSOR(var, ivar, type) \ 410 __BUS_ACCESSOR(vmbus, var, HV_VMBUS, ivar, type) 411 412HV_VMBUS_ACCESSOR(type, TYPE, const char *) 413HV_VMBUS_ACCESSOR(devctx, DEVCTX, struct hv_device *) 414 415 | |
416/* 417 * Common defines for Hyper-V ICs 418 */ 419#define HV_ICMSGTYPE_NEGOTIATE 0 420#define HV_ICMSGTYPE_HEARTBEAT 1 421#define HV_ICMSGTYPE_KVPEXCHANGE 2 422#define HV_ICMSGTYPE_SHUTDOWN 3 423#define HV_ICMSGTYPE_TIMESYNC 4 --- 105 unchanged lines hidden (view full) --- 529 struct { 530 uint32_t id:24; 531 uint32_t reserved:8; 532 } u; 533 534} __packed hv_vmbus_connection_id; 535 536typedef struct hv_vmbus_channel { | 402/* 403 * Common defines for Hyper-V ICs 404 */ 405#define HV_ICMSGTYPE_NEGOTIATE 0 406#define HV_ICMSGTYPE_HEARTBEAT 1 407#define HV_ICMSGTYPE_KVPEXCHANGE 2 408#define HV_ICMSGTYPE_SHUTDOWN 3 409#define HV_ICMSGTYPE_TIMESYNC 4 --- 105 unchanged lines hidden (view full) --- 515 struct { 516 uint32_t id:24; 517 uint32_t reserved:8; 518 } u; 519 520} __packed hv_vmbus_connection_id; 521 522typedef struct hv_vmbus_channel { |
537 struct hv_device* device; | 523 device_t ch_dev; |
538 struct vmbus_softc *vmbus_sc; 539 hv_vmbus_channel_state state; 540 uint32_t ch_flags; /* VMBUS_CHAN_FLAG_ */ 541 uint32_t ch_id; /* channel id */ 542 /* 543 * These are based on the offer_msg.monitor_id. 544 * Save it here for easy access. 545 */ --- 96 unchanged lines hidden (view full) --- 642#define VMBUS_CHAN_FLAG_HASMNF 0x0001 643 644static inline void 645hv_set_channel_read_state(hv_vmbus_channel* channel, boolean_t state) 646{ 647 channel->batched_reading = state; 648} 649 | 524 struct vmbus_softc *vmbus_sc; 525 hv_vmbus_channel_state state; 526 uint32_t ch_flags; /* VMBUS_CHAN_FLAG_ */ 527 uint32_t ch_id; /* channel id */ 528 /* 529 * These are based on the offer_msg.monitor_id. 530 * Save it here for easy access. 531 */ --- 96 unchanged lines hidden (view full) --- 628#define VMBUS_CHAN_FLAG_HASMNF 0x0001 629 630static inline void 631hv_set_channel_read_state(hv_vmbus_channel* channel, boolean_t state) 632{ 633 channel->batched_reading = state; 634} 635 |
650typedef struct hv_device { 651 hv_guid class_id; 652 hv_guid device_id; 653 device_t device; 654 hv_vmbus_channel* channel; 655} hv_device; 656 657 658 | |
659int hv_vmbus_channel_recv_packet( 660 hv_vmbus_channel* channel, 661 void* buffer, 662 uint32_t buffer_len, 663 uint32_t* buffer_actual_len, 664 uint64_t* request_id); 665 666int hv_vmbus_channel_recv_packet_raw( --- 65 unchanged lines hidden (view full) --- 732static inline unsigned long 733hv_get_phys_addr(void *virt) 734{ 735 unsigned long ret; 736 ret = (vtophys(virt) | ((vm_offset_t) virt & PAGE_MASK)); 737 return (ret); 738} 739 | 636int hv_vmbus_channel_recv_packet( 637 hv_vmbus_channel* channel, 638 void* buffer, 639 uint32_t buffer_len, 640 uint32_t* buffer_actual_len, 641 uint64_t* request_id); 642 643int hv_vmbus_channel_recv_packet_raw( --- 65 unchanged lines hidden (view full) --- 709static inline unsigned long 710hv_get_phys_addr(void *virt) 711{ 712 unsigned long ret; 713 ret = (vtophys(virt) | ((vm_offset_t) virt & PAGE_MASK)); 714 return (ret); 715} 716 |
717static __inline struct hv_vmbus_channel * 718vmbus_get_channel(device_t dev) 719{ 720 return device_get_ivars(dev); 721} 722 |
|
740#endif /* __HYPERV_H__ */ | 723#endif /* __HYPERV_H__ */ |