As it really is a channel, not a "context" name it so.
This also entailed making a few more functions typesafe as they were
sending a struct vmbus_channel pointer as a void pointer.
There are still a few more that need to be converted (the osd callbacks
are one), but this is good for now.
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
void (*channel_callback)(void *context),
void *context)
{
- return vmbus_open(device->context, sendbuffer_size,
+ return vmbus_open(device->channel, sendbuffer_size,
recv_ringbuffer_size, userdata, userdatalen,
channel_callback, context);
}
static void ivmbus_close(struct hv_device *device)
{
- vmbus_close(device->context);
+ vmbus_close(device->channel);
}
static int ivmbus_sendpacket(struct hv_device *device, const void *buffer,
u32 bufferlen, u64 requestid, u32 type,
u32 flags)
{
- return vmbus_sendpacket(device->context, buffer, bufferlen,
+ return vmbus_sendpacket(device->channel, buffer, bufferlen,
requestid, type, flags);
}
u32 pagecount, void *buffer,
u32 bufferlen, u64 requestid)
{
- return vmbus_sendpacket_pagebuffer(device->context, pagebuffers,
+ return vmbus_sendpacket_pagebuffer(device->channel, pagebuffers,
pagecount, buffer, bufferlen,
requestid);
}
struct hv_multipage_buffer *multi_pagebuffer,
void *buffer, u32 bufferlen, u64 requestid)
{
- return vmbus_sendpacket_multipagebuffer(device->context,
+ return vmbus_sendpacket_multipagebuffer(device->channel,
multi_pagebuffer, buffer,
bufferlen, requestid);
}
u32 bufferlen, u32 *buffer_actuallen,
u64 *requestid)
{
- return vmbus_recvpacket(device->context, buffer, bufferlen,
+ return vmbus_recvpacket(device->channel, buffer, bufferlen,
buffer_actuallen, requestid);
}
u32 bufferlen, u32 *buffer_actuallen,
u64 *requestid)
{
- return vmbus_recvpacket_raw(device->context, buffer, bufferlen,
+ return vmbus_recvpacket_raw(device->channel, buffer, bufferlen,
buffer_actuallen, requestid);
}
* channel. Note: This call uses the vmbus connection rather
* than the channel to establish the gpadl handle.
*/
- ret = vmbus_establish_gpadl(Device->context, netDevice->ReceiveBuffer,
+ ret = vmbus_establish_gpadl(Device->channel, netDevice->ReceiveBuffer,
netDevice->ReceiveBufferSize,
&netDevice->ReceiveBufferGpadlHandle);
if (ret != 0) {
* channel. Note: This call uses the vmbus connection rather
* than the channel to establish the gpadl handle.
*/
- ret = vmbus_establish_gpadl(Device->context, netDevice->SendBuffer,
+ ret = vmbus_establish_gpadl(Device->channel, netDevice->SendBuffer,
netDevice->SendBufferSize,
&netDevice->SendBufferGpadlHandle);
if (ret != 0) {
if (NetDevice->ReceiveBufferGpadlHandle) {
DPRINT_INFO(NETVSC, "Tearing down receive buffer's GPADL...");
- ret = vmbus_teardown_gpadl(NetDevice->Device->context,
+ ret = vmbus_teardown_gpadl(NetDevice->Device->channel,
NetDevice->ReceiveBufferGpadlHandle);
/* If we failed here, we might as well return and have a leak rather than continue and a bugchk */
/* Teardown the gpadl on the vsp end */
if (NetDevice->SendBufferGpadlHandle) {
DPRINT_INFO(NETVSC, "Tearing down send buffer's GPADL...");
- ret = vmbus_teardown_gpadl(NetDevice->Device->context,
+ ret = vmbus_teardown_gpadl(NetDevice->Device->channel,
NetDevice->SendBufferGpadlHandle);
/*
*/
struct hv_device *VmbusChildDeviceCreate(struct hv_guid *DeviceType,
struct hv_guid *DeviceInstance,
- void *Context)
+ struct vmbus_channel *channel)
{
struct vmbus_driver *vmbusDriver = (struct vmbus_driver *)gDriver;
return vmbusDriver->OnChildDeviceCreate(DeviceType, DeviceInstance,
- Context);
+ channel);
}
/*
/* the device instance id of this device */
struct hv_guid deviceInstance;
- struct vmbus_channel *context;
+ struct vmbus_channel *channel;
/* Device extension; */
void *Extension;
/* Set by the caller */
struct hv_device * (*OnChildDeviceCreate)(struct hv_guid *DeviceType,
struct hv_guid *DeviceInstance,
- void *Context);
+ struct vmbus_channel *channel);
void (*OnChildDeviceDestroy)(struct hv_device *device);
int (*OnChildDeviceAdd)(struct hv_device *RootDevice,
struct hv_device *ChildDevice);
static struct hv_device *vmbus_child_device_create(struct hv_guid *type,
struct hv_guid *instance,
- void *context);
+ struct vmbus_channel *channel);
static void vmbus_child_device_destroy(struct hv_device *device_obj);
static int vmbus_child_device_register(struct hv_device *root_device_obj,
struct hv_device *child_device_obj);
{
struct vmbus_channel_debug_info debug_info;
- if (!device->context)
+ if (!device->channel)
return;
- vmbus_get_debug_info(device->context, &debug_info);
+ vmbus_get_debug_info(device->channel, &debug_info);
info->ChannelId = debug_info.RelId;
info->ChannelState = debug_info.State;
*/
static struct hv_device *vmbus_child_device_create(struct hv_guid *type,
struct hv_guid *instance,
- void *context)
+ struct vmbus_channel *channel)
{
struct vm_device *child_device_ctx;
struct hv_device *child_device_obj;
instance->data[14], instance->data[15]);
child_device_obj = &child_device_ctx->device_obj;
- child_device_obj->context = context;
+ child_device_obj->channel = channel;
memcpy(&child_device_obj->deviceType, type, sizeof(struct hv_guid));
memcpy(&child_device_obj->deviceInstance, instance,
sizeof(struct hv_guid));
struct hv_device *VmbusChildDeviceCreate(struct hv_guid *deviceType,
struct hv_guid *deviceInstance,
- void *context);
+ struct vmbus_channel *channel);
int VmbusChildDeviceAdd(struct hv_device *Device);