[PATCH 52/64] Staging: hv: netvsc_drv: Get the ring size information from struct netvsc_device_info

K. Y. Srinivasan kys at microsoft.com
Fri May 13 02:35:05 UTC 2011


Get the ring size information from struct netvsc_device_info.

Signed-off-by: K. Y. Srinivasan <kys at microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz at microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane at microsoft.com>
Signed-off-by: Hank Janssen <hjanssen at microsoft.com>
---
 drivers/staging/hv/netvsc.c     |    8 ++++----
 drivers/staging/hv/netvsc_drv.c |    1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
index 6ab5b77..2eaa667 100644
--- a/drivers/staging/hv/netvsc.c
+++ b/drivers/staging/hv/netvsc.c
@@ -1084,10 +1084,10 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
 {
 	int ret = 0;
 	int i;
+	int ring_size =
+	((struct netvsc_device_info *)additional_info)->ring_size;
 	struct netvsc_device *net_device;
 	struct hv_netvsc_packet *packet, *pos;
-	struct netvsc_driver *net_driver =
-		drv_to_netvscdrv(device->device.driver);
 
 	net_device = alloc_net_device(device);
 	if (!net_device) {
@@ -1116,8 +1116,8 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
 	init_completion(&net_device->channel_init_wait);
 
 	/* Open the channel */
-	ret = vmbus_open(device->channel, net_driver->ring_buf_size,
-			 net_driver->ring_buf_size, NULL, 0,
+	ret = vmbus_open(device->channel, ring_size * PAGE_SIZE,
+			 ring_size * PAGE_SIZE, NULL, 0,
 			 netvsc_channel_cb, device);
 
 	if (ret != 0) {
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 1b98202..6463f32 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -354,6 +354,7 @@ static int netvsc_probe(struct hv_device *dev)
 	INIT_WORK(&net_device_ctx->work, netvsc_send_garp);
 
 	/* Notify the netvsc driver of the new device */
+	device_info.ring_size = ring_size;
 	ret = rndis_filte_device_add(dev, &device_info);
 	if (ret != 0) {
 		free_netdev(net);
-- 
1.7.4.1




More information about the devel mailing list