#ifndef _HYPERV_VMBUS_H
#define _HYPERV_VMBUS_H
#include <linux/list.h>
#include <linux/bitops.h>
#include <asm/sync_bitops.h>
#include <asm/hyperv-tlfs.h>
#include <linux/atomic.h>
#include <linux/hyperv.h>
#include <linux/interrupt.h>
#include "hv_trace.h"
#define HV_UTIL_TIMEOUT …
#define HV_UTIL_NEGO_TIMEOUT …
hv_monitor_trigger_group;
struct hv_monitor_parameter { … };
hv_monitor_trigger_state;
struct hv_monitor_page { … };
#define HV_HYPERCALL_PARAM_ALIGN …
struct hv_input_post_message { … };
enum { … };
struct hv_per_cpu_context { … };
struct hv_context { … };
extern struct hv_context hv_context;
extern int hv_init(void);
extern int hv_post_message(union hv_connection_id connection_id,
enum hv_message_type message_type,
void *payload, size_t payload_size);
extern int hv_synic_alloc(void);
extern void hv_synic_free(void);
extern void hv_synic_enable_regs(unsigned int cpu);
extern int hv_synic_init(unsigned int cpu);
extern void hv_synic_disable_regs(unsigned int cpu);
extern int hv_synic_cleanup(unsigned int cpu);
void hv_ringbuffer_pre_init(struct vmbus_channel *channel);
int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
struct page *pages, u32 pagecnt, u32 max_pkt_size);
void hv_ringbuffer_cleanup(struct hv_ring_buffer_info *ring_info);
int hv_ringbuffer_write(struct vmbus_channel *channel,
const struct kvec *kv_list, u32 kv_count,
u64 requestid, u64 *trans_id);
int hv_ringbuffer_read(struct vmbus_channel *channel,
void *buffer, u32 buflen, u32 *buffer_actual_len,
u64 *requestid, bool raw);
#define MAX_NUM_CHANNELS …
#define MAX_NUM_CHANNELS_SUPPORTED …
#define MAX_CHANNEL_RELIDS …
enum vmbus_connect_state { … };
#define MAX_SIZE_CHANNEL_MESSAGE …
#define VMBUS_CONNECT_CPU …
struct vmbus_connection { … };
struct vmbus_msginfo { … };
extern struct vmbus_connection vmbus_connection;
int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo, u32 version);
static inline void vmbus_send_interrupt(u32 relid)
{ … }
enum vmbus_message_handler_type { … };
struct vmbus_channel_message_table_entry { … };
extern const struct vmbus_channel_message_table_entry
channel_message_table[CHANNELMSG_COUNT];
struct hv_device *vmbus_device_create(const guid_t *type,
const guid_t *instance,
struct vmbus_channel *channel);
int vmbus_device_register(struct hv_device *child_device_obj);
void vmbus_device_unregister(struct hv_device *device_obj);
int vmbus_add_channel_kobj(struct hv_device *device_obj,
struct vmbus_channel *channel);
void vmbus_remove_channel_attr_group(struct vmbus_channel *channel);
void vmbus_channel_map_relid(struct vmbus_channel *channel);
void vmbus_channel_unmap_relid(struct vmbus_channel *channel);
struct vmbus_channel *relid2channel(u32 relid);
void vmbus_free_channels(void);
int vmbus_connect(void);
void vmbus_disconnect(void);
int vmbus_post_msg(void *buffer, size_t buflen, bool can_sleep);
void vmbus_on_event(unsigned long data);
void vmbus_on_msg_dpc(unsigned long data);
int hv_kvp_init(struct hv_util_service *srv);
void hv_kvp_deinit(void);
int hv_kvp_pre_suspend(void);
int hv_kvp_pre_resume(void);
void hv_kvp_onchannelcallback(void *context);
int hv_vss_init(struct hv_util_service *srv);
void hv_vss_deinit(void);
int hv_vss_pre_suspend(void);
int hv_vss_pre_resume(void);
void hv_vss_onchannelcallback(void *context);
void vmbus_initiate_unload(bool crash);
static inline void hv_poll_channel(struct vmbus_channel *channel,
void (*cb)(void *))
{ … }
enum hvutil_device_state { … };
enum delay { … };
extern const struct vmbus_device vmbus_devs[];
static inline bool hv_is_perf_channel(struct vmbus_channel *channel)
{ … }
static inline size_t hv_dev_ring_size(struct vmbus_channel *channel)
{ … }
static inline bool hv_is_allocated_cpu(unsigned int cpu)
{ … }
static inline void hv_set_allocated_cpu(unsigned int cpu)
{ … }
static inline void hv_clear_allocated_cpu(unsigned int cpu)
{ … }
static inline void hv_update_allocated_cpus(unsigned int old_cpu,
unsigned int new_cpu)
{ … }
#ifdef CONFIG_HYPERV_TESTING
int hv_debug_add_dev_dir(struct hv_device *dev);
void hv_debug_rm_dev_dir(struct hv_device *dev);
void hv_debug_rm_all_dir(void);
int hv_debug_init(void);
void hv_debug_delay_test(struct vmbus_channel *channel, enum delay delay_type);
#else
static inline void hv_debug_rm_dev_dir(struct hv_device *dev) {};
static inline void hv_debug_rm_all_dir(void) {};
static inline void hv_debug_delay_test(struct vmbus_channel *channel,
enum delay delay_type) {};
static inline int hv_debug_init(void)
{
return -1;
}
static inline int hv_debug_add_dev_dir(struct hv_device *dev)
{
return -1;
}
#endif
#endif