Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
channel.c File Reference
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/hyperv.h>
#include "hyperv_vmbus.h"

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define NUM_PAGES_SPANNED(addr, len)   ((PAGE_ALIGN(addr + len) >> PAGE_SHIFT) - (addr >> PAGE_SHIFT))
 

Functions

void vmbus_get_debug_info (struct vmbus_channel *channel, struct vmbus_channel_debug_info *debuginfo)
 
int vmbus_open (struct vmbus_channel *newchannel, u32 send_ringbuffer_size, u32 recv_ringbuffer_size, void *userdata, u32 userdatalen, void(*onchannelcallback)(void *context), void *context)
 
 EXPORT_SYMBOL_GPL (vmbus_open)
 
int vmbus_establish_gpadl (struct vmbus_channel *channel, void *kbuffer, u32 size, u32 *gpadl_handle)
 
 EXPORT_SYMBOL_GPL (vmbus_establish_gpadl)
 
int vmbus_teardown_gpadl (struct vmbus_channel *channel, u32 gpadl_handle)
 
 EXPORT_SYMBOL_GPL (vmbus_teardown_gpadl)
 
void vmbus_close (struct vmbus_channel *channel)
 
 EXPORT_SYMBOL_GPL (vmbus_close)
 
int vmbus_sendpacket (struct vmbus_channel *channel, const void *buffer, u32 bufferlen, u64 requestid, enum vmbus_packet_type type, u32 flags)
 
 EXPORT_SYMBOL (vmbus_sendpacket)
 
int vmbus_sendpacket_pagebuffer (struct vmbus_channel *channel, struct hv_page_buffer pagebuffers[], u32 pagecount, void *buffer, u32 bufferlen, u64 requestid)
 
 EXPORT_SYMBOL_GPL (vmbus_sendpacket_pagebuffer)
 
int vmbus_sendpacket_multipagebuffer (struct vmbus_channel *channel, struct hv_multipage_buffer *multi_pagebuffer, void *buffer, u32 bufferlen, u64 requestid)
 
 EXPORT_SYMBOL_GPL (vmbus_sendpacket_multipagebuffer)
 
int vmbus_recvpacket (struct vmbus_channel *channel, void *buffer, u32 bufferlen, u32 *buffer_actual_len, u64 *requestid)
 
 EXPORT_SYMBOL (vmbus_recvpacket)
 
int vmbus_recvpacket_raw (struct vmbus_channel *channel, void *buffer, u32 bufferlen, u32 *buffer_actual_len, u64 *requestid)
 
 EXPORT_SYMBOL_GPL (vmbus_recvpacket_raw)
 

Macro Definition Documentation

#define NUM_PAGES_SPANNED (   addr,
  len 
)    ((PAGE_ALIGN(addr + len) >> PAGE_SHIFT) - (addr >> PAGE_SHIFT))

Definition at line 33 of file channel.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 21 of file channel.c.

Function Documentation

EXPORT_SYMBOL ( vmbus_sendpacket  )
EXPORT_SYMBOL ( vmbus_recvpacket  )
EXPORT_SYMBOL_GPL ( vmbus_open  )
EXPORT_SYMBOL_GPL ( vmbus_establish_gpadl  )
EXPORT_SYMBOL_GPL ( vmbus_teardown_gpadl  )
EXPORT_SYMBOL_GPL ( vmbus_close  )
EXPORT_SYMBOL_GPL ( vmbus_sendpacket_pagebuffer  )
EXPORT_SYMBOL_GPL ( vmbus_sendpacket_multipagebuffer  )
EXPORT_SYMBOL_GPL ( vmbus_recvpacket_raw  )
void vmbus_close ( struct vmbus_channel *  channel)

Definition at line 514 of file channel.c.

int vmbus_establish_gpadl ( struct vmbus_channel *  channel,
void kbuffer,
u32  size,
u32 gpadl_handle 
)

Definition at line 391 of file channel.c.

void vmbus_get_debug_info ( struct vmbus_channel *  channel,
struct vmbus_channel_debug_info *  debuginfo 
)

Definition at line 73 of file channel.c.

int vmbus_open ( struct vmbus_channel *  newchannel,
u32  send_ringbuffer_size,
u32  recv_ringbuffer_size,
void userdata,
u32  userdatalen,
void(*)(void *context onchannelcallback,
void context 
)

Definition at line 117 of file channel.c.

int vmbus_recvpacket ( struct vmbus_channel *  channel,
void buffer,
u32  bufferlen,
u32 buffer_actual_len,
u64 requestid 
)

vmbus_recvpacket() - Retrieve the user packet on the specified channel : Pointer to vmbus_channel structure. : Pointer to the buffer you want to receive the data into. : Maximum size of what the the buffer will hold : The actual size of the data after it was received : Identifier of the request

Receives directly from the hyper-v vmbus and puts the data it received into Buffer. This will receive the data unparsed from hyper-v.

Mainly used by Hyper-V drivers.

Definition at line 736 of file channel.c.

int vmbus_recvpacket_raw ( struct vmbus_channel *  channel,
void buffer,
u32  bufferlen,
u32 buffer_actual_len,
u64 requestid 
)

Definition at line 779 of file channel.c.

int vmbus_sendpacket ( struct vmbus_channel *  channel,
const void buffer,
u32  bufferlen,
u64  requestid,
enum vmbus_packet_type  type,
u32  flags 
)

vmbus_sendpacket() - Send the specified buffer on the given channel : Pointer to vmbus_channel structure. : Pointer to the buffer you want to receive the data into. : Maximum size of what the the buffer will hold : Identifier of the request : Type of packet that is being send e.g. negotiate, time packet etc.

Sends data in directly to hyper-v via the vmbus This will send the data unparsed to hyper-v.

Mainly used by Hyper-V drivers.

Definition at line 565 of file channel.c.

int vmbus_sendpacket_multipagebuffer ( struct vmbus_channel *  channel,
struct hv_multipage_buffer *  multi_pagebuffer,
void buffer,
u32  bufferlen,
u64  requestid 
)

Definition at line 665 of file channel.c.

int vmbus_sendpacket_pagebuffer ( struct vmbus_channel *  channel,
struct hv_page_buffer  pagebuffers[],
u32  pagecount,
void buffer,
u32  bufferlen,
u64  requestid 
)

Definition at line 604 of file channel.c.

int vmbus_teardown_gpadl ( struct vmbus_channel *  channel,
u32  gpadl_handle 
)

Definition at line 470 of file channel.c.