Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
hyperv_vmbus.h File Reference
#include <linux/list.h>
#include <asm/sync_bitops.h>
#include <linux/atomic.h>
#include <linux/hyperv.h>

Go to the source code of this file.

Data Structures

union  hv_connection_id
 
union  hv_port_id
 
struct  hv_port_info
 
struct  hv_connection_info
 
union  hv_message_flags
 
struct  hv_message_header
 
struct  hv_timer_message_payload
 
struct  hv_message
 
struct  hv_message_page
 
union  hv_synic_event_flags
 
struct  hv_synic_event_flags_page
 
union  hv_synic_scontrol
 
union  hv_synic_sint
 
union  hv_synic_simp
 
union  hv_synic_siefp
 
union  hv_monitor_trigger_group
 
struct  hv_monitor_parameter
 
union  hv_monitor_trigger_state
 
struct  hv_monitor_page
 
struct  hv_input_post_message
 
struct  hv_input_signal_event
 
union  hv_x64_msr_guest_os_id_contents
 
union  hv_x64_msr_hypercall_contents
 
struct  hv_input_signal_event_buffer
 
struct  hv_context
 
struct  vmbus_connection
 
struct  vmbus_msginfo
 

Macros

#define HV_SYNIC_VERSION   (1)
 
#define HV_SYNIC_VERSION_1   (0x1)
 
#define HV_MESSAGE_SIZE   (256)
 
#define HV_MESSAGE_PAYLOAD_BYTE_COUNT   (240)
 
#define HV_MESSAGE_PAYLOAD_QWORD_COUNT   (30)
 
#define HV_ANY_VP   (0xFFFFFFFF)
 
#define HV_EVENT_FLAGS_COUNT   (256 * 8)
 
#define HV_EVENT_FLAGS_BYTE_COUNT   (256)
 
#define HV_EVENT_FLAGS_DWORD_COUNT   (256 / sizeof(u32))
 
#define HV_SYNIC_SINT_COUNT   (16)
 
#define HV_SYNIC_STIMER_COUNT   (4)
 
#define HV_PARTITION_ID_INVALID   ((u64)0x0)
 
#define HV_PORT_MESSAGE_BUFFER_COUNT   (16)
 
#define HV_X64_MSR_GUEST_OS_ID   0x40000000
 
#define HV_X64_MSR_HYPERCALL   0x40000001
 
#define HV_PRESENT_BIT   0x80000000
 
#define HV_LINUX_VENDOR_ID   0x8100
 
#define HV_CPU_POWER_MANAGEMENT   (1 << 0)
 
#define HV_RECOMMENDATIONS_MAX   4
 
#define HV_X64_MAX   5
 
#define HV_CAPS_MAX   8
 
#define HV_HYPERCALL_PARAM_ALIGN   sizeof(u64)
 
#define HV_SERVICE_PARENT_PORT   (0)
 
#define HV_SERVICE_PARENT_CONNECTION   (0)
 
#define HV_SERVICE_CONNECT_RESPONSE_SUCCESS   (0)
 
#define HV_SERVICE_CONNECT_RESPONSE_INVALID_PARAMETER   (1)
 
#define HV_SERVICE_CONNECT_RESPONSE_UNKNOWN_SERVICE   (2)
 
#define HV_SERVICE_CONNECT_RESPONSE_CONNECTION_REJECTED   (3)
 
#define HV_SERVICE_CONNECT_REQUEST_MESSAGE_ID   (1)
 
#define HV_SERVICE_CONNECT_RESPONSE_MESSAGE_ID   (2)
 
#define HV_SERVICE_DISCONNECT_REQUEST_MESSAGE_ID   (3)
 
#define HV_SERVICE_DISCONNECT_RESPONSE_MESSAGE_ID   (4)
 
#define HV_SERVICE_MAX_MESSAGE_ID   (4)
 
#define HV_SERVICE_PROTOCOL_VERSION   (0x0010)
 
#define HV_CONNECT_PAYLOAD_BYTE_COUNT   64
 
#define MAX_NUM_CHANNELS   ((PAGE_SIZE >> 1) << 3) /* 16348 channels */
 
#define MAX_NUM_CHANNELS_SUPPORTED   256
 
#define MAX_SIZE_CHANNEL_MESSAGE   HV_MESSAGE_PAYLOAD_BYTE_COUNT
 

Enumerations

enum  hv_cpuid_function {
  HVCPUID_VERSION_FEATURES = 0x00000001, HVCPUID_VENDOR_MAXFUNCTION = 0x40000000, HVCPUID_INTERFACE = 0x40000001, HVCPUID_VERSION = 0x40000002,
  HVCPUID_FEATURES = 0x40000003, HVCPUID_ENLIGHTENMENT_INFO = 0x40000004, HVCPUID_IMPLEMENTATION_LIMITS = 0x40000005
}
 
enum  hv_message_type {
  HVMSG_NONE = 0x00000000, HVMSG_UNMAPPED_GPA = 0x80000000, HVMSG_GPA_INTERCEPT = 0x80000001, HVMSG_TIMER_EXPIRED = 0x80000010,
  HVMSG_INVALID_VP_REGISTER_VALUE = 0x80000020, HVMSG_UNRECOVERABLE_EXCEPTION = 0x80000021, HVMSG_UNSUPPORTED_FEATURE = 0x80000022, HVMSG_EVENTLOG_BUFFERCOMPLETE = 0x80000040,
  HVMSG_X64_IOPORT_INTERCEPT = 0x80010000, HVMSG_X64_MSR_INTERCEPT = 0x80010001, HVMSG_X64_CPUID_INTERCEPT = 0x80010002, HVMSG_X64_EXCEPTION_INTERCEPT = 0x80010003,
  HVMSG_X64_APIC_EOI = 0x80010004, HVMSG_X64_LEGACY_FP_ERROR = 0x80010005
}
 
enum  hv_port_type { HVPORT_MSG = 1, HVPORT_EVENT = 2, HVPORT_MONITOR = 3 }
 
enum  hv_call_code { HVCALL_POST_MESSAGE = 0x005c, HVCALL_SIGNAL_EVENT = 0x005d }
 
enum  hv_guest_os_vendor { HVGUESTOS_VENDOR_MICROSOFT = 0x0001 }
 
enum  hv_guest_os_microsoft_ids {
  HVGUESTOS_MICROSOFT_UNDEFINED = 0x00, HVGUESTOS_MICROSOFT_MSDOS = 0x01, HVGUESTOS_MICROSOFT_WINDOWS3X = 0x02, HVGUESTOS_MICROSOFT_WINDOWS9X = 0x03,
  HVGUESTOS_MICROSOFT_WINDOWSNT = 0x04, HVGUESTOS_MICROSOFT_WINDOWSCE = 0x05
}
 
enum  {
  VMBUS_MESSAGE_CONNECTION_ID = 1, VMBUS_MESSAGE_PORT_ID = 1, VMBUS_EVENT_CONNECTION_ID = 2, VMBUS_EVENT_PORT_ID = 2,
  VMBUS_MONITOR_CONNECTION_ID = 3, VMBUS_MONITOR_PORT_ID = 3, VMBUS_MESSAGE_SINT = 2
}
 
enum  vmbus_connect_state { DISCONNECTED, CONNECTING, CONNECTED, DISCONNECTING }
 

Functions

int hv_init (void)
 
void hv_cleanup (void)
 
int hv_post_message (union hv_connection_id connection_id, enum hv_message_type message_type, void *payload, size_t payload_size)
 
u16 hv_signal_event (void)
 
void hv_synic_init (void *irqarg)
 
void hv_synic_cleanup (void *arg)
 
int hv_ringbuffer_init (struct hv_ring_buffer_info *ring_info, void *buffer, u32 buflen)
 
void hv_ringbuffer_cleanup (struct hv_ring_buffer_info *ring_info)
 
int hv_ringbuffer_write (struct hv_ring_buffer_info *ring_info, struct scatterlist *sglist, u32 sgcount)
 
int hv_ringbuffer_peek (struct hv_ring_buffer_info *ring_info, void *buffer, u32 buflen)
 
int hv_ringbuffer_read (struct hv_ring_buffer_info *ring_info, void *buffer, u32 buflen, u32 offset)
 
u32 hv_get_ringbuffer_interrupt_mask (struct hv_ring_buffer_info *ring_info)
 
void hv_ringbuffer_get_debuginfo (struct hv_ring_buffer_info *ring_info, struct hv_ring_buffer_debug_info *debug_info)
 
struct hv_device * vmbus_device_create (uuid_le *type, uuid_le *instance, struct vmbus_channel *channel)
 
int vmbus_device_register (struct hv_device *child_device_obj)
 
void vmbus_device_unregister (struct hv_device *device_obj)
 
struct vmbus_channel * relid2channel (u32 relid)
 
void vmbus_free_channels (void)
 
int vmbus_connect (void)
 
int vmbus_post_msg (void *buffer, size_t buflen)
 
int vmbus_set_event (u32 child_relid)
 
void vmbus_on_event (unsigned long data)
 

Variables

struct hv_context hv_context
 
struct vmbus_connection vmbus_connection
 

Macro Definition Documentation

#define HV_ANY_VP   (0xFFFFFFFF)

Definition at line 62 of file hyperv_vmbus.h.

#define HV_CAPS_MAX   8

Definition at line 461 of file hyperv_vmbus.h.

#define HV_CONNECT_PAYLOAD_BYTE_COUNT   64

Definition at line 484 of file hyperv_vmbus.h.

#define HV_CPU_POWER_MANAGEMENT   (1 << 0)

Definition at line 457 of file hyperv_vmbus.h.

#define HV_EVENT_FLAGS_BYTE_COUNT   (256)

Definition at line 66 of file hyperv_vmbus.h.

#define HV_EVENT_FLAGS_COUNT   (256 * 8)

Definition at line 65 of file hyperv_vmbus.h.

#define HV_EVENT_FLAGS_DWORD_COUNT   (256 / sizeof(u32))

Definition at line 67 of file hyperv_vmbus.h.

#define HV_HYPERCALL_PARAM_ALIGN   sizeof(u64)

Definition at line 464 of file hyperv_vmbus.h.

#define HV_LINUX_VENDOR_ID   0x8100

Definition at line 437 of file hyperv_vmbus.h.

#define HV_MESSAGE_PAYLOAD_BYTE_COUNT   (240)

Definition at line 60 of file hyperv_vmbus.h.

#define HV_MESSAGE_PAYLOAD_QWORD_COUNT   (30)

Definition at line 61 of file hyperv_vmbus.h.

#define HV_MESSAGE_SIZE   (256)

Definition at line 59 of file hyperv_vmbus.h.

#define HV_PARTITION_ID_INVALID   ((u64)0x0)

Definition at line 102 of file hyperv_vmbus.h.

#define HV_PORT_MESSAGE_BUFFER_COUNT   (16)

Definition at line 207 of file hyperv_vmbus.h.

#define HV_PRESENT_BIT   0x80000000

Definition at line 411 of file hyperv_vmbus.h.

#define HV_RECOMMENDATIONS_MAX   4

Definition at line 458 of file hyperv_vmbus.h.

#define HV_SERVICE_CONNECT_REQUEST_MESSAGE_ID   (1)

Definition at line 477 of file hyperv_vmbus.h.

#define HV_SERVICE_CONNECT_RESPONSE_CONNECTION_REJECTED   (3)

Definition at line 475 of file hyperv_vmbus.h.

#define HV_SERVICE_CONNECT_RESPONSE_INVALID_PARAMETER   (1)

Definition at line 473 of file hyperv_vmbus.h.

#define HV_SERVICE_CONNECT_RESPONSE_MESSAGE_ID   (2)

Definition at line 478 of file hyperv_vmbus.h.

#define HV_SERVICE_CONNECT_RESPONSE_SUCCESS   (0)

Definition at line 472 of file hyperv_vmbus.h.

#define HV_SERVICE_CONNECT_RESPONSE_UNKNOWN_SERVICE   (2)

Definition at line 474 of file hyperv_vmbus.h.

#define HV_SERVICE_DISCONNECT_REQUEST_MESSAGE_ID   (3)

Definition at line 479 of file hyperv_vmbus.h.

#define HV_SERVICE_DISCONNECT_RESPONSE_MESSAGE_ID   (4)

Definition at line 480 of file hyperv_vmbus.h.

#define HV_SERVICE_MAX_MESSAGE_ID   (4)

Definition at line 481 of file hyperv_vmbus.h.

#define HV_SERVICE_PARENT_CONNECTION   (0)

Definition at line 470 of file hyperv_vmbus.h.

#define HV_SERVICE_PARENT_PORT   (0)

Definition at line 469 of file hyperv_vmbus.h.

#define HV_SERVICE_PROTOCOL_VERSION   (0x0010)

Definition at line 483 of file hyperv_vmbus.h.

#define HV_SYNIC_SINT_COUNT   (16)

Definition at line 98 of file hyperv_vmbus.h.

#define HV_SYNIC_STIMER_COUNT   (4)

Definition at line 99 of file hyperv_vmbus.h.

#define HV_SYNIC_VERSION   (1)

Definition at line 53 of file hyperv_vmbus.h.

#define HV_SYNIC_VERSION_1   (0x1)

Definition at line 56 of file hyperv_vmbus.h.

#define HV_X64_MAX   5

Definition at line 460 of file hyperv_vmbus.h.

#define HV_X64_MSR_GUEST_OS_ID   0x40000000

Definition at line 370 of file hyperv_vmbus.h.

#define HV_X64_MSR_HYPERCALL   0x40000001

Definition at line 387 of file hyperv_vmbus.h.

#define MAX_NUM_CHANNELS   ((PAGE_SIZE >> 1) << 3) /* 16348 channels */

Definition at line 578 of file hyperv_vmbus.h.

#define MAX_NUM_CHANNELS_SUPPORTED   256

Definition at line 582 of file hyperv_vmbus.h.

#define MAX_SIZE_CHANNEL_MESSAGE   HV_MESSAGE_PAYLOAD_BYTE_COUNT

Definition at line 592 of file hyperv_vmbus.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
VMBUS_MESSAGE_CONNECTION_ID 
VMBUS_MESSAGE_PORT_ID 
VMBUS_EVENT_CONNECTION_ID 
VMBUS_EVENT_PORT_ID 
VMBUS_MONITOR_CONNECTION_ID 
VMBUS_MONITOR_PORT_ID 
VMBUS_MESSAGE_SINT 

Definition at line 399 of file hyperv_vmbus.h.

Enumerator:
HVCALL_POST_MESSAGE 
HVCALL_SIGNAL_EVENT 

Definition at line 327 of file hyperv_vmbus.h.

Enumerator:
HVCPUID_VERSION_FEATURES 
HVCPUID_VENDOR_MAXFUNCTION 
HVCPUID_INTERFACE 
HVCPUID_VERSION 
HVCPUID_FEATURES 
HVCPUID_ENLIGHTENMENT_INFO 
HVCPUID_IMPLEMENTATION_LIMITS 

Definition at line 37 of file hyperv_vmbus.h.

Enumerator:
HVGUESTOS_MICROSOFT_UNDEFINED 
HVGUESTOS_MICROSOFT_MSDOS 
HVGUESTOS_MICROSOFT_WINDOWS3X 
HVGUESTOS_MICROSOFT_WINDOWS9X 
HVGUESTOS_MICROSOFT_WINDOWSNT 
HVGUESTOS_MICROSOFT_WINDOWSCE 

Definition at line 358 of file hyperv_vmbus.h.

Enumerator:
HVGUESTOS_VENDOR_MICROSOFT 

Definition at line 354 of file hyperv_vmbus.h.

Enumerator:
HVMSG_NONE 
HVMSG_UNMAPPED_GPA 
HVMSG_GPA_INTERCEPT 
HVMSG_TIMER_EXPIRED 
HVMSG_INVALID_VP_REGISTER_VALUE 
HVMSG_UNRECOVERABLE_EXCEPTION 
HVMSG_UNSUPPORTED_FEATURE 
HVMSG_EVENTLOG_BUFFERCOMPLETE 
HVMSG_X64_IOPORT_INTERCEPT 
HVMSG_X64_MSR_INTERCEPT 
HVMSG_X64_CPUID_INTERCEPT 
HVMSG_X64_EXCEPTION_INTERCEPT 
HVMSG_X64_APIC_EOI 
HVMSG_X64_LEGACY_FP_ERROR 

Definition at line 70 of file hyperv_vmbus.h.

Enumerator:
HVPORT_MSG 
HVPORT_EVENT 
HVPORT_MONITOR 

Definition at line 123 of file hyperv_vmbus.h.

Enumerator:
DISCONNECTED 
CONNECTING 
CONNECTED 
DISCONNECTING 

Definition at line 585 of file hyperv_vmbus.h.

Function Documentation

void hv_cleanup ( void  )

Definition at line 209 of file hv.c.

u32 hv_get_ringbuffer_interrupt_mask ( struct hv_ring_buffer_info *  ring_info)

Definition at line 250 of file ring_buffer.c.

int hv_init ( void  )

Definition at line 131 of file hv.c.

int hv_post_message ( union hv_connection_id  connection_id,
enum hv_message_type  message_type,
void payload,
size_t  payload_size 
)

Definition at line 233 of file hv.c.

void hv_ringbuffer_cleanup ( struct hv_ring_buffer_info *  ring_info)

Definition at line 289 of file ring_buffer.c.

void hv_ringbuffer_get_debuginfo ( struct hv_ring_buffer_info *  ring_info,
struct hv_ring_buffer_debug_info *  debug_info 
)

Definition at line 220 of file ring_buffer.c.

int hv_ringbuffer_init ( struct hv_ring_buffer_info *  ring_info,
void buffer,
u32  buflen 
)

Definition at line 262 of file ring_buffer.c.

int hv_ringbuffer_peek ( struct hv_ring_buffer_info *  ring_info,
void buffer,
u32  buflen 
)

Definition at line 373 of file ring_buffer.c.

int hv_ringbuffer_read ( struct hv_ring_buffer_info *  ring_info,
void buffer,
u32  buflen,
u32  offset 
)

Definition at line 416 of file ring_buffer.c.

int hv_ringbuffer_write ( struct hv_ring_buffer_info *  ring_info,
struct scatterlist sglist,
u32  sgcount 
)

Definition at line 300 of file ring_buffer.c.

u16 hv_signal_event ( void  )

Definition at line 276 of file hv.c.

void hv_synic_cleanup ( void arg)

Definition at line 373 of file hv.c.

void hv_synic_init ( void irqarg)

Definition at line 293 of file hv.c.

struct vmbus_channel* relid2channel ( u32  relid)
read

Definition at line 190 of file connection.c.

int vmbus_connect ( void  )

Definition at line 45 of file connection.c.

struct hv_device* vmbus_device_create ( uuid_le type,
uuid_le instance,
struct vmbus_channel *  channel 
)
read

Definition at line 604 of file vmbus_drv.c.

int vmbus_device_register ( struct hv_device *  child_device_obj)

Definition at line 628 of file vmbus_drv.c.

void vmbus_device_unregister ( struct hv_device *  device_obj)

Definition at line 660 of file vmbus_drv.c.

void vmbus_free_channels ( void  )

Definition at line 172 of file channel_mgmt.c.

void vmbus_on_event ( unsigned long  data)

Definition at line 248 of file connection.c.

int vmbus_post_msg ( void buffer,
size_t  buflen 
)

Definition at line 283 of file connection.c.

int vmbus_set_event ( u32  child_relid)

Definition at line 310 of file connection.c.

Variable Documentation

Definition at line 34 of file hv.c.

Definition at line 37 of file connection.c.