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

Staging: hv: netvsc_drv: Get the ring size information from struct netvsc_device_info

Get the ring size information from struct netvsc_device_info.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 78001df3
...@@ -1084,10 +1084,10 @@ int netvsc_device_add(struct hv_device *device, void *additional_info) ...@@ -1084,10 +1084,10 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
{ {
int ret = 0; int ret = 0;
int i; int i;
int ring_size =
((struct netvsc_device_info *)additional_info)->ring_size;
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct hv_netvsc_packet *packet, *pos; struct hv_netvsc_packet *packet, *pos;
struct netvsc_driver *net_driver =
drv_to_netvscdrv(device->device.driver);
net_device = alloc_net_device(device); net_device = alloc_net_device(device);
if (!net_device) { if (!net_device) {
...@@ -1116,8 +1116,8 @@ int netvsc_device_add(struct hv_device *device, void *additional_info) ...@@ -1116,8 +1116,8 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
init_completion(&net_device->channel_init_wait); init_completion(&net_device->channel_init_wait);
/* Open the channel */ /* Open the channel */
ret = vmbus_open(device->channel, net_driver->ring_buf_size, ret = vmbus_open(device->channel, ring_size * PAGE_SIZE,
net_driver->ring_buf_size, NULL, 0, ring_size * PAGE_SIZE, NULL, 0,
netvsc_channel_cb, device); netvsc_channel_cb, device);
if (ret != 0) { if (ret != 0) {
......
...@@ -354,6 +354,7 @@ static int netvsc_probe(struct hv_device *dev) ...@@ -354,6 +354,7 @@ static int netvsc_probe(struct hv_device *dev)
INIT_WORK(&net_device_ctx->work, netvsc_send_garp); INIT_WORK(&net_device_ctx->work, netvsc_send_garp);
/* Notify the netvsc driver of the new device */ /* Notify the netvsc driver of the new device */
device_info.ring_size = ring_size;
ret = rndis_filte_device_add(dev, &device_info); ret = rndis_filte_device_add(dev, &device_info);
if (ret != 0) { if (ret != 0) {
free_netdev(net); free_netdev(net);
......
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