Staging: hv: rename context to channel in struct hv_device
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Oct 2010 16:05:27 +0000 (09:05 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Oct 2010 16:05:27 +0000 (09:05 -0700)
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>
drivers/staging/hv/channel_interface.c
drivers/staging/hv/netvsc.c
drivers/staging/hv/vmbus.c
drivers/staging/hv/vmbus_api.h
drivers/staging/hv/vmbus_drv.c
drivers/staging/hv/vmbus_private.h

index 5016668aea7b56fbe4fbd31dc15e0aecfa899568..35b700f8612b3d0894a7584d8328c1c47099d376 100644 (file)
@@ -31,21 +31,21 @@ static int ivmbus_open(struct hv_device *device, u32 sendbuffer_size,
                             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);
 }
 
@@ -54,7 +54,7 @@ static int ivmbus_sendpacket_pagebuffer(struct hv_device *device,
                                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);
 }
@@ -63,7 +63,7 @@ static int ivmbus_sendpacket_multipagebuffer(struct hv_device *device,
                                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);
 }
@@ -72,7 +72,7 @@ static int ivmbus_recvpacket(struct hv_device *device, void *buffer,
                                   u32 bufferlen, u32 *buffer_actuallen,
                                   u64 *requestid)
 {
-       return vmbus_recvpacket(device->context, buffer, bufferlen,
+       return vmbus_recvpacket(device->channel, buffer, bufferlen,
                                      buffer_actuallen, requestid);
 }
 
@@ -80,7 +80,7 @@ static int ivmbus_recvpacket_raw(struct hv_device *device, void *buffer,
                                      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);
 }
 
index 4c29c31ad3a5de5e432e12087788c6a0e7916812..1c15f9a1a12b1e1be7f4cfcaae27de5a5d507232 100644 (file)
@@ -240,7 +240,7 @@ static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *Device)
         * 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) {
@@ -368,7 +368,7 @@ static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *Device)
         * 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) {
@@ -467,7 +467,7 @@ static int NetVscDestroyReceiveBuffer(struct netvsc_device *NetDevice)
        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 */
@@ -538,7 +538,7 @@ static int NetVscDestroySendBuffer(struct netvsc_device *NetDevice)
        /* 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);
 
                /*
index ffdbd30e3ba5a51a7e9837396fde6c006d845826..d449daf819765b789cd5d06ee9fb429e97a05c85 100644 (file)
@@ -65,12 +65,12 @@ static void VmbusGetChannelOffers(void)
  */
 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);
 }
 
 /*
index 55bd00ddb61b5ecb6781da69f008144a8580935c..17e3c9addc67b8b835509a719975d9a415dc9d74 100644 (file)
@@ -152,7 +152,7 @@ struct hv_device {
        /* the device instance id of this device */
        struct hv_guid deviceInstance;
 
-       struct vmbus_channel *context;
+       struct vmbus_channel *channel;
 
        /* Device extension; */
        void *Extension;
@@ -167,7 +167,7 @@ struct vmbus_driver {
        /* 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);
index 1e0a1de8261d4465a179ef3a59374f4aa7f8df76..92ba95c7c6d6f219f7f5528904637d6ab4986595 100644 (file)
@@ -71,7 +71,7 @@ static void vmbus_bus_release(struct device *device);
 
 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);
@@ -134,10 +134,10 @@ static void get_channel_info(struct hv_device *device,
 {
        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;
@@ -508,7 +508,7 @@ EXPORT_SYMBOL(vmbus_get_interface);
  */
 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;
@@ -541,7 +541,7 @@ static struct hv_device *vmbus_child_device_create(struct hv_guid *type,
                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));
index 7bdb29ac89520976001da2bdebf77334ffc7d04a..09eaec964b305b1fb42a399f62bf251a55d50544 100644 (file)
@@ -104,7 +104,7 @@ extern struct VMBUS_CONNECTION gVmbusConnection;
 
 struct hv_device *VmbusChildDeviceCreate(struct hv_guid *deviceType,
                                         struct hv_guid *deviceInstance,
-                                        void *context);
+                                        struct vmbus_channel *channel);
 
 int VmbusChildDeviceAdd(struct hv_device *Device);