Commit d8de5dc6 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Eliminate netvsc_driver_context

With the consolidation of all driver state into one data structure;
netvsc_driver_context structure is not needed; get rid of it.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 680eeb15
......@@ -48,9 +48,6 @@ struct net_device_context {
unsigned long avail;
};
struct netvsc_driver_context {
struct netvsc_driver drv_obj;
};
#define PACKET_PAGES_LOWATER 8
/* Need this many pages to handle worst case fragmented packet */
......@@ -61,7 +58,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_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
......@@ -134,9 +131,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
struct net_device_context *net_device_ctx = netdev_priv(net);
struct hv_driver *drv =
drv_to_hv_drv(net_device_ctx->device_ctx->device.driver);
struct netvsc_driver_context *net_drv_ctx =
(struct netvsc_driver_context *)drv->priv;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
struct netvsc_driver *net_drv_obj = drv->priv;
struct hv_netvsc_packet *packet;
int ret;
unsigned int i, num_pages;
......@@ -339,9 +334,7 @@ static int netvsc_probe(struct device *device)
{
struct hv_driver *drv =
drv_to_hv_drv(device->driver);
struct netvsc_driver_context *net_drv_ctx =
(struct netvsc_driver_context *)drv->priv;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
struct netvsc_driver *net_drv_obj = drv->priv;
struct vm_device *device_ctx = device_to_vm_device(device);
struct hv_device *device_obj = &device_ctx->device_obj;
struct net_device *net = NULL;
......@@ -411,9 +404,7 @@ static int netvsc_remove(struct device *device)
{
struct hv_driver *drv =
drv_to_hv_drv(device->driver);
struct netvsc_driver_context *net_drv_ctx =
(struct netvsc_driver_context *)drv->priv;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
struct netvsc_driver *net_drv_obj = drv->priv;
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;
......@@ -458,8 +449,8 @@ 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 hv_driver *drv = &g_netvsc_drv.drv_obj.base;
struct netvsc_driver *netvsc_drv_obj = &g_netvsc_drv;
struct hv_driver *drv = &g_netvsc_drv.base;
struct device *current_dev;
int ret;
......@@ -493,8 +484,8 @@ static void netvsc_drv_exit(void)
static int netvsc_drv_init(int (*drv_init)(struct hv_driver *drv))
{
struct netvsc_driver *net_drv_obj = &g_netvsc_drv.drv_obj;
struct hv_driver *drv = &g_netvsc_drv.drv_obj.base;
struct netvsc_driver *net_drv_obj = &g_netvsc_drv;
struct hv_driver *drv = &g_netvsc_drv.base;
int ret;
net_drv_obj->ring_buf_size = ring_size * PAGE_SIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment