[PATCH ] Staging: hv: Hyper-V driver cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch cleans up (a lot of the) naming issues that
various reviewers have noted. It also gets rid of 
some unnecessary layering in the code. At the lowest
level, we have one abstraction for representing 
a hyperv device (struct hyperv_device) and one 
abstraction for representing a hyperv driver 
(struct hyperv_driver). This collapses an unnecessary 
layering that existed in the code for historical reasons.
While the patch is large, it was generated by a very
mechanical process (global search and replace). The code
compiles cleanly and I have tested this code on a 2.6.38
kernel.



Signed-off-by: K. Y. Srinivasan <kys@xxxxxxxxxxxxx>
Signed-off-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
Signed-off-by: Hank Janssen <hjanssen@xxxxxxxxxxxxx>

---
 drivers/staging/hv/blkvsc.c        |   19 +-
 drivers/staging/hv/blkvsc_drv.c    |   76 ++++----
 drivers/staging/hv/channel_mgmt.c  |    1 +
 drivers/staging/hv/channel_mgmt.h  |    2 +-
 drivers/staging/hv/netvsc.c        |   65 ++++---
 drivers/staging/hv/netvsc.h        |    2 +-
 drivers/staging/hv/netvsc_api.h    |   16 +-
 drivers/staging/hv/netvsc_drv.c    |  108 +++++------
 drivers/staging/hv/rndis_filter.c  |   23 ++-
 drivers/staging/hv/storvsc.c       |   43 +++--
 drivers/staging/hv/storvsc_api.h   |   10 +-
 drivers/staging/hv/storvsc_drv.c   |  106 +++++------
 drivers/staging/hv/vmbus.h         |   38 +++--
 drivers/staging/hv/vmbus_api.h     |   37 +----
 drivers/staging/hv/vmbus_drv.c     |  364 +++++++++++++++++-------------------
 drivers/staging/hv/vmbus_private.h |   13 +-
 16 files changed, 439 insertions(+), 484 deletions(-)

diff --git a/drivers/staging/hv/blkvsc.c b/drivers/staging/hv/blkvsc.c
index 7c8729b..2d1d0bd 100644
--- a/drivers/staging/hv/blkvsc.c
+++ b/drivers/staging/hv/blkvsc.c
@@ -35,7 +35,8 @@ static const struct hv_guid g_blk_device_type = {
 	}
 };
 
-static int blk_vsc_on_device_add(struct hv_device *device, void *additional_info)
+static int blk_vsc_on_device_add(struct hyperv_device *device,
+				void *additional_info)
 {
 	struct storvsc_device_info *device_info;
 	int ret = 0;
@@ -51,18 +52,18 @@ static int blk_vsc_on_device_add(struct hv_device *device, void *additional_info
 	 * id. For IDE devices, the device instance id is formatted as
 	 * <bus id> * - <device id> - 8899 - 000000000000.
 	 */
-	device_info->path_id = device->dev_instance.data[3] << 24 |
-			     device->dev_instance.data[2] << 16 |
-			     device->dev_instance.data[1] << 8  |
-			     device->dev_instance.data[0];
+	device_info->path_id = device->device_id.data[3] << 24 |
+			     device->device_id.data[2] << 16 |
+			     device->device_id.data[1] << 8  |
+			     device->device_id.data[0];
 
-	device_info->target_id = device->dev_instance.data[5] << 8 |
-			       device->dev_instance.data[4];
+	device_info->target_id = device->device_id.data[5] << 8 |
+			       device->device_id.data[4];
 
 	return ret;
 }
 
-int blk_vsc_initialize(struct hv_driver *driver)
+int blk_vsc_initialize(struct hyperv_driver *driver)
 {
 	struct storvsc_driver_object *stor_driver;
 	int ret = 0;
@@ -73,7 +74,7 @@ int blk_vsc_initialize(struct hv_driver *driver)
 	/* ASSERT(stor_driver->RingBufferSize >= (PAGE_SIZE << 1)); */
 
 	driver->name = g_blk_driver_name;
-	memcpy(&driver->dev_type, &g_blk_device_type, sizeof(struct hv_guid));
+	memcpy(&driver->class_id, &g_blk_device_type, sizeof(struct hv_guid));
 
 	stor_driver->request_ext_size = sizeof(struct storvsc_request_extension);
 
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 36a0adb..194f648 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -95,7 +95,7 @@ struct blkvsc_request {
 /* Per device structure */
 struct block_device_context {
 	/* point back to our device context */
-	struct vm_device *device_ctx;
+	struct hyperv_device *hyperv_dev;
 	struct kmem_cache *request_pool;
 	spinlock_t lock;
 	struct gendisk *gd;
@@ -116,10 +116,10 @@ struct block_device_context {
 };
 
 /* Per driver */
-struct blkvsc_driver_context {
+struct blkvsc_hyperv_driver {
 	/* !! These must be the first 2 fields !! */
 	/* FIXME this is a bug! */
-	struct driver_context drv_ctx;
+	struct hyperv_driver drv;
 	struct storvsc_driver_object drv_obj;
 };
 
@@ -156,7 +156,7 @@ module_param(blkvsc_ringbuffer_size, int, S_IRUGO);
 MODULE_PARM_DESC(ring_size, "Ring buffer size (in bytes)");
 
 /* The one and only one */
-static struct blkvsc_driver_context g_blkvsc_drv;
+static struct blkvsc_hyperv_driver g_blkvsc_drv;
 
 static const struct block_device_operations block_ops = {
 	.owner = THIS_MODULE,
@@ -171,10 +171,10 @@ static const struct block_device_operations block_ops = {
 /*
  * blkvsc_drv_init -  BlkVsc driver initialization.
  */
-static int blkvsc_drv_init(int (*drv_init)(struct hv_driver *drv))
+static int blkvsc_drv_init(int (*drv_init)(struct hyperv_driver *drv))
 {
 	struct storvsc_driver_object *storvsc_drv_obj = &g_blkvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_blkvsc_drv.drv_ctx;
+	struct hyperv_driver *drv = &g_blkvsc_drv.drv;
 	int ret;
 
 	storvsc_drv_obj->ring_buffer_size = blkvsc_ringbuffer_size;
@@ -182,16 +182,16 @@ static int blkvsc_drv_init(int (*drv_init)(struct hv_driver *drv))
 	/* Callback to client driver to complete the initialization */
 	drv_init(&storvsc_drv_obj->base);
 
-	drv_ctx->driver.name = storvsc_drv_obj->base.name;
-	memcpy(&drv_ctx->class_id, &storvsc_drv_obj->base.dev_type,
+	drv->driver.name = storvsc_drv_obj->base.name;
+	memcpy(&drv->class_id, &storvsc_drv_obj->base.class_id,
 	       sizeof(struct hv_guid));
 
-	drv_ctx->probe = blkvsc_probe;
-	drv_ctx->remove = blkvsc_remove;
-	drv_ctx->shutdown = blkvsc_shutdown;
+	drv->probe = blkvsc_probe;
+	drv->remove = blkvsc_remove;
+	drv->shutdown = blkvsc_shutdown;
 
 	/* The driver belongs to vmbus */
-	ret = vmbus_child_driver_register(drv_ctx);
+	ret = vmbus_child_driver_register(drv);
 
 	return ret;
 }
@@ -206,7 +206,7 @@ static int blkvsc_drv_exit_cb(struct device *dev, void *data)
 static void blkvsc_drv_exit(void)
 {
 	struct storvsc_driver_object *storvsc_drv_obj = &g_blkvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_blkvsc_drv.drv_ctx;
+	struct hyperv_driver *drv = &g_blkvsc_drv.drv;
 	struct device *current_dev;
 	int ret;
 
@@ -214,7 +214,7 @@ static void blkvsc_drv_exit(void)
 		current_dev = NULL;
 
 		/* Get the device */
-		ret = driver_for_each_device(&drv_ctx->driver, NULL,
+		ret = driver_for_each_device(&drv->driver, NULL,
 					     (void *) &current_dev,
 					     blkvsc_drv_exit_cb);
 
@@ -233,7 +233,7 @@ static void blkvsc_drv_exit(void)
 	if (storvsc_drv_obj->base.cleanup)
 		storvsc_drv_obj->base.cleanup(&storvsc_drv_obj->base);
 
-	vmbus_child_driver_unregister(drv_ctx);
+	vmbus_child_driver_unregister(drv);
 
 	return;
 }
@@ -243,14 +243,13 @@ static void blkvsc_drv_exit(void)
  */
 static int blkvsc_probe(struct device *device)
 {
-	struct driver_context *driver_ctx =
-				driver_to_driver_context(device->driver);
-	struct blkvsc_driver_context *blkvsc_drv_ctx =
-				(struct blkvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *drv =
+				driver_to_hyperv_driver(device->driver);
+	struct blkvsc_hyperv_driver *blkvsc_drv =
+				(struct blkvsc_hyperv_driver *)drv;
 	struct storvsc_driver_object *storvsc_drv_obj =
-				&blkvsc_drv_ctx->drv_obj;
-	struct vm_device *device_ctx = device_to_vm_device(device);
-	struct hv_device *device_obj = &device_ctx->device_obj;
+				&blkvsc_drv->drv_obj;
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 
 	struct block_device_context *blkdev = NULL;
 	struct storvsc_device_info device_info;
@@ -282,7 +281,7 @@ static int blkvsc_probe(struct device *device)
 	/* ASSERT(sizeof(struct blkvsc_request_group) <= */
 	/* 	sizeof(struct blkvsc_request)); */
 
-	blkdev->request_pool = kmem_cache_create(dev_name(&device_ctx->device),
+	blkdev->request_pool = kmem_cache_create(dev_name(&device_obj->device),
 					sizeof(struct blkvsc_request) +
 					storvsc_drv_obj->request_ext_size, 0,
 					SLAB_HWCACHE_ALIGN, NULL);
@@ -299,7 +298,7 @@ static int blkvsc_probe(struct device *device)
 		goto Cleanup;
 	}
 
-	blkdev->device_ctx = device_ctx;
+	blkdev->hyperv_dev = device_obj;
 	/* this identified the device 0 or 1 */
 	blkdev->target = device_info.target_id;
 	/* this identified the ide ctrl 0 or 1 */
@@ -368,7 +367,7 @@ static int blkvsc_probe(struct device *device)
 		blkdev->gd->first_minor = 0;
 	blkdev->gd->fops = &block_ops;
 	blkdev->gd->private_data = blkdev;
-	blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device);
+	blkdev->gd->driverfs_dev = &(blkdev->hyperv_dev->device);
 	sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum);
 
 	blkvsc_do_inquiry(blkdev);
@@ -728,14 +727,13 @@ static int blkvsc_do_read_capacity16(struct block_device_context *blkdev)
  */
 static int blkvsc_remove(struct device *device)
 {
-	struct driver_context *driver_ctx =
-				driver_to_driver_context(device->driver);
-	struct blkvsc_driver_context *blkvsc_drv_ctx =
-				(struct blkvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *drv =
+				driver_to_hyperv_driver(device->driver);
+	struct blkvsc_hyperv_driver *blkvsc_drv =
+				(struct blkvsc_hyperv_driver *)drv;
 	struct storvsc_driver_object *storvsc_drv_obj =
-				&blkvsc_drv_ctx->drv_obj;
-	struct vm_device *device_ctx = device_to_vm_device(device);
-	struct hv_device *device_obj = &device_ctx->device_obj;
+				&blkvsc_drv->drv_obj;
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct block_device_context *blkdev = dev_get_drvdata(device);
 	unsigned long flags;
 	int ret;
@@ -850,13 +848,13 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req,
 			void (*request_completion)(struct hv_storvsc_request *))
 {
 	struct block_device_context *blkdev = blkvsc_req->dev;
-	struct vm_device *device_ctx = blkdev->device_ctx;
-	struct driver_context *driver_ctx =
-			driver_to_driver_context(device_ctx->device.driver);
-	struct blkvsc_driver_context *blkvsc_drv_ctx =
-			(struct blkvsc_driver_context *)driver_ctx;
+	struct hyperv_device *hyperv_dev = blkdev->hyperv_dev;
+	struct hyperv_driver *drv =
+			driver_to_hyperv_driver(hyperv_dev->device.driver);
+	struct blkvsc_hyperv_driver *blkvsc_drv =
+			(struct blkvsc_hyperv_driver *)drv;
 	struct storvsc_driver_object *storvsc_drv_obj =
-			&blkvsc_drv_ctx->drv_obj;
+			&blkvsc_drv->drv_obj;
 	struct hv_storvsc_request *storvsc_req;
 	int ret;
 
@@ -897,7 +895,7 @@ static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req,
 	storvsc_req->sense_buffer = blkvsc_req->sense_buffer;
 	storvsc_req->sense_buffer_size = SCSI_SENSE_BUFFERSIZE;
 
-	ret = storvsc_drv_obj->on_io_request(&blkdev->device_ctx->device_obj,
+	ret = storvsc_drv_obj->on_io_request(blkdev->hyperv_dev,
 					   &blkvsc_req->request);
 	if (ret == 0)
 		blkdev->num_outstanding_reqs++;
diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c
index 0781c0e..8d81288 100644
--- a/drivers/staging/hv/channel_mgmt.c
+++ b/drivers/staging/hv/channel_mgmt.c
@@ -28,6 +28,7 @@
 #include <linux/completion.h>
 #include "hv_api.h"
 #include "logging.h"
+#include "vmbus.h"
 #include "vmbus_private.h"
 #include "utils.h"
 
diff --git a/drivers/staging/hv/channel_mgmt.h b/drivers/staging/hv/channel_mgmt.h
index 3368bf1..7b42883 100644
--- a/drivers/staging/hv/channel_mgmt.h
+++ b/drivers/staging/hv/channel_mgmt.h
@@ -228,7 +228,7 @@ enum vmbus_channel_state {
 struct vmbus_channel {
 	struct list_head listentry;
 
-	struct hv_device *device_obj;
+	struct hyperv_device *device_obj;
 
 	struct timer_list poll_timer; /* SA-111 workaround */
 	struct work_struct work;
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 20b1597..8cf4f9c 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -26,6 +26,7 @@
 #include <linux/io.h>
 #include <linux/slab.h>
 #include "hv_api.h"
+#include "vmbus.h"
 #include "logging.h"
 #include "netvsc.h"
 #include "rndis_filter.h"
@@ -43,40 +44,41 @@ static const struct hv_guid netvsc_device_type = {
 	}
 };
 
-static int netvsc_device_add(struct hv_device *device, void *additional_info);
+static int netvsc_device_add(struct hyperv_device *device,
+			void *additional_info);
 
-static int netvsc_device_remove(struct hv_device *device);
+static int netvsc_device_remove(struct hyperv_device *device);
 
-static void netvsc_cleanup(struct hv_driver *driver);
+static void netvsc_cleanup(struct hyperv_driver *driver);
 
 static void netvsc_channel_cb(void *context);
 
-static int netvsc_init_send_buf(struct hv_device *device);
+static int netvsc_init_send_buf(struct hyperv_device *device);
 
-static int netvsc_init_recv_buf(struct hv_device *device);
+static int netvsc_init_recv_buf(struct hyperv_device *device);
 
 static int netvsc_destroy_send_buf(struct netvsc_device *net_device);
 
 static int netvsc_destroy_recv_buf(struct netvsc_device *net_device);
 
-static int netvsc_connect_vsp(struct hv_device *device);
+static int netvsc_connect_vsp(struct hyperv_device *device);
 
-static void netvsc_send_completion(struct hv_device *device,
+static void netvsc_send_completion(struct hyperv_device *device,
 				   struct vmpacket_descriptor *packet);
 
-static int netvsc_send(struct hv_device *device,
+static int netvsc_send(struct hyperv_device *device,
 			struct hv_netvsc_packet *packet);
 
-static void netvsc_receive(struct hv_device *device,
+static void netvsc_receive(struct hyperv_device *device,
 			    struct vmpacket_descriptor *packet);
 
 static void netvsc_receive_completion(void *context);
 
-static void netvsc_send_recv_completion(struct hv_device *device,
+static void netvsc_send_recv_completion(struct hyperv_device *device,
 					u64 transaction_id);
 
 
-static struct netvsc_device *alloc_net_device(struct hv_device *device)
+static struct netvsc_device *alloc_net_device(struct hyperv_device *device)
 {
 	struct netvsc_device *net_device;
 
@@ -102,7 +104,8 @@ static void free_net_device(struct netvsc_device *device)
 
 
 /* Get the net device object iff exists and its refcount > 1 */
-static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
+static struct netvsc_device *
+get_outbound_net_device(struct hyperv_device *device)
 {
 	struct netvsc_device *net_device;
 
@@ -116,7 +119,8 @@ static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
 }
 
 /* Get the net device object iff exists and its refcount > 0 */
-static struct netvsc_device *get_inbound_net_device(struct hv_device *device)
+static struct netvsc_device *
+get_inbound_net_device(struct hyperv_device *device)
 {
 	struct netvsc_device *net_device;
 
@@ -129,7 +133,7 @@ static struct netvsc_device *get_inbound_net_device(struct hv_device *device)
 	return net_device;
 }
 
-static void put_net_device(struct hv_device *device)
+static void put_net_device(struct hyperv_device *device)
 {
 	struct netvsc_device *net_device;
 
@@ -139,7 +143,7 @@ static void put_net_device(struct hv_device *device)
 }
 
 static struct netvsc_device *release_outbound_net_device(
-		struct hv_device *device)
+		struct hyperv_device *device)
 {
 	struct netvsc_device *net_device;
 
@@ -155,7 +159,7 @@ static struct netvsc_device *release_outbound_net_device(
 }
 
 static struct netvsc_device *release_inbound_net_device(
-		struct hv_device *device)
+		struct hyperv_device *device)
 {
 	struct netvsc_device *net_device;
 
@@ -174,7 +178,7 @@ static struct netvsc_device *release_inbound_net_device(
 /*
  * netvsc_initialize - Main entry point
  */
-int netvsc_initialize(struct hv_driver *drv)
+int netvsc_initialize(struct hyperv_driver *drv)
 {
 	struct netvsc_driver *driver = (struct netvsc_driver *)drv;
 
@@ -186,7 +190,7 @@ int netvsc_initialize(struct hv_driver *drv)
 		   sizeof(struct vmtransfer_page_packet_header));
 
 	drv->name = driver_name;
-	memcpy(&drv->dev_type, &netvsc_device_type, sizeof(struct hv_guid));
+	memcpy(&drv->class_id, &netvsc_device_type, sizeof(struct hv_guid));
 
 	/* Setup the dispatch table */
 	driver->base.dev_add	= netvsc_device_add;
@@ -199,7 +203,7 @@ int netvsc_initialize(struct hv_driver *drv)
 	return 0;
 }
 
-static int netvsc_init_recv_buf(struct hv_device *device)
+static int netvsc_init_recv_buf(struct hyperv_device *device)
 {
 	int ret = 0;
 	struct netvsc_device *net_device;
@@ -329,7 +333,7 @@ exit:
 	return ret;
 }
 
-static int netvsc_init_send_buf(struct hv_device *device)
+static int netvsc_init_send_buf(struct hyperv_device *device)
 {
 	int ret = 0;
 	struct netvsc_device *net_device;
@@ -571,7 +575,7 @@ static int netvsc_destroy_send_buf(struct netvsc_device *net_device)
 }
 
 
-static int netvsc_connect_vsp(struct hv_device *device)
+static int netvsc_connect_vsp(struct hyperv_device *device)
 {
 	int ret;
 	struct netvsc_device *net_device;
@@ -687,7 +691,8 @@ static void NetVscDisconnectFromVsp(struct netvsc_device *net_device)
  * netvsc_device_add - Callback when the device belonging to this
  * driver is added
  */
-static int netvsc_device_add(struct hv_device *device, void *additional_info)
+static int netvsc_device_add(struct hyperv_device *device,
+			void *additional_info)
 {
 	int ret = 0;
 	int i;
@@ -780,7 +785,7 @@ cleanup:
 /*
  * netvsc_device_remove - Callback when the root bus device is removed
  */
-static int netvsc_device_remove(struct hv_device *device)
+static int netvsc_device_remove(struct hyperv_device *device)
 {
 	struct netvsc_device *net_device;
 	struct hv_netvsc_packet *netvsc_packet, *pos;
@@ -832,11 +837,11 @@ static int netvsc_device_remove(struct hv_device *device)
 /*
  * netvsc_cleanup - Perform any cleanup when the driver is removed
  */
-static void netvsc_cleanup(struct hv_driver *drv)
+static void netvsc_cleanup(struct hyperv_driver *drv)
 {
 }
 
-static void netvsc_send_completion(struct hv_device *device,
+static void netvsc_send_completion(struct hyperv_device *device,
 				   struct vmpacket_descriptor *packet)
 {
 	struct netvsc_device *net_device;
@@ -885,7 +890,7 @@ static void netvsc_send_completion(struct hv_device *device,
 	put_net_device(device);
 }
 
-static int netvsc_send(struct hv_device *device,
+static int netvsc_send(struct hyperv_device *device,
 			struct hv_netvsc_packet *packet)
 {
 	struct netvsc_device *net_device;
@@ -939,7 +944,7 @@ static int netvsc_send(struct hv_device *device,
 	return ret;
 }
 
-static void netvsc_receive(struct hv_device *device,
+static void netvsc_receive(struct hyperv_device *device,
 			    struct vmpacket_descriptor *packet)
 {
 	struct netvsc_device *net_device;
@@ -1136,7 +1141,7 @@ static void netvsc_receive(struct hv_device *device,
 	put_net_device(device);
 }
 
-static void netvsc_send_recv_completion(struct hv_device *device,
+static void netvsc_send_recv_completion(struct hyperv_device *device,
 					u64 transaction_id)
 {
 	struct nvsp_message recvcompMessage;
@@ -1185,7 +1190,7 @@ retry_send_cmplt:
 static void netvsc_receive_completion(void *context)
 {
 	struct hv_netvsc_packet *packet = context;
-	struct hv_device *device = (struct hv_device *)packet->device;
+	struct hyperv_device *device = (struct hyperv_device *)packet->device;
 	struct netvsc_device *net_device;
 	u64 transaction_id = 0;
 	bool fsend_receive_comp = false;
@@ -1234,7 +1239,7 @@ static void netvsc_receive_completion(void *context)
 static void netvsc_channel_cb(void *context)
 {
 	int ret;
-	struct hv_device *device = context;
+	struct hyperv_device *device = context;
 	struct netvsc_device *net_device;
 	u32 bytes_recvd;
 	u64 request_id;
diff --git a/drivers/staging/hv/netvsc.h b/drivers/staging/hv/netvsc.h
index 45d24b9..ea3a05f 100644
--- a/drivers/staging/hv/netvsc.h
+++ b/drivers/staging/hv/netvsc.h
@@ -293,7 +293,7 @@ struct nvsp_message {
 
 /* Per netvsc channel-specific */
 struct netvsc_device {
-	struct hv_device *dev;
+	struct hyperv_device *dev;
 
 	atomic_t refcnt;
 	atomic_t num_outstanding_sends;
diff --git a/drivers/staging/hv/netvsc_api.h b/drivers/staging/hv/netvsc_api.h
index b4bed36..a96cce4 100644
--- a/drivers/staging/hv/netvsc_api.h
+++ b/drivers/staging/hv/netvsc_api.h
@@ -49,7 +49,7 @@ struct hv_netvsc_packet {
 	/* Bookkeeping stuff */
 	struct list_head list_ent;
 
-	struct hv_device *device;
+	struct hyperv_device *device;
 	bool is_data_pkt;
 
 	/*
@@ -84,7 +84,7 @@ struct hv_netvsc_packet {
 struct netvsc_driver {
 	/* Must be the first field */
 	/* Which is a bug FIXME! */
-	struct hv_driver base;
+	struct hyperv_driver base;
 
 	u32 ring_buf_size;
 	u32 req_ext_size;
@@ -93,12 +93,12 @@ struct netvsc_driver {
 	 * This is set by the caller to allow us to callback when we
 	 * receive a packet from the "wire"
 	 */
-	int (*recv_cb)(struct hv_device *dev,
+	int (*recv_cb)(struct hyperv_device *dev,
 				 struct hv_netvsc_packet *packet);
-	void (*link_status_change)(struct hv_device *dev, u32 status);
+	void (*link_status_change)(struct hyperv_device *dev, u32 status);
 
 	/* Specific to this driver */
-	int (*send)(struct hv_device *dev, struct hv_netvsc_packet *packet);
+	int (*send)(struct hyperv_device *dev, struct hv_netvsc_packet *packet);
 
 	void *ctx;
 };
@@ -109,8 +109,8 @@ struct netvsc_device_info {
 };
 
 /* Interface */
-int netvsc_initialize(struct hv_driver *drv);
-int rndis_filter_open(struct hv_device *dev);
-int rndis_filter_close(struct hv_device *dev);
+int netvsc_initialize(struct hyperv_driver *drv);
+int rndis_filter_open(struct hyperv_device *dev);
+int rndis_filter_close(struct hyperv_device *dev);
 
 #endif /* _NETVSC_API_H_ */
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 03f9740..d2cbf4c 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -44,14 +44,14 @@
 
 struct net_device_context {
 	/* point back to our device context */
-	struct vm_device *device_ctx;
+	struct hyperv_device *hyperv_dev;
 	unsigned long avail;
 };
 
-struct netvsc_driver_context {
+struct netvsc_hyperv_driver {
 	/* !! These must be the first 2 fields !! */
 	/* Which is a bug FIXME! */
-	struct driver_context drv_ctx;
+	struct hyperv_driver drv;
 	struct netvsc_driver drv_obj;
 };
 
@@ -64,7 +64,7 @@ module_param(ring_size, int, S_IRUGO);
 MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
 
 /* The one and only one */
-static struct netvsc_driver_context g_netvsc_drv;
+static struct netvsc_hyperv_driver g_netvsc_drv;
 
 /* no-op so the netdev core doesn't return -EINVAL when modifying the the
  * multicast address list in SIOCADDMULTI. hv is setup to get all multicast
@@ -75,8 +75,8 @@ static void netvsc_set_multicast_list(struct net_device *net)
 
 static int netvsc_open(struct net_device *net)
 {
-	struct net_device_context *net_device_ctx = netdev_priv(net);
-	struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj;
+	struct net_device_context *net_hyperv_dev = netdev_priv(net);
+	struct hyperv_device *device_obj = net_hyperv_dev->hyperv_dev;
 	int ret = 0;
 
 	if (netif_carrier_ok(net)) {
@@ -98,8 +98,8 @@ static int netvsc_open(struct net_device *net)
 
 static int netvsc_close(struct net_device *net)
 {
-	struct net_device_context *net_device_ctx = netdev_priv(net);
-	struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj;
+	struct net_device_context *net_hyperv_dev = netdev_priv(net);
+	struct hyperv_device *device_obj = net_hyperv_dev->hyperv_dev;
 	int ret;
 
 	netif_stop_queue(net);
@@ -121,25 +121,25 @@ static void netvsc_xmit_completion(void *context)
 
 	if (skb) {
 		struct net_device *net = skb->dev;
-		struct net_device_context *net_device_ctx = netdev_priv(net);
+		struct net_device_context *net_hyperv_dev = netdev_priv(net);
 		unsigned int num_pages = skb_shinfo(skb)->nr_frags + 2;
 
 		dev_kfree_skb_any(skb);
 
-		net_device_ctx->avail += num_pages;
-		if (net_device_ctx->avail >= PACKET_PAGES_HIWATER)
+		net_hyperv_dev->avail += num_pages;
+		if (net_hyperv_dev->avail >= PACKET_PAGES_HIWATER)
  			netif_wake_queue(net);
 	}
 }
 
 static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 {
-	struct net_device_context *net_device_ctx = netdev_priv(net);
-	struct driver_context *driver_ctx =
-	    driver_to_driver_context(net_device_ctx->device_ctx->device.driver);
-	struct netvsc_driver_context *net_drv_ctx =
-		(struct netvsc_driver_context *)driver_ctx;
-	struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
+	struct net_device_context *net_hyperv_dev = netdev_priv(net);
+	struct hyperv_driver *drv =
+	    driver_to_hyperv_driver(net_hyperv_dev->hyperv_dev->device.driver);
+	struct netvsc_hyperv_driver *net_drv =
+		(struct netvsc_hyperv_driver *)drv;
+	struct netvsc_driver *net_drv_obj = &net_drv->drv_obj;
 	struct hv_netvsc_packet *packet;
 	int ret;
 	unsigned int i, num_pages;
@@ -149,7 +149,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 
 	/* Add 1 for skb->data and additional one for RNDIS */
 	num_pages = skb_shinfo(skb)->nr_frags + 1 + 1;
-	if (num_pages > net_device_ctx->avail)
+	if (num_pages > net_hyperv_dev->avail)
 		return NETDEV_TX_BUSY;
 
 	/* Allocate a netvsc packet based on # of frags. */
@@ -198,7 +198,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 	packet->completion.send.send_completion_ctx = packet;
 	packet->completion.send.send_completion_tid = (unsigned long)skb;
 
-	ret = net_drv_obj->send(&net_device_ctx->device_ctx->device_obj,
+	ret = net_drv_obj->send(net_hyperv_dev->hyperv_dev,
 				  packet);
 	if (ret == 0) {
 		net->stats.tx_bytes += skb->len;
@@ -208,8 +208,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 			   net->stats.tx_packets,
 			   net->stats.tx_bytes);
 
-		net_device_ctx->avail -= num_pages;
-		if (net_device_ctx->avail < PACKET_PAGES_LOWATER)
+		net_hyperv_dev->avail -= num_pages;
+		if (net_hyperv_dev->avail < PACKET_PAGES_LOWATER)
 			netif_stop_queue(net);
 	} else {
 		/* we are shutting down or bus overloaded, just drop packet */
@@ -223,11 +223,10 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
 /*
  * netvsc_linkstatus_callback - Link up/down notification
  */
-static void netvsc_linkstatus_callback(struct hv_device *device_obj,
+static void netvsc_linkstatus_callback(struct hyperv_device *hyperv_dev,
 				       unsigned int status)
 {
-	struct vm_device *device_ctx = to_vm_device(device_obj);
-	struct net_device *net = dev_get_drvdata(&device_ctx->device);
+	struct net_device *net = dev_get_drvdata(&hyperv_dev->device);
 
 	if (!net) {
 		DPRINT_ERR(NETVSC_DRV, "got link status but net device "
@@ -249,11 +248,10 @@ static void netvsc_linkstatus_callback(struct hv_device *device_obj,
  * netvsc_recv_callback -  Callback when we receive a packet from the
  * "wire" on the specified device.
  */
-static int netvsc_recv_callback(struct hv_device *device_obj,
+static int netvsc_recv_callback(struct hyperv_device *hyperv_dev,
 				struct hv_netvsc_packet *packet)
 {
-	struct vm_device *device_ctx = to_vm_device(device_obj);
-	struct net_device *net = dev_get_drvdata(&device_ctx->device);
+	struct net_device *net = dev_get_drvdata(&hyperv_dev->device);
 	struct sk_buff *skb;
 	void *data;
 	int i;
@@ -340,15 +338,14 @@ static const struct net_device_ops device_ops = {
 
 static int netvsc_probe(struct device *device)
 {
-	struct driver_context *driver_ctx =
-		driver_to_driver_context(device->driver);
-	struct netvsc_driver_context *net_drv_ctx =
-		(struct netvsc_driver_context *)driver_ctx;
-	struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
-	struct vm_device *device_ctx = device_to_vm_device(device);
-	struct hv_device *device_obj = &device_ctx->device_obj;
+	struct hyperv_driver *drv =
+		driver_to_hyperv_driver(device->driver);
+	struct netvsc_hyperv_driver *net_drv =
+		(struct netvsc_hyperv_driver *)drv;
+	struct netvsc_driver *net_drv_obj = &net_drv->drv_obj;
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct net_device *net = NULL;
-	struct net_device_context *net_device_ctx;
+	struct net_device_context *net_hyperv_dev;
 	struct netvsc_device_info device_info;
 	int ret;
 
@@ -362,9 +359,9 @@ static int netvsc_probe(struct device *device)
 	/* Set initial state */
 	netif_carrier_off(net);
 
-	net_device_ctx = netdev_priv(net);
-	net_device_ctx->device_ctx = device_ctx;
-	net_device_ctx->avail = ring_size;
+	net_hyperv_dev = netdev_priv(net);
+	net_hyperv_dev->hyperv_dev = device_obj;
+	net_hyperv_dev->avail = ring_size;
 	dev_set_drvdata(device, net);
 
 	/* Notify the netvsc driver of the new device */
@@ -412,14 +409,13 @@ static int netvsc_probe(struct device *device)
 
 static int netvsc_remove(struct device *device)
 {
-	struct driver_context *driver_ctx =
-		driver_to_driver_context(device->driver);
-	struct netvsc_driver_context *net_drv_ctx =
-		(struct netvsc_driver_context *)driver_ctx;
-	struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
-	struct vm_device *device_ctx = device_to_vm_device(device);
-	struct net_device *net = dev_get_drvdata(&device_ctx->device);
-	struct hv_device *device_obj = &device_ctx->device_obj;
+	struct hyperv_driver *drv =
+		driver_to_hyperv_driver(device->driver);
+	struct netvsc_hyperv_driver *net_drv =
+		(struct netvsc_hyperv_driver *)drv;
+	struct netvsc_driver *net_drv_obj = &net_drv->drv_obj;
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
+	struct net_device *net = dev_get_drvdata(&device_obj->device);
 	int ret;
 
 	if (net == NULL) {
@@ -462,7 +458,7 @@ static int netvsc_drv_exit_cb(struct device *dev, void *data)
 static void netvsc_drv_exit(void)
 {
 	struct netvsc_driver *netvsc_drv_obj = &g_netvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_netvsc_drv.drv_ctx;
+	struct hyperv_driver *drv = &g_netvsc_drv.drv;
 	struct device *current_dev;
 	int ret;
 
@@ -470,7 +466,7 @@ static void netvsc_drv_exit(void)
 		current_dev = NULL;
 
 		/* Get the device */
-		ret = driver_for_each_device(&drv_ctx->driver, NULL,
+		ret = driver_for_each_device(&drv->driver, NULL,
 					     &current_dev, netvsc_drv_exit_cb);
 		if (ret)
 			DPRINT_WARN(NETVSC_DRV,
@@ -489,15 +485,15 @@ static void netvsc_drv_exit(void)
 	if (netvsc_drv_obj->base.cleanup)
 		netvsc_drv_obj->base.cleanup(&netvsc_drv_obj->base);
 
-	vmbus_child_driver_unregister(drv_ctx);
+	vmbus_child_driver_unregister(drv);
 
 	return;
 }
 
-static int netvsc_drv_init(int (*drv_init)(struct hv_driver *drv))
+static int netvsc_drv_init(int (*drv_init)(struct hyperv_driver *drv))
 {
 	struct netvsc_driver *net_drv_obj = &g_netvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_netvsc_drv.drv_ctx;
+	struct hyperv_driver *drv = &g_netvsc_drv.drv;
 	int ret;
 
 	net_drv_obj->ring_buf_size = ring_size * PAGE_SIZE;
@@ -507,15 +503,15 @@ static int netvsc_drv_init(int (*drv_init)(struct hv_driver *drv))
 	/* Callback to client driver to complete the initialization */
 	drv_init(&net_drv_obj->base);
 
-	drv_ctx->driver.name = net_drv_obj->base.name;
-	memcpy(&drv_ctx->class_id, &net_drv_obj->base.dev_type,
+	drv->driver.name = net_drv_obj->base.name;
+	memcpy(&drv->class_id, &net_drv_obj->base.class_id,
 	       sizeof(struct hv_guid));
 
-	drv_ctx->probe = netvsc_probe;
-	drv_ctx->remove = netvsc_remove;
+	drv->probe = netvsc_probe;
+	drv->remove = netvsc_remove;
 
 	/* The driver belongs to vmbus */
-	ret = vmbus_child_driver_register(drv_ctx);
+	ret = vmbus_child_driver_register(drv);
 
 	return ret;
 }
diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
index e7189cd..a8f7927 100644
--- a/drivers/staging/hv/rndis_filter.c
+++ b/drivers/staging/hv/rndis_filter.c
@@ -28,6 +28,7 @@
 
 #include "logging.h"
 #include "hv_api.h"
+#include "vmbus.h"
 #include "netvsc_api.h"
 #include "rndis_filter.h"
 
@@ -84,14 +85,14 @@ struct rndis_filter_packet {
 };
 
 
-static int rndis_filte_device_add(struct hv_device *dev,
+static int rndis_filte_device_add(struct hyperv_device *dev,
 				  void *additional_info);
 
-static int rndis_filter_device_remove(struct hv_device *dev);
+static int rndis_filter_device_remove(struct hyperv_device *dev);
 
-static void rndis_filter_cleanup(struct hv_driver *drv);
+static void rndis_filter_cleanup(struct hyperv_driver *drv);
 
-static int rndis_filter_send(struct hv_device *dev,
+static int rndis_filter_send(struct hyperv_device *dev,
 			     struct hv_netvsc_packet *pkt);
 
 static void rndis_filter_send_completion(void *ctx);
@@ -375,7 +376,7 @@ static void rndis_filter_receive_data(struct rndis_device *dev,
 						   pkt);
 }
 
-static int rndis_filter_receive(struct hv_device *dev,
+static int rndis_filter_receive(struct hyperv_device *dev,
 				struct hv_netvsc_packet	*pkt)
 {
 	struct netvsc_device *net_dev = dev->ext;
@@ -753,7 +754,7 @@ static int rndis_filter_close_device(struct rndis_device *dev)
 	return ret;
 }
 
-static int rndis_filte_device_add(struct hv_device *dev,
+static int rndis_filte_device_add(struct hyperv_device *dev,
 				  void *additional_info)
 {
 	int ret;
@@ -816,7 +817,7 @@ static int rndis_filte_device_add(struct hv_device *dev,
 	return ret;
 }
 
-static int rndis_filter_device_remove(struct hv_device *dev)
+static int rndis_filter_device_remove(struct hyperv_device *dev)
 {
 	struct netvsc_device *net_dev = dev->ext;
 	struct rndis_device *rndis_dev = net_dev->extension;
@@ -833,11 +834,11 @@ static int rndis_filter_device_remove(struct hv_device *dev)
 	return 0;
 }
 
-static void rndis_filter_cleanup(struct hv_driver *drv)
+static void rndis_filter_cleanup(struct hyperv_driver *drv)
 {
 }
 
-int rndis_filter_open(struct hv_device *dev)
+int rndis_filter_open(struct hyperv_device *dev)
 {
 	struct netvsc_device *netDevice = dev->ext;
 
@@ -847,7 +848,7 @@ int rndis_filter_open(struct hv_device *dev)
 	return rndis_filter_open_device(netDevice->extension);
 }
 
-int rndis_filter_close(struct hv_device *dev)
+int rndis_filter_close(struct hyperv_device *dev)
 {
 	struct netvsc_device *netDevice = dev->ext;
 
@@ -857,7 +858,7 @@ int rndis_filter_close(struct hv_device *dev)
 	return rndis_filter_close_device(netDevice->extension);
 }
 
-static int rndis_filter_send(struct hv_device *dev,
+static int rndis_filter_send(struct hyperv_device *dev,
 			     struct hv_netvsc_packet *pkt)
 {
 	int ret;
diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index e2ad729..dcecd25 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -26,6 +26,7 @@
 #include <linux/mm.h>
 #include <linux/delay.h>
 #include "hv_api.h"
+#include "vmbus.h"
 #include "logging.h"
 #include "storvsc_api.h"
 #include "vmbus_packet_format.h"
@@ -37,7 +38,7 @@ struct storvsc_request_extension {
 	/* LIST_ENTRY ListEntry; */
 
 	struct hv_storvsc_request *request;
-	struct hv_device *device;
+	struct hyperv_device *device;
 
 	/* Synchronize the request/response if needed */
 	int wait_condition;
@@ -48,7 +49,7 @@ struct storvsc_request_extension {
 
 /* A storvsc device is a device object that contains a vmbus channel */
 struct storvsc_device {
-	struct hv_device *device;
+	struct hyperv_device *device;
 
 	/* 0 indicates the device is being destroyed */
 	atomic_t ref_count;
@@ -84,7 +85,8 @@ static const struct hv_guid gStorVscDeviceType = {
 };
 
 
-static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+static inline struct
+storvsc_device *alloc_stor_device(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -109,7 +111,8 @@ static inline void free_stor_device(struct storvsc_device *device)
 }
 
 /* Get the stordevice object iff exists and its refcount > 1 */
-static inline struct storvsc_device *get_stor_device(struct hv_device *device)
+static inline struct storvsc_device *
+get_stor_device(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -124,7 +127,7 @@ static inline struct storvsc_device *get_stor_device(struct hv_device *device)
 
 /* Get the stordevice object iff exists and its refcount > 0 */
 static inline struct storvsc_device *must_get_stor_device(
-					struct hv_device *device)
+					struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -137,7 +140,7 @@ static inline struct storvsc_device *must_get_stor_device(
 	return stor_device;
 }
 
-static inline void put_stor_device(struct hv_device *device)
+static inline void put_stor_device(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -150,7 +153,7 @@ static inline void put_stor_device(struct hv_device *device)
 
 /* Drop ref count to 1 to effectively disable get_stor_device() */
 static inline struct storvsc_device *release_stor_device(
-					struct hv_device *device)
+					struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -166,7 +169,7 @@ static inline struct storvsc_device *release_stor_device(
 
 /* Drop ref count to 0. No one can use stor_device object. */
 static inline struct storvsc_device *final_release_stor_device(
-			struct hv_device *device)
+			struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -181,7 +184,7 @@ static inline struct storvsc_device *final_release_stor_device(
 	return stor_device;
 }
 
-static int stor_vsc_channel_init(struct hv_device *device)
+static int stor_vsc_channel_init(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 	struct storvsc_request_extension *request;
@@ -362,7 +365,7 @@ cleanup:
 	return ret;
 }
 
-static void stor_vsc_on_io_completion(struct hv_device *device,
+static void stor_vsc_on_io_completion(struct hyperv_device *device,
 				  struct vstor_packet *vstor_packet,
 				  struct storvsc_request_extension *request_ext)
 {
@@ -426,7 +429,7 @@ static void stor_vsc_on_io_completion(struct hv_device *device,
 	put_stor_device(device);
 }
 
-static void stor_vsc_on_receive(struct hv_device *device,
+static void stor_vsc_on_receive(struct hyperv_device *device,
 			     struct vstor_packet *vstor_packet,
 			     struct storvsc_request_extension *request_ext)
 {
@@ -449,7 +452,7 @@ static void stor_vsc_on_receive(struct hv_device *device,
 
 static void stor_vsc_on_channel_callback(void *context)
 {
-	struct hv_device *device = (struct hv_device *)context;
+	struct hyperv_device *device = (struct hyperv_device *)context;
 	struct storvsc_device *stor_device;
 	u32 bytes_recvd;
 	u64 request_id;
@@ -509,7 +512,7 @@ static void stor_vsc_on_channel_callback(void *context)
 	return;
 }
 
-static int stor_vsc_connect_to_vsp(struct hv_device *device)
+static int stor_vsc_connect_to_vsp(struct hyperv_device *device)
 {
 	struct vmstorage_channel_properties props;
 	struct storvsc_driver_object *stor_driver;
@@ -543,7 +546,7 @@ static int stor_vsc_connect_to_vsp(struct hv_device *device)
  * stor_vsc_on_device_add - Callback when the device belonging to this driver
  * is added
  */
-static int stor_vsc_on_device_add(struct hv_device *device,
+static int stor_vsc_on_device_add(struct hyperv_device *device,
 					void *additional_info)
 {
 	struct storvsc_device *stor_device;
@@ -592,7 +595,7 @@ cleanup:
 /*
  * stor_vsc_on_device_remove - Callback when the our device is being removed
  */
-static int stor_vsc_on_device_remove(struct hv_device *device)
+static int stor_vsc_on_device_remove(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 
@@ -626,7 +629,7 @@ static int stor_vsc_on_device_remove(struct hv_device *device)
 	return 0;
 }
 
-int stor_vsc_on_host_reset(struct hv_device *device)
+int stor_vsc_on_host_reset(struct hyperv_device *device)
 {
 	struct storvsc_device *stor_device;
 	struct storvsc_request_extension *request;
@@ -685,7 +688,7 @@ cleanup:
 /*
  * stor_vsc_on_io_request - Callback to initiate an I/O request
  */
-static int stor_vsc_on_io_request(struct hv_device *device,
+static int stor_vsc_on_io_request(struct hyperv_device *device,
 			      struct hv_storvsc_request *request)
 {
 	struct storvsc_device *stor_device;
@@ -778,14 +781,14 @@ static int stor_vsc_on_io_request(struct hv_device *device,
 /*
  * stor_vsc_on_cleanup - Perform any cleanup when the driver is removed
  */
-static void stor_vsc_on_cleanup(struct hv_driver *driver)
+static void stor_vsc_on_cleanup(struct hyperv_driver *driver)
 {
 }
 
 /*
  * stor_vsc_initialize - Main entry point
  */
-int stor_vsc_initialize(struct hv_driver *driver)
+int stor_vsc_initialize(struct hyperv_driver *driver)
 {
 	struct storvsc_driver_object *stor_driver;
 
@@ -804,7 +807,7 @@ int stor_vsc_initialize(struct hv_driver *driver)
 	/* ASSERT(stor_driver->RingBufferSize >= (PAGE_SIZE << 1)); */
 
 	driver->name = g_driver_name;
-	memcpy(&driver->dev_type, &gStorVscDeviceType,
+	memcpy(&driver->class_id, &gStorVscDeviceType,
 	       sizeof(struct hv_guid));
 
 	stor_driver->request_ext_size =
diff --git a/drivers/staging/hv/storvsc_api.h b/drivers/staging/hv/storvsc_api.h
index fbf5755..e105929 100644
--- a/drivers/staging/hv/storvsc_api.h
+++ b/drivers/staging/hv/storvsc_api.h
@@ -80,7 +80,7 @@ struct hv_storvsc_request {
 struct storvsc_driver_object {
 	/* Must be the first field */
 	/* Which is a bug FIXME! */
-	struct hv_driver base;
+	struct hyperv_driver base;
 
 	/* Set by caller (in bytes) */
 	u32 ring_buffer_size;
@@ -92,7 +92,7 @@ struct storvsc_driver_object {
 	u32 max_outstanding_req_per_channel;
 
 	/* Specific to this driver */
-	int (*on_io_request)(struct hv_device *device,
+	int (*on_io_request)(struct hyperv_device *device,
 			   struct hv_storvsc_request *request);
 };
 
@@ -103,8 +103,8 @@ struct storvsc_device_info {
 };
 
 /* Interface */
-int stor_vsc_initialize(struct hv_driver *driver);
-int stor_vsc_on_host_reset(struct hv_device *device);
-int blk_vsc_initialize(struct hv_driver *driver);
+int stor_vsc_initialize(struct hyperv_driver *driver);
+int stor_vsc_on_host_reset(struct hyperv_device *device);
+int blk_vsc_initialize(struct hyperv_driver *driver);
 
 #endif /* _STORVSC_API_H_ */
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index a8427ff..d09fe16 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -42,7 +42,7 @@ struct host_device_context {
 	/* must be 1st field
 	 * FIXME this is a bug */
 	/* point back to our device context */
-	struct vm_device *device_ctx;
+	struct hyperv_device *hyperv_dev;
 	struct kmem_cache *request_pool;
 	unsigned int port;
 	unsigned char path;
@@ -63,10 +63,10 @@ struct storvsc_cmd_request {
 	 * Which sounds like a very bad design... */
 };
 
-struct storvsc_driver_context {
+struct storvsc_hyperv_driver {
 	/* !! These must be the first 2 fields !! */
 	/* FIXME this is a bug... */
-	struct driver_context drv_ctx;
+	struct hyperv_driver drv;
 	struct storvsc_driver_object drv_obj;
 };
 
@@ -100,7 +100,7 @@ module_param(storvsc_ringbuffer_size, int, S_IRUGO);
 MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
 
 /* The one and only one */
-static struct storvsc_driver_context g_storvsc_drv;
+static struct storvsc_hyperv_driver g_storvsc_drv;
 
 /* Scsi driver */
 static struct scsi_host_template scsi_driver = {
@@ -134,11 +134,11 @@ static struct scsi_host_template scsi_driver = {
 /*
  * storvsc_drv_init - StorVsc driver initialization.
  */
-static int storvsc_drv_init(int (*drv_init)(struct hv_driver *drv))
+static int storvsc_drv_init(int (*drv_init)(struct hyperv_driver *drv))
 {
 	int ret;
 	struct storvsc_driver_object *storvsc_drv_obj = &g_storvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_storvsc_drv.drv_ctx;
+	struct hyperv_driver *drv = &g_storvsc_drv.drv;
 
 	storvsc_drv_obj->ring_buffer_size = storvsc_ringbuffer_size;
 
@@ -160,15 +160,15 @@ static int storvsc_drv_init(int (*drv_init)(struct hv_driver *drv))
 		return -1;
 	}
 
-	drv_ctx->driver.name = storvsc_drv_obj->base.name;
-	memcpy(&drv_ctx->class_id, &storvsc_drv_obj->base.dev_type,
+	drv->driver.name = storvsc_drv_obj->base.name;
+	memcpy(&drv->class_id, &storvsc_drv_obj->base.class_id,
 	       sizeof(struct hv_guid));
 
-	drv_ctx->probe = storvsc_probe;
-	drv_ctx->remove = storvsc_remove;
+	drv->probe = storvsc_probe;
+	drv->remove = storvsc_remove;
 
 	/* The driver belongs to vmbus */
-	ret = vmbus_child_driver_register(drv_ctx);
+	ret = vmbus_child_driver_register(drv);
 
 	return ret;
 }
@@ -183,7 +183,7 @@ static int storvsc_drv_exit_cb(struct device *dev, void *data)
 static void storvsc_drv_exit(void)
 {
 	struct storvsc_driver_object *storvsc_drv_obj = &g_storvsc_drv.drv_obj;
-	struct driver_context *drv_ctx = &g_storvsc_drv.drv_ctx;
+	struct hyperv_driver *drv = &g_storvsc_drv.drv;
 	struct device *current_dev = NULL;
 	int ret;
 
@@ -191,7 +191,7 @@ static void storvsc_drv_exit(void)
 		current_dev = NULL;
 
 		/* Get the device */
-		ret = driver_for_each_device(&drv_ctx->driver, NULL,
+		ret = driver_for_each_device(&drv->driver, NULL,
 					     (void *) &current_dev,
 					     storvsc_drv_exit_cb);
 
@@ -209,7 +209,7 @@ static void storvsc_drv_exit(void)
 	if (storvsc_drv_obj->base.cleanup)
 		storvsc_drv_obj->base.cleanup(&storvsc_drv_obj->base);
 
-	vmbus_child_driver_unregister(drv_ctx);
+	vmbus_child_driver_unregister(drv);
 	return;
 }
 
@@ -219,14 +219,13 @@ static void storvsc_drv_exit(void)
 static int storvsc_probe(struct device *device)
 {
 	int ret;
-	struct driver_context *driver_ctx =
-				driver_to_driver_context(device->driver);
-	struct storvsc_driver_context *storvsc_drv_ctx =
-				(struct storvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *drv =
+				driver_to_hyperv_driver(device->driver);
+	struct storvsc_hyperv_driver *storvsc_drv =
+				(struct storvsc_hyperv_driver *)drv;
 	struct storvsc_driver_object *storvsc_drv_obj =
-				&storvsc_drv_ctx->drv_obj;
-	struct vm_device *device_ctx = device_to_vm_device(device);
-	struct hv_device *device_obj = &device_ctx->device_obj;
+				&storvsc_drv->drv_obj;
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct Scsi_Host *host;
 	struct host_device_context *host_device_ctx;
 	struct storvsc_device_info device_info;
@@ -247,10 +246,10 @@ static int storvsc_probe(struct device *device)
 	memset(host_device_ctx, 0, sizeof(struct host_device_context));
 
 	host_device_ctx->port = host->host_no;
-	host_device_ctx->device_ctx = device_ctx;
+	host_device_ctx->hyperv_dev = device_obj;
 
 	host_device_ctx->request_pool =
-				kmem_cache_create(dev_name(&device_ctx->device),
+				kmem_cache_create(dev_name(&device_obj->device),
 					sizeof(struct storvsc_cmd_request) +
 					storvsc_drv_obj->request_ext_size, 0,
 					SLAB_HWCACHE_ALIGN, NULL);
@@ -271,7 +270,7 @@ static int storvsc_probe(struct device *device)
 		return -1;
 	}
 
-	/* host_device_ctx->port = device_info.PortNumber; */
+	/* host_hyperv_dev->port = device_info.PortNumber; */
 	host_device_ctx->path = device_info.path_id;
 	host_device_ctx->target = device_info.target_id;
 
@@ -304,16 +303,15 @@ static int storvsc_probe(struct device *device)
 static int storvsc_remove(struct device *device)
 {
 	int ret;
-	struct driver_context *driver_ctx =
-			driver_to_driver_context(device->driver);
-	struct storvsc_driver_context *storvsc_drv_ctx =
-			(struct storvsc_driver_context *)driver_ctx;
+	struct hyperv_driver *drv =
+			driver_to_hyperv_driver(device->driver);
+	struct storvsc_hyperv_driver *storvsc_drv =
+			(struct storvsc_hyperv_driver *)drv;
 	struct storvsc_driver_object *storvsc_drv_obj =
-			&storvsc_drv_ctx->drv_obj;
-	struct vm_device *device_ctx = device_to_vm_device(device);
-	struct hv_device *device_obj = &device_ctx->device_obj;
+			&storvsc_drv->drv_obj;
+	struct hyperv_device *device_obj = device_to_hyperv_device(device);
 	struct Scsi_Host *host = dev_get_drvdata(device);
-	struct host_device_context *host_device_ctx =
+	struct host_device_context *host_hyperv_dev =
 			(struct host_device_context *)host->hostdata;
 
 
@@ -331,9 +329,9 @@ static int storvsc_remove(struct device *device)
 			   ret);
 	}
 
-	if (host_device_ctx->request_pool) {
-		kmem_cache_destroy(host_device_ctx->request_pool);
-		host_device_ctx->request_pool = NULL;
+	if (host_hyperv_dev->request_pool) {
+		kmem_cache_destroy(host_hyperv_dev->request_pool);
+		host_hyperv_dev->request_pool = NULL;
 	}
 
 	DPRINT_INFO(STORVSC, "removing host adapter (%p)...", host);
@@ -352,7 +350,7 @@ static void storvsc_commmand_completion(struct hv_storvsc_request *request)
 	struct storvsc_cmd_request *cmd_request =
 		(struct storvsc_cmd_request *)request->context;
 	struct scsi_cmnd *scmnd = cmd_request->cmd;
-	struct host_device_context *host_device_ctx =
+	struct host_device_context *host_hyperv_dev =
 		(struct host_device_context *)scmnd->device->host->hostdata;
 	void (*scsi_done_fn)(struct scsi_cmnd *);
 	struct scsi_sense_hdr sense_hdr;
@@ -395,7 +393,7 @@ static void storvsc_commmand_completion(struct hv_storvsc_request *request)
 	/* !!DO NOT MODIFY the scmnd after this call */
 	scsi_done_fn(scmnd);
 
-	kmem_cache_free(host_device_ctx->request_pool, cmd_request);
+	kmem_cache_free(host_hyperv_dev->request_pool, cmd_request);
 }
 
 static int do_bounce_buffer(struct scatterlist *sgl, unsigned int sg_count)
@@ -599,15 +597,15 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
 				void (*done)(struct scsi_cmnd *))
 {
 	int ret;
-	struct host_device_context *host_device_ctx =
+	struct host_device_context *host_hyperv_dev =
 		(struct host_device_context *)scmnd->device->host->hostdata;
-	struct vm_device *device_ctx = host_device_ctx->device_ctx;
-	struct driver_context *driver_ctx =
-		driver_to_driver_context(device_ctx->device.driver);
-	struct storvsc_driver_context *storvsc_drv_ctx =
-		(struct storvsc_driver_context *)driver_ctx;
+	struct hyperv_device *hyperv_dev = host_hyperv_dev->hyperv_dev;
+	struct hyperv_driver *drv =
+		driver_to_hyperv_driver(hyperv_dev->device.driver);
+	struct storvsc_hyperv_driver *storvsc_drv =
+		(struct storvsc_hyperv_driver *)drv;
 	struct storvsc_driver_object *storvsc_drv_obj =
-		&storvsc_drv_ctx->drv_obj;
+		&storvsc_drv->drv_obj;
 	struct hv_storvsc_request *request;
 	struct storvsc_cmd_request *cmd_request;
 	unsigned int request_size = 0;
@@ -640,7 +638,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
 
 	request_size = sizeof(struct storvsc_cmd_request);
 
-	cmd_request = kmem_cache_alloc(host_device_ctx->request_pool,
+	cmd_request = kmem_cache_alloc(host_hyperv_dev->request_pool,
 				       GFP_ATOMIC);
 	if (!cmd_request) {
 		DPRINT_ERR(STORVSC_DRV, "scmnd (%p) - unable to allocate "
@@ -680,7 +678,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
 	request->context = cmd_request;/* scmnd; */
 
 	/* request->PortId = scmnd->device->channel; */
-	request->host = host_device_ctx->port;
+	request->host = host_hyperv_dev->port;
 	request->bus = scmnd->device->channel;
 	request->target_id = scmnd->device->id;
 	request->lun_id = scmnd->device->lun;
@@ -713,7 +711,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
 
 				scmnd->scsi_done = NULL;
 				scmnd->host_scribble = NULL;
-				kmem_cache_free(host_device_ctx->request_pool,
+				kmem_cache_free(host_hyperv_dev->request_pool,
 						cmd_request);
 
 				return SCSI_MLQUEUE_HOST_BUSY;
@@ -752,7 +750,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
 
 retry_request:
 	/* Invokes the vsc to start an IO */
-	ret = storvsc_drv_obj->on_io_request(&device_ctx->device_obj,
+	ret = storvsc_drv_obj->on_io_request(hyperv_dev,
 					   &cmd_request->request);
 	if (ret == -1) {
 		/* no more space */
@@ -772,7 +770,7 @@ retry_request:
 					      cmd_request->bounce_sgl_count);
 		}
 
-		kmem_cache_free(host_device_ctx->request_pool, cmd_request);
+		kmem_cache_free(host_hyperv_dev->request_pool, cmd_request);
 
 		scmnd->scsi_done = NULL;
 		scmnd->host_scribble = NULL;
@@ -837,20 +835,20 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
 static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
 {
 	int ret;
-	struct host_device_context *host_device_ctx =
+	struct host_device_context *host_hyperv_dev =
 		(struct host_device_context *)scmnd->device->host->hostdata;
-	struct vm_device *device_ctx = host_device_ctx->device_ctx;
+	struct hyperv_device *hyperv_dev = host_hyperv_dev->hyperv_dev;
 
 	DPRINT_INFO(STORVSC_DRV, "sdev (%p) dev obj (%p) - host resetting...",
-		    scmnd->device, &device_ctx->device_obj);
+		    scmnd->device, hyperv_dev);
 
 	/* Invokes the vsc to reset the host/bus */
-	ret = stor_vsc_on_host_reset(&device_ctx->device_obj);
+	ret = stor_vsc_on_host_reset(hyperv_dev);
 	if (ret != 0)
 		return ret;
 
 	DPRINT_INFO(STORVSC_DRV, "sdev (%p) dev obj (%p) - host reseted",
-		    scmnd->device, &device_ctx->device_obj);
+		    scmnd->device, hyperv_dev);
 
 	return ret;
 }
diff --git a/drivers/staging/hv/vmbus.h b/drivers/staging/hv/vmbus.h
index 42f2adb..638bb9f 100644
--- a/drivers/staging/hv/vmbus.h
+++ b/drivers/staging/hv/vmbus.h
@@ -28,9 +28,17 @@
 #include <linux/device.h>
 #include "vmbus_api.h"
 
-struct driver_context {
+struct hyperv_driver {
+	const char *name;
+
 	struct hv_guid class_id;
 
+	int (*dev_add)(struct hyperv_device *device, void *data);
+
+	int (*dev_rm)(struct hyperv_device *device);
+
+	void (*cleanup)(struct hyperv_driver *driver);
+
 	struct device_driver driver;
 
 	/*
@@ -43,34 +51,34 @@ struct driver_context {
 	void (*shutdown)(struct device *);
 };
 
-struct vm_device {
+struct hyperv_device {
+	char name[64];
 	struct work_struct probe_failed_work_item;
-	struct hv_guid class_id;
-	struct hv_guid device_id;
+	struct hv_guid class_id; /* device type id */
+	struct hv_guid device_id; /* device class id */
+	struct hyperv_driver *drv;
 	int probe_error;
-	struct hv_device device_obj;
+	struct vmbus_channel *channel; /* associated channel to host*/
+	void	*ext;
 	struct device device;
 };
 
-static inline struct vm_device *to_vm_device(struct hv_device *d)
-{
-	return container_of(d, struct vm_device, device_obj);
-}
 
-static inline struct vm_device *device_to_vm_device(struct device *d)
+static inline struct hyperv_device *device_to_hyperv_device(struct device *d)
 {
-	return container_of(d, struct vm_device, device);
+	return container_of(d, struct hyperv_device, device);
 }
 
-static inline struct driver_context *driver_to_driver_context(struct device_driver *d)
+static inline struct hyperv_driver *
+driver_to_hyperv_driver(struct device_driver *d)
 {
-	return container_of(d, struct driver_context, driver);
+	return container_of(d, struct hyperv_driver, driver);
 }
 
 
 /* Vmbus interface */
-int vmbus_child_driver_register(struct driver_context *driver_ctx);
-void vmbus_child_driver_unregister(struct driver_context *driver_ctx);
+int vmbus_child_driver_register(struct hyperv_driver *drv);
+void vmbus_child_driver_unregister(struct hyperv_driver *drv);
 
 extern struct completion hv_channel_ready;
 
diff --git a/drivers/staging/hv/vmbus_api.h b/drivers/staging/hv/vmbus_api.h
index 635ce22..6e3e1a8 100644
--- a/drivers/staging/hv/vmbus_api.h
+++ b/drivers/staging/hv/vmbus_api.h
@@ -55,8 +55,8 @@ struct hv_multipage_buffer {
 
 #pragma pack(pop)
 
-struct hv_driver;
-struct hv_device;
+struct hyperv_driver;
+struct hyperv_device;
 
 struct hv_dev_port_info {
 	u32 int_mask;
@@ -66,7 +66,7 @@ struct hv_dev_port_info {
 	u32 bytes_avail_towrite;
 };
 
-struct hv_device_info {
+struct hyperv_device_info {
 	u32 chn_id;
 	u32 chn_state;
 	struct hv_guid chn_type;
@@ -84,35 +84,4 @@ struct hv_device_info {
 	struct hv_dev_port_info outbound;
 };
 
-/* Base driver object */
-struct hv_driver {
-	const char *name;
-
-	/* the device type supported by this driver */
-	struct hv_guid dev_type;
-
-	int (*dev_add)(struct hv_device *device, void *data);
-	int (*dev_rm)(struct hv_device *device);
-	void (*cleanup)(struct hv_driver *driver);
-};
-
-/* Base device object */
-struct hv_device {
-	/* the driver for this device */
-	struct hv_driver *drv;
-
-	char name[64];
-
-	/* the device type id of this device */
-	struct hv_guid dev_type;
-
-	/* the device instance id of this device */
-	struct hv_guid dev_instance;
-
-	struct vmbus_channel *channel;
-
-	/* Device extension; */
-	void *ext;
-};
-
 #endif /* _VMBUS_API_H_ */
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 459c707..81e958a 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -41,20 +41,19 @@
 #define VMBUS_IRQ_VECTOR	IRQ5_VECTOR
 
 /* Main vmbus driver data structure */
-struct vmbus_driver_context {
+struct vmbus_hyperv_driver {
 	/* !! These must be the first 2 fields !! */
 	/* FIXME, this is a bug */
 	/* The driver field is not used in here. Instead, the bus field is */
 	/* used to represent the driver */
-	struct driver_context drv_ctx;
-	struct hv_driver drv_obj;
+	struct hyperv_driver drv;
 
 	struct bus_type bus;
 	struct tasklet_struct msg_dpc;
 	struct tasklet_struct event_dpc;
 
 	/* The bus root device */
-	struct vm_device device_ctx;
+	struct hyperv_device hyperv_dev;
 };
 
 static int vmbus_match(struct device *device, struct device_driver *driver);
@@ -113,7 +112,7 @@ static struct device_attribute vmbus_device_attrs[] = {
 };
 
 /* The one and only one */
-static struct vmbus_driver_context vmbus_drv = {
+static struct vmbus_hyperv_driver g_vmbus_drv = {
 	.bus.name =		"vmbus",
 	.bus.match =		vmbus_match,
 	.bus.shutdown =		vmbus_shutdown,
@@ -145,12 +144,12 @@ static const struct hv_guid device_id = {
 	}
 };
 
-static struct hv_device *vmbus_device; /* vmbus root device */
+static struct hyperv_device *vmbus_device; /* vmbus root device */
 
 /*
  * vmbus_child_dev_add - Registers the child device with the vmbus
  */
-int vmbus_child_dev_add(struct hv_device *child_dev)
+int vmbus_child_dev_add(struct hyperv_device *child_dev)
 {
 	return vmbus_child_device_register(vmbus_device, child_dev);
 }
@@ -158,15 +157,15 @@ int vmbus_child_dev_add(struct hv_device *child_dev)
 /*
  * vmbus_dev_add - Callback when the root bus device is added
  */
-static int vmbus_dev_add(struct hv_device *dev, void *info)
+static int vmbus_dev_add(struct hyperv_device *dev, void *info)
 {
 	u32 *irqvector = info;
 	int ret;
 
 	vmbus_device = dev;
 
-	memcpy(&vmbus_device->dev_type, &device_type, sizeof(struct hv_guid));
-	memcpy(&vmbus_device->dev_instance, &device_id,
+	memcpy(&vmbus_device->class_id, &device_type, sizeof(struct hv_guid));
+	memcpy(&vmbus_device->device_id, &device_id,
 	       sizeof(struct hv_guid));
 
 	/* strcpy(dev->name, "vmbus"); */
@@ -183,7 +182,7 @@ static int vmbus_dev_add(struct hv_device *dev, void *info)
 /*
  * vmbus_dev_rm - Callback when the root bus device is removed
  */
-static int vmbus_dev_rm(struct hv_device *dev)
+static int vmbus_dev_rm(struct hyperv_device *dev)
 {
 	int ret = 0;
 
@@ -196,7 +195,7 @@ static int vmbus_dev_rm(struct hv_device *dev)
 /*
  * vmbus_cleanup - Perform any cleanup when the driver is removed
  */
-static void vmbus_cleanup(struct hv_driver *drv)
+static void vmbus_cleanup(struct hyperv_driver *drv)
 {
 	/* struct vmbus_driver *driver = (struct vmbus_driver *)drv; */
 
@@ -221,7 +220,7 @@ static void vmbus_onmessage_work(struct work_struct *work)
 /*
  * vmbus_on_msg_dpc - DPC routine to handle messages from the hypervisior
  */
-static void vmbus_on_msg_dpc(struct hv_driver *drv)
+static void vmbus_on_msg_dpc(struct hyperv_driver *drv)
 {
 	int cpu = smp_processor_id();
 	void *page_addr = hv_context.synic_message_page[cpu];
@@ -267,7 +266,7 @@ static void vmbus_on_msg_dpc(struct hv_driver *drv)
 /*
  * vmbus_on_isr - ISR routine
  */
-static int vmbus_on_isr(struct hv_driver *drv)
+static int vmbus_on_isr(struct hyperv_driver *drv)
 {
 	int ret = 0;
 	int cpu = smp_processor_id();
@@ -299,8 +298,8 @@ static int vmbus_on_isr(struct hv_driver *drv)
 	return ret;
 }
 
-static void get_channel_info(struct hv_device *device,
-			     struct hv_device_info *info)
+static void get_channel_info(struct hyperv_device *device,
+			     struct hyperv_device_info *info)
 {
 	struct vmbus_channel_debug_info debug_info;
 
@@ -354,12 +353,12 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
 				      struct device_attribute *dev_attr,
 				      char *buf)
 {
-	struct vm_device *device_ctx = device_to_vm_device(dev);
-	struct hv_device_info device_info;
+	struct hyperv_device *hyperv_dev = device_to_hyperv_device(dev);
+	struct hyperv_device_info device_info;
 
-	memset(&device_info, 0, sizeof(struct hv_device_info));
+	memset(&device_info, 0, sizeof(struct hyperv_device_info));
 
-	get_channel_info(&device_ctx->device_obj, &device_info);
+	get_channel_info(hyperv_dev, &device_info);
 
 	if (!strcmp(dev_attr->attr.name, "class_id")) {
 		return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
@@ -462,9 +461,9 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
  */
 static int vmbus_bus_init(void)
 {
-	struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
-	struct hv_driver *driver = &vmbus_drv.drv_obj;
-	struct vm_device *dev_ctx = &vmbus_drv.device_ctx;
+	struct vmbus_hyperv_driver *vmb_drv = &g_vmbus_drv;
+	struct hyperv_driver *hv_drv = &g_vmbus_drv.drv;
+	struct hyperv_device *hv_dev = &g_vmbus_drv.hyperv_dev;
 	int ret;
 	unsigned int vector;
 
@@ -479,13 +478,13 @@ static int vmbus_bus_init(void)
 			sizeof(struct vmbus_channel_packet_page_buffer),
 			sizeof(struct vmbus_channel_packet_multipage_buffer));
 
-	driver->name = driver_name;
-	memcpy(&driver->dev_type, &device_type, sizeof(struct hv_guid));
+	hv_drv->name = driver_name;
+	memcpy(&hv_drv->class_id, &device_type, sizeof(struct hv_guid));
 
 	/* Setup dispatch table */
-	driver->dev_add	= vmbus_dev_add;
-	driver->dev_rm	= vmbus_dev_rm;
-	driver->cleanup	= vmbus_cleanup;
+	hv_drv->dev_add	= vmbus_dev_add;
+	hv_drv->dev_rm	= vmbus_dev_rm;
+	hv_drv->cleanup	= vmbus_cleanup;
 
 	/* Hypervisor initialization...setup hypercall page..etc */
 	ret = hv_init();
@@ -495,23 +494,17 @@ static int vmbus_bus_init(void)
 		goto cleanup;
 	}
 
-	/* Sanity checks */
-	if (!driver->dev_add) {
-		DPRINT_ERR(VMBUS_DRV, "OnDeviceAdd() routine not set");
-		ret = -1;
-		goto cleanup;
-	}
 
-	vmbus_drv_ctx->bus.name = driver->name;
+	vmb_drv->bus.name = hv_drv->name;
 
 	/* Initialize the bus context */
-	tasklet_init(&vmbus_drv_ctx->msg_dpc, vmbus_msg_dpc,
-		     (unsigned long)driver);
-	tasklet_init(&vmbus_drv_ctx->event_dpc, vmbus_event_dpc,
-		     (unsigned long)driver);
+	tasklet_init(&vmb_drv->msg_dpc, vmbus_msg_dpc,
+		     (unsigned long)hv_drv);
+	tasklet_init(&vmb_drv->event_dpc, vmbus_event_dpc,
+		     (unsigned long)hv_drv);
 
 	/* Now, register the bus driver with LDM */
-	ret = bus_register(&vmbus_drv_ctx->bus);
+	ret = bus_register(&vmb_drv->bus);
 	if (ret) {
 		ret = -1;
 		goto cleanup;
@@ -519,13 +512,13 @@ static int vmbus_bus_init(void)
 
 	/* Get the interrupt resource */
 	ret = request_irq(vmbus_irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
-			  driver->name, NULL);
+			  hv_drv->name, NULL);
 
 	if (ret != 0) {
 		DPRINT_ERR(VMBUS_DRV, "ERROR - Unable to request IRQ %d",
 			   vmbus_irq);
 
-		bus_unregister(&vmbus_drv_ctx->bus);
+		bus_unregister(&vmb_drv->bus);
 
 		ret = -1;
 		goto cleanup;
@@ -535,43 +528,38 @@ static int vmbus_bus_init(void)
 	DPRINT_INFO(VMBUS_DRV, "irq 0x%x vector 0x%x", vmbus_irq, vector);
 
 	/* Call to bus driver to add the root device */
-	memset(dev_ctx, 0, sizeof(struct vm_device));
+	memset(hv_dev, 0, sizeof(struct hyperv_device));
 
-	ret = driver->dev_add(&dev_ctx->device_obj, &vector);
+	ret = hv_drv->dev_add(hv_dev, &vector);
 	if (ret != 0) {
 		DPRINT_ERR(VMBUS_DRV,
 			   "ERROR - Unable to add vmbus root device");
 
 		free_irq(vmbus_irq, NULL);
 
-		bus_unregister(&vmbus_drv_ctx->bus);
+		bus_unregister(&vmb_drv->bus);
 
 		ret = -1;
 		goto cleanup;
 	}
-	/* strcpy(dev_ctx->device.bus_id, dev_ctx->device_obj.name); */
-	dev_set_name(&dev_ctx->device, "vmbus_0_0");
-	memcpy(&dev_ctx->class_id, &dev_ctx->device_obj.dev_type,
-		sizeof(struct hv_guid));
-	memcpy(&dev_ctx->device_id, &dev_ctx->device_obj.dev_instance,
-		sizeof(struct hv_guid));
+	dev_set_name(&hv_dev->device, "vmbus_0_0");
 
 	/* No need to bind a driver to the root device. */
-	dev_ctx->device.parent = NULL;
+	hv_dev->device.parent = NULL;
 	/* NULL; vmbus_remove() does not get invoked */
-	dev_ctx->device.bus = &vmbus_drv_ctx->bus;
+	hv_dev->device.bus = &vmb_drv->bus;
 
 	/* Setup the device dispatch table */
-	dev_ctx->device.release = vmbus_bus_release;
+	hv_dev->device.release = vmbus_bus_release;
 
 	/* Setup the bus as root device */
-	ret = device_register(&dev_ctx->device);
+	ret = device_register(&hv_dev->device);
 	if (ret) {
 		DPRINT_ERR(VMBUS_DRV,
 			   "ERROR - Unable to register vmbus root device");
 
 		free_irq(vmbus_irq, NULL);
-		bus_unregister(&vmbus_drv_ctx->bus);
+		bus_unregister(&vmb_drv->bus);
 
 		ret = -1;
 		goto cleanup;
@@ -591,35 +579,35 @@ cleanup:
  */
 static void vmbus_bus_exit(void)
 {
-	struct hv_driver *driver = &vmbus_drv.drv_obj;
-	struct vmbus_driver_context *vmbus_drv_ctx = &vmbus_drv;
+	struct hyperv_driver *hv_drv = &g_vmbus_drv.drv;
+	struct vmbus_hyperv_driver *vmb_drv = &g_vmbus_drv;
 
-	struct vm_device *dev_ctx = &vmbus_drv.device_ctx;
+	struct hyperv_device *hv_dev = &g_vmbus_drv.hyperv_dev;
 
 	/* Remove the root device */
-	if (driver->dev_rm)
-		driver->dev_rm(&dev_ctx->device_obj);
+	if (hv_drv->dev_rm)
+		hv_drv->dev_rm(hv_dev);
 
-	if (driver->cleanup)
-		driver->cleanup(driver);
+	if (hv_drv->cleanup)
+		hv_drv->cleanup(hv_drv);
 
 	/* Unregister the root bus device */
-	device_unregister(&dev_ctx->device);
+	device_unregister(&hv_dev->device);
 
-	bus_unregister(&vmbus_drv_ctx->bus);
+	bus_unregister(&vmb_drv->bus);
 
 	free_irq(vmbus_irq, NULL);
 
-	tasklet_kill(&vmbus_drv_ctx->msg_dpc);
-	tasklet_kill(&vmbus_drv_ctx->event_dpc);
+	tasklet_kill(&vmb_drv->msg_dpc);
+	tasklet_kill(&vmb_drv->event_dpc);
 }
 
 
 /**
  * vmbus_child_driver_register() - Register a vmbus's child driver
- * @driver_ctx:        Pointer to driver structure you want to register
+ * @drv:        Pointer to driver structure you want to register
  *
- * @driver_ctx is of type &struct driver_context
+ * @drv is of type &struct hyperv_driver
  *
  * Registers the given driver with Linux through the 'driver_register()' call
  * And sets up the hyper-v vmbus handling for this driver.
@@ -627,17 +615,17 @@ static void vmbus_bus_exit(void)
  *
  * Mainly used by Hyper-V drivers.
  */
-int vmbus_child_driver_register(struct driver_context *driver_ctx)
+int vmbus_child_driver_register(struct hyperv_driver *drv)
 {
 	int ret;
 
 	DPRINT_INFO(VMBUS_DRV, "child driver (%p) registering - name %s",
-		    driver_ctx, driver_ctx->driver.name);
+		    drv, drv->driver.name);
 
 	/* The child driver on this vmbus */
-	driver_ctx->driver.bus = &vmbus_drv.bus;
+	drv->driver.bus = &g_vmbus_drv.bus;
 
-	ret = driver_register(&driver_ctx->driver);
+	ret = driver_register(&drv->driver);
 
 	vmbus_request_offers();
 
@@ -647,23 +635,23 @@ EXPORT_SYMBOL(vmbus_child_driver_register);
 
 /**
  * vmbus_child_driver_unregister() - Unregister a vmbus's child driver
- * @driver_ctx:        Pointer to driver structure you want to un-register
+ * @drv:        Pointer to driver structure you want to un-register
  *
- * @driver_ctx is of type &struct driver_context
+ * @drv is of type &struct hyperv_driver
  *
  * Un-register the given driver with Linux through the 'driver_unregister()'
  * call. And ungegisters the driver from the Hyper-V vmbus handler.
  *
  * Mainly used by Hyper-V drivers.
  */
-void vmbus_child_driver_unregister(struct driver_context *driver_ctx)
+void vmbus_child_driver_unregister(struct hyperv_driver *drv)
 {
 	DPRINT_INFO(VMBUS_DRV, "child driver (%p) unregistering - name %s",
-		    driver_ctx, driver_ctx->driver.name);
+		    drv, drv->driver.name);
 
-	driver_unregister(&driver_ctx->driver);
+	driver_unregister(&drv->driver);
 
-	driver_ctx->driver.bus = NULL;
+	drv->driver.bus = NULL;
 }
 EXPORT_SYMBOL(vmbus_child_driver_unregister);
 
@@ -671,16 +659,15 @@ EXPORT_SYMBOL(vmbus_child_driver_unregister);
  * vmbus_child_device_create - Creates and registers a new child device
  * on the vmbus.
  */
-struct hv_device *vmbus_child_device_create(struct hv_guid *type,
+struct hyperv_device *vmbus_child_device_create(struct hv_guid *type,
 					    struct hv_guid *instance,
 					    struct vmbus_channel *channel)
 {
-	struct vm_device *child_device_ctx;
-	struct hv_device *child_device_obj;
+	struct hyperv_device *child_hyperv_dev;
 
 	/* Allocate the new child device */
-	child_device_ctx = kzalloc(sizeof(struct vm_device), GFP_KERNEL);
-	if (!child_device_ctx) {
+	child_hyperv_dev = kzalloc(sizeof(struct hyperv_device), GFP_KERNEL);
+	if (!child_hyperv_dev) {
 		DPRINT_ERR(VMBUS_DRV,
 			"unable to allocate device_context for child device");
 		return NULL;
@@ -691,7 +678,7 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
 		"%02x%02x%02x%02x%02x%02x%02x%02x},"
 		"id {%02x%02x%02x%02x-%02x%02x-%02x%02x-"
 		"%02x%02x%02x%02x%02x%02x%02x%02x}",
-		&child_device_ctx->device,
+		&child_hyperv_dev->device,
 		type->data[3], type->data[2], type->data[1], type->data[0],
 		type->data[5], type->data[4], type->data[7], type->data[6],
 		type->data[8], type->data[9], type->data[10], type->data[11],
@@ -705,58 +692,50 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
 		instance->data[12], instance->data[13],
 		instance->data[14], instance->data[15]);
 
-	child_device_obj = &child_device_ctx->device_obj;
-	child_device_obj->channel = channel;
-	memcpy(&child_device_obj->dev_type, type, sizeof(struct hv_guid));
-	memcpy(&child_device_obj->dev_instance, instance,
-	       sizeof(struct hv_guid));
+	child_hyperv_dev->channel = channel;
 
-	memcpy(&child_device_ctx->class_id, type, sizeof(struct hv_guid));
-	memcpy(&child_device_ctx->device_id, instance, sizeof(struct hv_guid));
+	memcpy(&child_hyperv_dev->class_id, type, sizeof(struct hv_guid));
+	memcpy(&child_hyperv_dev->device_id, instance, sizeof(struct hv_guid));
 
-	return child_device_obj;
+	return child_hyperv_dev;
 }
 
 /*
  * vmbus_child_device_register - Register the child device on the specified bus
  */
-int vmbus_child_device_register(struct hv_device *root_device_obj,
-				struct hv_device *child_device_obj)
+int vmbus_child_device_register(struct hyperv_device *root_hyperv_dev,
+				struct hyperv_device *child_hyperv_dev)
 {
 	int ret = 0;
-	struct vm_device *root_device_ctx =
-				to_vm_device(root_device_obj);
-	struct vm_device *child_device_ctx =
-				to_vm_device(child_device_obj);
 	static atomic_t device_num = ATOMIC_INIT(0);
 
 	DPRINT_DBG(VMBUS_DRV, "child device (%p) registering",
-		   child_device_ctx);
+		   child_hyperv_dev);
 
 	/* Set the device name. Otherwise, device_register() will fail. */
-	dev_set_name(&child_device_ctx->device, "vmbus_0_%d",
+	dev_set_name(&child_hyperv_dev->device, "vmbus_0_%d",
 		     atomic_inc_return(&device_num));
 
 	/* The new device belongs to this bus */
-	child_device_ctx->device.bus = &vmbus_drv.bus; /* device->dev.bus; */
-	child_device_ctx->device.parent = &root_device_ctx->device;
-	child_device_ctx->device.release = vmbus_device_release;
+	child_hyperv_dev->device.bus = &g_vmbus_drv.bus; /* device->dev.bus; */
+	child_hyperv_dev->device.parent = &root_hyperv_dev->device;
+	child_hyperv_dev->device.release = vmbus_device_release;
 
 	/*
 	 * Register with the LDM. This will kick off the driver/device
 	 * binding...which will eventually call vmbus_match() and vmbus_probe()
 	 */
-	ret = device_register(&child_device_ctx->device);
+	ret = device_register(&child_hyperv_dev->device);
 
 	/* vmbus_probe() error does not get propergate to device_register(). */
-	ret = child_device_ctx->probe_error;
+	ret = child_hyperv_dev->probe_error;
 
 	if (ret)
 		DPRINT_ERR(VMBUS_DRV, "unable to register child device (%p)",
-			   &child_device_ctx->device);
+			   &child_hyperv_dev->device);
 	else
 		DPRINT_INFO(VMBUS_DRV, "child device (%p) registered",
-			    &child_device_ctx->device);
+			    &child_hyperv_dev->device);
 
 	return ret;
 }
@@ -765,21 +744,20 @@ int vmbus_child_device_register(struct hv_device *root_device_obj,
  * vmbus_child_device_unregister - Remove the specified child device
  * from the vmbus.
  */
-void vmbus_child_device_unregister(struct hv_device *device_obj)
+void vmbus_child_device_unregister(struct hyperv_device *hyperv_dev)
 {
-	struct vm_device *device_ctx = to_vm_device(device_obj);
 
 	DPRINT_INFO(VMBUS_DRV, "unregistering child device (%p)",
-		    &device_ctx->device);
+		    &hyperv_dev->device);
 
 	/*
 	 * Kick off the process of unregistering the device.
 	 * This will call vmbus_remove() and eventually vmbus_device_release()
 	 */
-	device_unregister(&device_ctx->device);
+	device_unregister(&hyperv_dev->device);
 
 	DPRINT_INFO(VMBUS_DRV, "child device (%p) unregistered",
-		    &device_ctx->device);
+		    &hyperv_dev->device);
 }
 
 /*
@@ -791,43 +769,43 @@ void vmbus_child_device_unregister(struct hv_device *device_obj)
  */
 static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
 {
-	struct vm_device *device_ctx = device_to_vm_device(device);
+	struct hyperv_device *hyperv_dev = device_to_hyperv_device(device);
 	int ret;
 
 	DPRINT_INFO(VMBUS_DRV, "generating uevent - VMBUS_DEVICE_CLASS_GUID={"
 		    "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
 		    "%02x%02x%02x%02x%02x%02x%02x%02x}",
-		    device_ctx->class_id.data[3], device_ctx->class_id.data[2],
-		    device_ctx->class_id.data[1], device_ctx->class_id.data[0],
-		    device_ctx->class_id.data[5], device_ctx->class_id.data[4],
-		    device_ctx->class_id.data[7], device_ctx->class_id.data[6],
-		    device_ctx->class_id.data[8], device_ctx->class_id.data[9],
-		    device_ctx->class_id.data[10],
-		    device_ctx->class_id.data[11],
-		    device_ctx->class_id.data[12],
-		    device_ctx->class_id.data[13],
-		    device_ctx->class_id.data[14],
-		    device_ctx->class_id.data[15]);
+		    hyperv_dev->class_id.data[3], hyperv_dev->class_id.data[2],
+		    hyperv_dev->class_id.data[1], hyperv_dev->class_id.data[0],
+		    hyperv_dev->class_id.data[5], hyperv_dev->class_id.data[4],
+		    hyperv_dev->class_id.data[7], hyperv_dev->class_id.data[6],
+		    hyperv_dev->class_id.data[8], hyperv_dev->class_id.data[9],
+		    hyperv_dev->class_id.data[10],
+		    hyperv_dev->class_id.data[11],
+		    hyperv_dev->class_id.data[12],
+		    hyperv_dev->class_id.data[13],
+		    hyperv_dev->class_id.data[14],
+		    hyperv_dev->class_id.data[15]);
 
 	ret = add_uevent_var(env, "VMBUS_DEVICE_CLASS_GUID={"
 			     "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
 			     "%02x%02x%02x%02x%02x%02x%02x%02x}",
-			     device_ctx->class_id.data[3],
-			     device_ctx->class_id.data[2],
-			     device_ctx->class_id.data[1],
-			     device_ctx->class_id.data[0],
-			     device_ctx->class_id.data[5],
-			     device_ctx->class_id.data[4],
-			     device_ctx->class_id.data[7],
-			     device_ctx->class_id.data[6],
-			     device_ctx->class_id.data[8],
-			     device_ctx->class_id.data[9],
-			     device_ctx->class_id.data[10],
-			     device_ctx->class_id.data[11],
-			     device_ctx->class_id.data[12],
-			     device_ctx->class_id.data[13],
-			     device_ctx->class_id.data[14],
-			     device_ctx->class_id.data[15]);
+			     hyperv_dev->class_id.data[3],
+			     hyperv_dev->class_id.data[2],
+			     hyperv_dev->class_id.data[1],
+			     hyperv_dev->class_id.data[0],
+			     hyperv_dev->class_id.data[5],
+			     hyperv_dev->class_id.data[4],
+			     hyperv_dev->class_id.data[7],
+			     hyperv_dev->class_id.data[6],
+			     hyperv_dev->class_id.data[8],
+			     hyperv_dev->class_id.data[9],
+			     hyperv_dev->class_id.data[10],
+			     hyperv_dev->class_id.data[11],
+			     hyperv_dev->class_id.data[12],
+			     hyperv_dev->class_id.data[13],
+			     hyperv_dev->class_id.data[14],
+			     hyperv_dev->class_id.data[15]);
 
 	if (ret)
 		return ret;
@@ -835,22 +813,22 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
 	ret = add_uevent_var(env, "VMBUS_DEVICE_DEVICE_GUID={"
 			     "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
 			     "%02x%02x%02x%02x%02x%02x%02x%02x}",
-			     device_ctx->device_id.data[3],
-			     device_ctx->device_id.data[2],
-			     device_ctx->device_id.data[1],
-			     device_ctx->device_id.data[0],
-			     device_ctx->device_id.data[5],
-			     device_ctx->device_id.data[4],
-			     device_ctx->device_id.data[7],
-			     device_ctx->device_id.data[6],
-			     device_ctx->device_id.data[8],
-			     device_ctx->device_id.data[9],
-			     device_ctx->device_id.data[10],
-			     device_ctx->device_id.data[11],
-			     device_ctx->device_id.data[12],
-			     device_ctx->device_id.data[13],
-			     device_ctx->device_id.data[14],
-			     device_ctx->device_id.data[15]);
+			     hyperv_dev->device_id.data[3],
+			     hyperv_dev->device_id.data[2],
+			     hyperv_dev->device_id.data[1],
+			     hyperv_dev->device_id.data[0],
+			     hyperv_dev->device_id.data[5],
+			     hyperv_dev->device_id.data[4],
+			     hyperv_dev->device_id.data[7],
+			     hyperv_dev->device_id.data[6],
+			     hyperv_dev->device_id.data[8],
+			     hyperv_dev->device_id.data[9],
+			     hyperv_dev->device_id.data[10],
+			     hyperv_dev->device_id.data[11],
+			     hyperv_dev->device_id.data[12],
+			     hyperv_dev->device_id.data[13],
+			     hyperv_dev->device_id.data[14],
+			     hyperv_dev->device_id.data[15]);
 	if (ret)
 		return ret;
 
@@ -863,24 +841,24 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
 static int vmbus_match(struct device *device, struct device_driver *driver)
 {
 	int match = 0;
-	struct driver_context *driver_ctx = driver_to_driver_context(driver);
-	struct vm_device *device_ctx = device_to_vm_device(device);
+	struct hyperv_driver *drv = driver_to_hyperv_driver(driver);
+	struct hyperv_device *hyperv_dev = device_to_hyperv_device(device);
 
 	/* We found our driver ? */
-	if (memcmp(&device_ctx->class_id, &driver_ctx->class_id,
+	if (memcmp(&hyperv_dev->class_id, &drv->class_id,
 		   sizeof(struct hv_guid)) == 0) {
 		/*
-		 * !! NOTE: The driver_ctx is not a vmbus_drv_ctx. We typecast
-		 * it here to access the struct hv_driver field
+		 * !! NOTE: The drv is not a vmbus_drv. We typecast
+		 * it here to access the struct hyperv_driver field
 		 */
-		struct vmbus_driver_context *vmbus_drv_ctx =
-			(struct vmbus_driver_context *)driver_ctx;
+		struct vmbus_hyperv_driver *vmbus_drv =
+			(struct vmbus_hyperv_driver *)drv;
 
-		device_ctx->device_obj.drv = &vmbus_drv_ctx->drv_obj;
+		hyperv_dev->drv = &vmbus_drv->drv;
 		DPRINT_INFO(VMBUS_DRV,
 			    "device object (%p) set to driver object (%p)",
-			    &device_ctx->device_obj,
-			    device_ctx->device_obj.drv);
+			    hyperv_dev,
+			    hyperv_dev->drv);
 
 		match = 1;
 	}
@@ -896,15 +874,15 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
  */
 static void vmbus_probe_failed_cb(struct work_struct *context)
 {
-	struct vm_device *device_ctx = (struct vm_device *)context;
+	struct hyperv_device *hyperv_dev = (struct hyperv_device *)context;
 
 	/*
 	 * Kick off the process of unregistering the device.
 	 * This will call vmbus_remove() and eventually vmbus_device_release()
 	 */
-	device_unregister(&device_ctx->device);
+	device_unregister(&hyperv_dev->device);
 
-	/* put_device(&device_ctx->device); */
+	/* put_device(&hyperv_dev->device); */
 }
 
 /*
@@ -913,23 +891,23 @@ static void vmbus_probe_failed_cb(struct work_struct *context)
 static int vmbus_probe(struct device *child_device)
 {
 	int ret = 0;
-	struct driver_context *driver_ctx =
-			driver_to_driver_context(child_device->driver);
-	struct vm_device *device_ctx =
-			device_to_vm_device(child_device);
+	struct hyperv_driver *drv =
+			driver_to_hyperv_driver(child_device->driver);
+	struct hyperv_device *hyperv_dev =
+			device_to_hyperv_device(child_device);
 
 	/* Let the specific open-source driver handles the probe if it can */
-	if (driver_ctx->probe) {
-		ret = device_ctx->probe_error = driver_ctx->probe(child_device);
+	if (drv->probe) {
+		ret = hyperv_dev->probe_error = drv->probe(child_device);
 		if (ret != 0) {
 			DPRINT_ERR(VMBUS_DRV, "probe() failed for device %s "
 				   "(%p) on driver %s (%d)...",
 				   dev_name(child_device), child_device,
 				   child_device->driver->name, ret);
 
-			INIT_WORK(&device_ctx->probe_failed_work_item,
+			INIT_WORK(&hyperv_dev->probe_failed_work_item,
 				  vmbus_probe_failed_cb);
-			schedule_work(&device_ctx->probe_failed_work_item);
+			schedule_work(&hyperv_dev->probe_failed_work_item);
 		}
 	} else {
 		DPRINT_ERR(VMBUS_DRV, "probe() method not set for driver - %s",
@@ -945,7 +923,7 @@ static int vmbus_probe(struct device *child_device)
 static int vmbus_remove(struct device *child_device)
 {
 	int ret;
-	struct driver_context *driver_ctx;
+	struct hyperv_driver *drv;
 
 	/* Special case root bus device */
 	if (child_device->parent == NULL) {
@@ -957,14 +935,14 @@ static int vmbus_remove(struct device *child_device)
 	}
 
 	if (child_device->driver) {
-		driver_ctx = driver_to_driver_context(child_device->driver);
+		drv = driver_to_hyperv_driver(child_device->driver);
 
 		/*
 		 * Let the specific open-source driver handles the removal if
 		 * it can
 		 */
-		if (driver_ctx->remove) {
-			ret = driver_ctx->remove(child_device);
+		if (drv->remove) {
+			ret = drv->remove(child_device);
 		} else {
 			DPRINT_ERR(VMBUS_DRV,
 				   "remove() method not set for driver - %s",
@@ -981,7 +959,7 @@ static int vmbus_remove(struct device *child_device)
  */
 static void vmbus_shutdown(struct device *child_device)
 {
-	struct driver_context *driver_ctx;
+	struct hyperv_driver *drv;
 
 	/* Special case root bus device */
 	if (child_device->parent == NULL) {
@@ -996,11 +974,11 @@ static void vmbus_shutdown(struct device *child_device)
 	if (!child_device->driver)
 		return;
 
-	driver_ctx = driver_to_driver_context(child_device->driver);
+	drv = driver_to_hyperv_driver(child_device->driver);
 
 	/* Let the specific open-source driver handles the removal if it can */
-	if (driver_ctx->shutdown)
-		driver_ctx->shutdown(child_device);
+	if (drv->shutdown)
+		drv->shutdown(child_device);
 
 	return;
 }
@@ -1022,11 +1000,11 @@ static void vmbus_bus_release(struct device *device)
  */
 static void vmbus_device_release(struct device *device)
 {
-	struct vm_device *device_ctx = device_to_vm_device(device);
+	struct hyperv_device *hyperv_dev = device_to_hyperv_device(device);
 
-	kfree(device_ctx);
+	kfree(hyperv_dev);
 
-	/* !!DO NOT REFERENCE device_ctx anymore at this point!! */
+	/* !!DO NOT REFERENCE hyperv_dev anymore at this point!! */
 }
 
 /*
@@ -1034,7 +1012,7 @@ static void vmbus_device_release(struct device *device)
  */
 static void vmbus_msg_dpc(unsigned long data)
 {
-	struct hv_driver *driver = (struct hv_driver *)data;
+	struct hyperv_driver *driver = (struct hyperv_driver *)data;
 
 	/* Call to bus driver to handle interrupt */
 	vmbus_on_msg_dpc(driver);
@@ -1051,7 +1029,7 @@ static void vmbus_event_dpc(unsigned long data)
 
 static irqreturn_t vmbus_isr(int irq, void *dev_id)
 {
-	struct hv_driver *driver = &vmbus_drv.drv_obj;
+	struct hyperv_driver *driver = &g_vmbus_drv.drv;
 	int ret;
 
 	/* Call to bus driver to handle interrupt */
@@ -1060,10 +1038,10 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id)
 	/* Schedules a dpc if necessary */
 	if (ret > 0) {
 		if (test_bit(0, (unsigned long *)&ret))
-			tasklet_schedule(&vmbus_drv.msg_dpc);
+			tasklet_schedule(&g_vmbus_drv.msg_dpc);
 
 		if (test_bit(1, (unsigned long *)&ret))
-			tasklet_schedule(&vmbus_drv.event_dpc);
+			tasklet_schedule(&g_vmbus_drv.event_dpc);
 
 		return IRQ_HANDLED;
 	} else {
diff --git a/drivers/staging/hv/vmbus_private.h b/drivers/staging/hv/vmbus_private.h
index 9f505c4..b272cc9 100644
--- a/drivers/staging/hv/vmbus_private.h
+++ b/drivers/staging/hv/vmbus_private.h
@@ -103,18 +103,15 @@ extern struct vmbus_connection vmbus_connection;
 
 /* General vmbus interface */
 
-struct hv_device *vmbus_child_device_create(struct hv_guid *type,
+struct hyperv_device *vmbus_child_device_create(struct hv_guid *type,
 					 struct hv_guid *instance,
 					 struct vmbus_channel *channel);
 
-int vmbus_child_dev_add(struct hv_device *device);
-int vmbus_child_device_register(struct hv_device *root_device_obj,
-				struct hv_device *child_device_obj);
-void vmbus_child_device_unregister(struct hv_device *device_obj);
+int vmbus_child_dev_add(struct hyperv_device *device);
+int vmbus_child_device_register(struct hyperv_device *root_device_obj,
+				struct hyperv_device *child_device_obj);
+void vmbus_child_device_unregister(struct hyperv_device *device_obj);
 
-/* static void */
-/* VmbusChildDeviceDestroy( */
-/* struct hv_device *); */
 
 struct vmbus_channel *relid2channel(u32 relid);
 
-- 
1.5.5.6

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux