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 */
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
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;
{
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;
{
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;
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;
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;