diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2010-12-10 15:03:55 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-13 13:31:51 -0500 |
commit | 5a71ae303c0f82968d93d86724c1d94d753b34d7 (patch) | |
tree | bd7fd3ea0135e0d416326d674d79ac2016c20a16 | |
parent | 85799a37553f89b23797ec4f69e45f6c5e9109df (diff) |
staging: hv: Convert camel cased functions in netvsc.c to lower cases
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/hv/netvsc.c | 173 | ||||
-rw-r--r-- | drivers/staging/hv/netvsc_api.h | 2 | ||||
-rw-r--r-- | drivers/staging/hv/netvsc_drv.c | 2 |
3 files changed, 90 insertions, 87 deletions
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c index 1c1ee57482a..781d7bd3710 100644 --- a/drivers/staging/hv/netvsc.c +++ b/drivers/staging/hv/netvsc.c | |||
@@ -41,40 +41,40 @@ static const struct hv_guid netvsc_device_type = { | |||
41 | } | 41 | } |
42 | }; | 42 | }; |
43 | 43 | ||
44 | static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info); | 44 | static int netvsc_device_add(struct hv_device *device, void *additional_info); |
45 | 45 | ||
46 | static int NetVscOnDeviceRemove(struct hv_device *device); | 46 | static int netvsc_device_remove(struct hv_device *device); |
47 | 47 | ||
48 | static void NetVscOnCleanup(struct hv_driver *driver); | 48 | static void netvsc_cleanup(struct hv_driver *driver); |
49 | 49 | ||
50 | static void NetVscOnChannelCallback(void *context); | 50 | static void netvsc_channel_cb(void *context); |
51 | 51 | ||
52 | static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *device); | 52 | static int netvsc_init_send_buf(struct hv_device *device); |
53 | 53 | ||
54 | static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *device); | 54 | static int netvsc_init_recv_buf(struct hv_device *device); |
55 | 55 | ||
56 | static int NetVscDestroySendBuffer(struct netvsc_device *net_device); | 56 | static int netvsc_destroy_send_buf(struct netvsc_device *net_device); |
57 | 57 | ||
58 | static int NetVscDestroyReceiveBuffer(struct netvsc_device *net_device); | 58 | static int netvsc_destroy_recv_buf(struct netvsc_device *net_device); |
59 | 59 | ||
60 | static int NetVscConnectToVsp(struct hv_device *device); | 60 | static int netvsc_connect_vsp(struct hv_device *device); |
61 | 61 | ||
62 | static void NetVscOnSendCompletion(struct hv_device *device, | 62 | static void netvsc_send_completion(struct hv_device *device, |
63 | struct vmpacket_descriptor *packet); | 63 | struct vmpacket_descriptor *packet); |
64 | 64 | ||
65 | static int NetVscOnSend(struct hv_device *device, | 65 | static int netvsc_send(struct hv_device *device, |
66 | struct hv_netvsc_packet *packet); | 66 | struct hv_netvsc_packet *packet); |
67 | 67 | ||
68 | static void NetVscOnReceive(struct hv_device *device, | 68 | static void netvsc_receive(struct hv_device *device, |
69 | struct vmpacket_descriptor *packet); | 69 | struct vmpacket_descriptor *packet); |
70 | 70 | ||
71 | static void NetVscOnReceiveCompletion(void *context); | 71 | static void netvsc_receive_completion(void *context); |
72 | 72 | ||
73 | static void NetVscSendReceiveCompletion(struct hv_device *device, | 73 | static void netvsc_send_recv_completion(struct hv_device *device, |
74 | u64 transaction_id); | 74 | u64 transaction_id); |
75 | 75 | ||
76 | 76 | ||
77 | static struct netvsc_device *AllocNetDevice(struct hv_device *device) | 77 | static struct netvsc_device *alloc_net_device(struct hv_device *device) |
78 | { | 78 | { |
79 | struct netvsc_device *net_device; | 79 | struct netvsc_device *net_device; |
80 | 80 | ||
@@ -91,7 +91,7 @@ static struct netvsc_device *AllocNetDevice(struct hv_device *device) | |||
91 | return net_device; | 91 | return net_device; |
92 | } | 92 | } |
93 | 93 | ||
94 | static void FreeNetDevice(struct netvsc_device *device) | 94 | static void free_net_device(struct netvsc_device *device) |
95 | { | 95 | { |
96 | WARN_ON(atomic_read(&device->RefCount) == 0); | 96 | WARN_ON(atomic_read(&device->RefCount) == 0); |
97 | device->Device->Extension = NULL; | 97 | device->Device->Extension = NULL; |
@@ -100,7 +100,7 @@ static void FreeNetDevice(struct netvsc_device *device) | |||
100 | 100 | ||
101 | 101 | ||
102 | /* Get the net device object iff exists and its refcount > 1 */ | 102 | /* Get the net device object iff exists and its refcount > 1 */ |
103 | static struct netvsc_device *GetOutboundNetDevice(struct hv_device *device) | 103 | static struct netvsc_device *get_outbound_net_device(struct hv_device *device) |
104 | { | 104 | { |
105 | struct netvsc_device *net_device; | 105 | struct netvsc_device *net_device; |
106 | 106 | ||
@@ -114,7 +114,7 @@ static struct netvsc_device *GetOutboundNetDevice(struct hv_device *device) | |||
114 | } | 114 | } |
115 | 115 | ||
116 | /* Get the net device object iff exists and its refcount > 0 */ | 116 | /* Get the net device object iff exists and its refcount > 0 */ |
117 | static struct netvsc_device *GetInboundNetDevice(struct hv_device *device) | 117 | static struct netvsc_device *get_inbound_net_device(struct hv_device *device) |
118 | { | 118 | { |
119 | struct netvsc_device *net_device; | 119 | struct netvsc_device *net_device; |
120 | 120 | ||
@@ -127,7 +127,7 @@ static struct netvsc_device *GetInboundNetDevice(struct hv_device *device) | |||
127 | return net_device; | 127 | return net_device; |
128 | } | 128 | } |
129 | 129 | ||
130 | static void PutNetDevice(struct hv_device *device) | 130 | static void put_net_device(struct hv_device *device) |
131 | { | 131 | { |
132 | struct netvsc_device *net_device; | 132 | struct netvsc_device *net_device; |
133 | 133 | ||
@@ -137,7 +137,8 @@ static void PutNetDevice(struct hv_device *device) | |||
137 | atomic_dec(&net_device->RefCount); | 137 | atomic_dec(&net_device->RefCount); |
138 | } | 138 | } |
139 | 139 | ||
140 | static struct netvsc_device *ReleaseOutboundNetDevice(struct hv_device *device) | 140 | static struct netvsc_device *release_outbound_net_device( |
141 | struct hv_device *device) | ||
141 | { | 142 | { |
142 | struct netvsc_device *net_device; | 143 | struct netvsc_device *net_device; |
143 | 144 | ||
@@ -152,7 +153,8 @@ static struct netvsc_device *ReleaseOutboundNetDevice(struct hv_device *device) | |||
152 | return net_device; | 153 | return net_device; |
153 | } | 154 | } |
154 | 155 | ||
155 | static struct netvsc_device *ReleaseInboundNetDevice(struct hv_device *device) | 156 | static struct netvsc_device *release_inbound_net_device( |
157 | struct hv_device *device) | ||
156 | { | 158 | { |
157 | struct netvsc_device *net_device; | 159 | struct netvsc_device *net_device; |
158 | 160 | ||
@@ -169,9 +171,9 @@ static struct netvsc_device *ReleaseInboundNetDevice(struct hv_device *device) | |||
169 | } | 171 | } |
170 | 172 | ||
171 | /* | 173 | /* |
172 | * NetVscInitialize - Main entry point | 174 | * netvsc_initialize - Main entry point |
173 | */ | 175 | */ |
174 | int NetVscInitialize(struct hv_driver *drv) | 176 | int netvsc_initialize(struct hv_driver *drv) |
175 | { | 177 | { |
176 | struct netvsc_driver *driver = (struct netvsc_driver *)drv; | 178 | struct netvsc_driver *driver = (struct netvsc_driver *)drv; |
177 | 179 | ||
@@ -194,23 +196,23 @@ int NetVscInitialize(struct hv_driver *drv) | |||
194 | /* ASSERT(driver->OnLinkStatusChanged); */ | 196 | /* ASSERT(driver->OnLinkStatusChanged); */ |
195 | 197 | ||
196 | /* Setup the dispatch table */ | 198 | /* Setup the dispatch table */ |
197 | driver->Base.OnDeviceAdd = NetVscOnDeviceAdd; | 199 | driver->Base.OnDeviceAdd = netvsc_device_add; |
198 | driver->Base.OnDeviceRemove = NetVscOnDeviceRemove; | 200 | driver->Base.OnDeviceRemove = netvsc_device_remove; |
199 | driver->Base.OnCleanup = NetVscOnCleanup; | 201 | driver->Base.OnCleanup = netvsc_cleanup; |
200 | 202 | ||
201 | driver->OnSend = NetVscOnSend; | 203 | driver->OnSend = netvsc_send; |
202 | 204 | ||
203 | RndisFilterInit(driver); | 205 | RndisFilterInit(driver); |
204 | return 0; | 206 | return 0; |
205 | } | 207 | } |
206 | 208 | ||
207 | static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *device) | 209 | static int netvsc_init_recv_buf(struct hv_device *device) |
208 | { | 210 | { |
209 | int ret = 0; | 211 | int ret = 0; |
210 | struct netvsc_device *net_device; | 212 | struct netvsc_device *net_device; |
211 | struct nvsp_message *init_packet; | 213 | struct nvsp_message *init_packet; |
212 | 214 | ||
213 | net_device = GetOutboundNetDevice(device); | 215 | net_device = get_outbound_net_device(device); |
214 | if (!net_device) { | 216 | if (!net_device) { |
215 | DPRINT_ERR(NETVSC, "unable to get net device..." | 217 | DPRINT_ERR(NETVSC, "unable to get net device..." |
216 | "device being destroyed?"); | 218 | "device being destroyed?"); |
@@ -330,20 +332,20 @@ static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *device) | |||
330 | goto Exit; | 332 | goto Exit; |
331 | 333 | ||
332 | Cleanup: | 334 | Cleanup: |
333 | NetVscDestroyReceiveBuffer(net_device); | 335 | netvsc_destroy_recv_buf(net_device); |
334 | 336 | ||
335 | Exit: | 337 | Exit: |
336 | PutNetDevice(device); | 338 | put_net_device(device); |
337 | return ret; | 339 | return ret; |
338 | } | 340 | } |
339 | 341 | ||
340 | static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *device) | 342 | static int netvsc_init_send_buf(struct hv_device *device) |
341 | { | 343 | { |
342 | int ret = 0; | 344 | int ret = 0; |
343 | struct netvsc_device *net_device; | 345 | struct netvsc_device *net_device; |
344 | struct nvsp_message *init_packet; | 346 | struct nvsp_message *init_packet; |
345 | 347 | ||
346 | net_device = GetOutboundNetDevice(device); | 348 | net_device = get_outbound_net_device(device); |
347 | if (!net_device) { | 349 | if (!net_device) { |
348 | DPRINT_ERR(NETVSC, "unable to get net device..." | 350 | DPRINT_ERR(NETVSC, "unable to get net device..." |
349 | "device being destroyed?"); | 351 | "device being destroyed?"); |
@@ -429,14 +431,14 @@ static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *device) | |||
429 | goto Exit; | 431 | goto Exit; |
430 | 432 | ||
431 | Cleanup: | 433 | Cleanup: |
432 | NetVscDestroySendBuffer(net_device); | 434 | netvsc_destroy_send_buf(net_device); |
433 | 435 | ||
434 | Exit: | 436 | Exit: |
435 | PutNetDevice(device); | 437 | put_net_device(device); |
436 | return ret; | 438 | return ret; |
437 | } | 439 | } |
438 | 440 | ||
439 | static int NetVscDestroyReceiveBuffer(struct netvsc_device *net_device) | 441 | static int netvsc_destroy_recv_buf(struct netvsc_device *net_device) |
440 | { | 442 | { |
441 | struct nvsp_message *revoke_packet; | 443 | struct nvsp_message *revoke_packet; |
442 | int ret = 0; | 444 | int ret = 0; |
@@ -510,7 +512,7 @@ static int NetVscDestroyReceiveBuffer(struct netvsc_device *net_device) | |||
510 | return ret; | 512 | return ret; |
511 | } | 513 | } |
512 | 514 | ||
513 | static int NetVscDestroySendBuffer(struct netvsc_device *net_device) | 515 | static int netvsc_destroy_send_buf(struct netvsc_device *net_device) |
514 | { | 516 | { |
515 | struct nvsp_message *revoke_packet; | 517 | struct nvsp_message *revoke_packet; |
516 | int ret = 0; | 518 | int ret = 0; |
@@ -581,14 +583,14 @@ static int NetVscDestroySendBuffer(struct netvsc_device *net_device) | |||
581 | } | 583 | } |
582 | 584 | ||
583 | 585 | ||
584 | static int NetVscConnectToVsp(struct hv_device *device) | 586 | static int netvsc_connect_vsp(struct hv_device *device) |
585 | { | 587 | { |
586 | int ret; | 588 | int ret; |
587 | struct netvsc_device *net_device; | 589 | struct netvsc_device *net_device; |
588 | struct nvsp_message *init_packet; | 590 | struct nvsp_message *init_packet; |
589 | int ndis_version; | 591 | int ndis_version; |
590 | 592 | ||
591 | net_device = GetOutboundNetDevice(device); | 593 | net_device = get_outbound_net_device(device); |
592 | if (!net_device) { | 594 | if (!net_device) { |
593 | DPRINT_ERR(NETVSC, "unable to get net device..." | 595 | DPRINT_ERR(NETVSC, "unable to get net device..." |
594 | "device being destroyed?"); | 596 | "device being destroyed?"); |
@@ -680,25 +682,26 @@ static int NetVscConnectToVsp(struct hv_device *device) | |||
680 | /* osd_waitevent_wait(NetVscChannel->ChannelInitEvent); */ | 682 | /* osd_waitevent_wait(NetVscChannel->ChannelInitEvent); */ |
681 | 683 | ||
682 | /* Post the big receive buffer to NetVSP */ | 684 | /* Post the big receive buffer to NetVSP */ |
683 | ret = NetVscInitializeReceiveBufferWithNetVsp(device); | 685 | ret = netvsc_init_recv_buf(device); |
684 | if (ret == 0) | 686 | if (ret == 0) |
685 | ret = NetVscInitializeSendBufferWithNetVsp(device); | 687 | ret = netvsc_init_send_buf(device); |
686 | 688 | ||
687 | Cleanup: | 689 | Cleanup: |
688 | PutNetDevice(device); | 690 | put_net_device(device); |
689 | return ret; | 691 | return ret; |
690 | } | 692 | } |
691 | 693 | ||
692 | static void NetVscDisconnectFromVsp(struct netvsc_device *net_device) | 694 | static void NetVscDisconnectFromVsp(struct netvsc_device *net_device) |
693 | { | 695 | { |
694 | NetVscDestroyReceiveBuffer(net_device); | 696 | netvsc_destroy_recv_buf(net_device); |
695 | NetVscDestroySendBuffer(net_device); | 697 | netvsc_destroy_send_buf(net_device); |
696 | } | 698 | } |
697 | 699 | ||
698 | /* | 700 | /* |
699 | * NetVscOnDeviceAdd - Callback when the device belonging to this driver is added | 701 | * netvsc_device_add - Callback when the device belonging to this |
702 | * driver is added | ||
700 | */ | 703 | */ |
701 | static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info) | 704 | static int netvsc_device_add(struct hv_device *device, void *additional_info) |
702 | { | 705 | { |
703 | int ret = 0; | 706 | int ret = 0; |
704 | int i; | 707 | int i; |
@@ -707,7 +710,7 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info) | |||
707 | struct netvsc_driver *net_driver = | 710 | struct netvsc_driver *net_driver = |
708 | (struct netvsc_driver *)device->Driver; | 711 | (struct netvsc_driver *)device->Driver; |
709 | 712 | ||
710 | net_device = AllocNetDevice(device); | 713 | net_device = alloc_net_device(device); |
711 | if (!net_device) { | 714 | if (!net_device) { |
712 | ret = -1; | 715 | ret = -1; |
713 | goto Cleanup; | 716 | goto Cleanup; |
@@ -745,7 +748,7 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info) | |||
745 | /* Open the channel */ | 748 | /* Open the channel */ |
746 | ret = vmbus_open(device->channel, net_driver->RingBufferSize, | 749 | ret = vmbus_open(device->channel, net_driver->RingBufferSize, |
747 | net_driver->RingBufferSize, NULL, 0, | 750 | net_driver->RingBufferSize, NULL, 0, |
748 | NetVscOnChannelCallback, device); | 751 | netvsc_channel_cb, device); |
749 | 752 | ||
750 | if (ret != 0) { | 753 | if (ret != 0) { |
751 | DPRINT_ERR(NETVSC, "unable to open channel: %d", ret); | 754 | DPRINT_ERR(NETVSC, "unable to open channel: %d", ret); |
@@ -757,7 +760,7 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info) | |||
757 | DPRINT_INFO(NETVSC, "*** NetVSC channel opened successfully! ***"); | 760 | DPRINT_INFO(NETVSC, "*** NetVSC channel opened successfully! ***"); |
758 | 761 | ||
759 | /* Connect with the NetVsp */ | 762 | /* Connect with the NetVsp */ |
760 | ret = NetVscConnectToVsp(device); | 763 | ret = netvsc_connect_vsp(device); |
761 | if (ret != 0) { | 764 | if (ret != 0) { |
762 | DPRINT_ERR(NETVSC, "unable to connect to NetVSP - %d", ret); | 765 | DPRINT_ERR(NETVSC, "unable to connect to NetVSP - %d", ret); |
763 | ret = -1; | 766 | ret = -1; |
@@ -785,19 +788,19 @@ Cleanup: | |||
785 | kfree(packet); | 788 | kfree(packet); |
786 | } | 789 | } |
787 | 790 | ||
788 | ReleaseOutboundNetDevice(device); | 791 | release_outbound_net_device(device); |
789 | ReleaseInboundNetDevice(device); | 792 | release_inbound_net_device(device); |
790 | 793 | ||
791 | FreeNetDevice(net_device); | 794 | free_net_device(net_device); |
792 | } | 795 | } |
793 | 796 | ||
794 | return ret; | 797 | return ret; |
795 | } | 798 | } |
796 | 799 | ||
797 | /* | 800 | /* |
798 | * NetVscOnDeviceRemove - Callback when the root bus device is removed | 801 | * netvsc_device_remove - Callback when the root bus device is removed |
799 | */ | 802 | */ |
800 | static int NetVscOnDeviceRemove(struct hv_device *device) | 803 | static int netvsc_device_remove(struct hv_device *device) |
801 | { | 804 | { |
802 | struct netvsc_device *net_device; | 805 | struct netvsc_device *net_device; |
803 | struct hv_netvsc_packet *netvsc_packet, *pos; | 806 | struct hv_netvsc_packet *netvsc_packet, *pos; |
@@ -806,7 +809,7 @@ static int NetVscOnDeviceRemove(struct hv_device *device) | |||
806 | device->Extension); | 809 | device->Extension); |
807 | 810 | ||
808 | /* Stop outbound traffic ie sends and receives completions */ | 811 | /* Stop outbound traffic ie sends and receives completions */ |
809 | net_device = ReleaseOutboundNetDevice(device); | 812 | net_device = release_outbound_net_device(device); |
810 | if (!net_device) { | 813 | if (!net_device) { |
811 | DPRINT_ERR(NETVSC, "No net device present!!"); | 814 | DPRINT_ERR(NETVSC, "No net device present!!"); |
812 | return -1; | 815 | return -1; |
@@ -827,7 +830,7 @@ static int NetVscOnDeviceRemove(struct hv_device *device) | |||
827 | device->Extension); | 830 | device->Extension); |
828 | 831 | ||
829 | /* Stop inbound traffic ie receives and sends completions */ | 832 | /* Stop inbound traffic ie receives and sends completions */ |
830 | net_device = ReleaseInboundNetDevice(device); | 833 | net_device = release_inbound_net_device(device); |
831 | 834 | ||
832 | /* At this point, no one should be accessing netDevice except in here */ | 835 | /* At this point, no one should be accessing netDevice except in here */ |
833 | DPRINT_INFO(NETVSC, "net device (%p) safe to remove", net_device); | 836 | DPRINT_INFO(NETVSC, "net device (%p) safe to remove", net_device); |
@@ -843,25 +846,25 @@ static int NetVscOnDeviceRemove(struct hv_device *device) | |||
843 | } | 846 | } |
844 | 847 | ||
845 | kfree(net_device->ChannelInitEvent); | 848 | kfree(net_device->ChannelInitEvent); |
846 | FreeNetDevice(net_device); | 849 | free_net_device(net_device); |
847 | return 0; | 850 | return 0; |
848 | } | 851 | } |
849 | 852 | ||
850 | /* | 853 | /* |
851 | * NetVscOnCleanup - Perform any cleanup when the driver is removed | 854 | * netvsc_cleanup - Perform any cleanup when the driver is removed |
852 | */ | 855 | */ |
853 | static void NetVscOnCleanup(struct hv_driver *drv) | 856 | static void netvsc_cleanup(struct hv_driver *drv) |
854 | { | 857 | { |
855 | } | 858 | } |
856 | 859 | ||
857 | static void NetVscOnSendCompletion(struct hv_device *device, | 860 | static void netvsc_send_completion(struct hv_device *device, |
858 | struct vmpacket_descriptor *packet) | 861 | struct vmpacket_descriptor *packet) |
859 | { | 862 | { |
860 | struct netvsc_device *net_device; | 863 | struct netvsc_device *net_device; |
861 | struct nvsp_message *nvsp_packet; | 864 | struct nvsp_message *nvsp_packet; |
862 | struct hv_netvsc_packet *nvsc_packet; | 865 | struct hv_netvsc_packet *nvsc_packet; |
863 | 866 | ||
864 | net_device = GetInboundNetDevice(device); | 867 | net_device = get_inbound_net_device(device); |
865 | if (!net_device) { | 868 | if (!net_device) { |
866 | DPRINT_ERR(NETVSC, "unable to get net device..." | 869 | DPRINT_ERR(NETVSC, "unable to get net device..." |
867 | "device being destroyed?"); | 870 | "device being destroyed?"); |
@@ -900,10 +903,10 @@ static void NetVscOnSendCompletion(struct hv_device *device, | |||
900 | "%d received!!", nvsp_packet->Header.MessageType); | 903 | "%d received!!", nvsp_packet->Header.MessageType); |
901 | } | 904 | } |
902 | 905 | ||
903 | PutNetDevice(device); | 906 | put_net_device(device); |
904 | } | 907 | } |
905 | 908 | ||
906 | static int NetVscOnSend(struct hv_device *device, | 909 | static int netvsc_send(struct hv_device *device, |
907 | struct hv_netvsc_packet *packet) | 910 | struct hv_netvsc_packet *packet) |
908 | { | 911 | { |
909 | struct netvsc_device *net_device; | 912 | struct netvsc_device *net_device; |
@@ -911,7 +914,7 @@ static int NetVscOnSend(struct hv_device *device, | |||
911 | 914 | ||
912 | struct nvsp_message sendMessage; | 915 | struct nvsp_message sendMessage; |
913 | 916 | ||
914 | net_device = GetOutboundNetDevice(device); | 917 | net_device = get_outbound_net_device(device); |
915 | if (!net_device) { | 918 | if (!net_device) { |
916 | DPRINT_ERR(NETVSC, "net device (%p) shutting down..." | 919 | DPRINT_ERR(NETVSC, "net device (%p) shutting down..." |
917 | "ignoring outbound packets", net_device); | 920 | "ignoring outbound packets", net_device); |
@@ -952,11 +955,11 @@ static int NetVscOnSend(struct hv_device *device, | |||
952 | packet, ret); | 955 | packet, ret); |
953 | 956 | ||
954 | atomic_inc(&net_device->NumOutstandingSends); | 957 | atomic_inc(&net_device->NumOutstandingSends); |
955 | PutNetDevice(device); | 958 | put_net_device(device); |
956 | return ret; | 959 | return ret; |
957 | } | 960 | } |
958 | 961 | ||
959 | static void NetVscOnReceive(struct hv_device *device, | 962 | static void netvsc_receive(struct hv_device *device, |
960 | struct vmpacket_descriptor *packet) | 963 | struct vmpacket_descriptor *packet) |
961 | { | 964 | { |
962 | struct netvsc_device *net_device; | 965 | struct netvsc_device *net_device; |
@@ -972,7 +975,7 @@ static void NetVscOnReceive(struct hv_device *device, | |||
972 | unsigned long flags; | 975 | unsigned long flags; |
973 | LIST_HEAD(listHead); | 976 | LIST_HEAD(listHead); |
974 | 977 | ||
975 | net_device = GetInboundNetDevice(device); | 978 | net_device = get_inbound_net_device(device); |
976 | if (!net_device) { | 979 | if (!net_device) { |
977 | DPRINT_ERR(NETVSC, "unable to get net device..." | 980 | DPRINT_ERR(NETVSC, "unable to get net device..." |
978 | "device being destroyed?"); | 981 | "device being destroyed?"); |
@@ -986,7 +989,7 @@ static void NetVscOnReceive(struct hv_device *device, | |||
986 | if (packet->Type != VmbusPacketTypeDataUsingTransferPages) { | 989 | if (packet->Type != VmbusPacketTypeDataUsingTransferPages) { |
987 | DPRINT_ERR(NETVSC, "Unknown packet type received - %d", | 990 | DPRINT_ERR(NETVSC, "Unknown packet type received - %d", |
988 | packet->Type); | 991 | packet->Type); |
989 | PutNetDevice(device); | 992 | put_net_device(device); |
990 | return; | 993 | return; |
991 | } | 994 | } |
992 | 995 | ||
@@ -998,7 +1001,7 @@ static void NetVscOnReceive(struct hv_device *device, | |||
998 | NvspMessage1TypeSendRNDISPacket) { | 1001 | NvspMessage1TypeSendRNDISPacket) { |
999 | DPRINT_ERR(NETVSC, "Unknown nvsp packet type received - %d", | 1002 | DPRINT_ERR(NETVSC, "Unknown nvsp packet type received - %d", |
1000 | nvsp_packet->Header.MessageType); | 1003 | nvsp_packet->Header.MessageType); |
1001 | PutNetDevice(device); | 1004 | put_net_device(device); |
1002 | return; | 1005 | return; |
1003 | } | 1006 | } |
1004 | 1007 | ||
@@ -1011,7 +1014,7 @@ static void NetVscOnReceive(struct hv_device *device, | |||
1011 | DPRINT_ERR(NETVSC, "Invalid xfer page set id - " | 1014 | DPRINT_ERR(NETVSC, "Invalid xfer page set id - " |
1012 | "expecting %x got %x", NETVSC_RECEIVE_BUFFER_ID, | 1015 | "expecting %x got %x", NETVSC_RECEIVE_BUFFER_ID, |
1013 | vmxferpage_packet->TransferPageSetId); | 1016 | vmxferpage_packet->TransferPageSetId); |
1014 | PutNetDevice(device); | 1017 | put_net_device(device); |
1015 | return; | 1018 | return; |
1016 | } | 1019 | } |
1017 | 1020 | ||
@@ -1051,10 +1054,10 @@ static void NetVscOnReceive(struct hv_device *device, | |||
1051 | spin_unlock_irqrestore(&net_device->receive_packet_list_lock, | 1054 | spin_unlock_irqrestore(&net_device->receive_packet_list_lock, |
1052 | flags); | 1055 | flags); |
1053 | 1056 | ||
1054 | NetVscSendReceiveCompletion(device, | 1057 | netvsc_send_recv_completion(device, |
1055 | vmxferpage_packet->d.TransactionId); | 1058 | vmxferpage_packet->d.TransactionId); |
1056 | 1059 | ||
1057 | PutNetDevice(device); | 1060 | put_net_device(device); |
1058 | return; | 1061 | return; |
1059 | } | 1062 | } |
1060 | 1063 | ||
@@ -1081,7 +1084,7 @@ static void NetVscOnReceive(struct hv_device *device, | |||
1081 | /* Initialize the netvsc packet */ | 1084 | /* Initialize the netvsc packet */ |
1082 | netvsc_packet->XferPagePacket = xferpage_packet; | 1085 | netvsc_packet->XferPagePacket = xferpage_packet; |
1083 | netvsc_packet->Completion.Recv.OnReceiveCompletion = | 1086 | netvsc_packet->Completion.Recv.OnReceiveCompletion = |
1084 | NetVscOnReceiveCompletion; | 1087 | netvsc_receive_completion; |
1085 | netvsc_packet->Completion.Recv.ReceiveCompletionContext = | 1088 | netvsc_packet->Completion.Recv.ReceiveCompletionContext = |
1086 | netvsc_packet; | 1089 | netvsc_packet; |
1087 | netvsc_packet->Device = device; | 1090 | netvsc_packet->Device = device; |
@@ -1153,16 +1156,16 @@ static void NetVscOnReceive(struct hv_device *device, | |||
1153 | ((struct netvsc_driver *)device->Driver)-> | 1156 | ((struct netvsc_driver *)device->Driver)-> |
1154 | OnReceiveCallback(device, netvsc_packet); | 1157 | OnReceiveCallback(device, netvsc_packet); |
1155 | 1158 | ||
1156 | NetVscOnReceiveCompletion(netvsc_packet-> | 1159 | netvsc_receive_completion(netvsc_packet-> |
1157 | Completion.Recv.ReceiveCompletionContext); | 1160 | Completion.Recv.ReceiveCompletionContext); |
1158 | } | 1161 | } |
1159 | 1162 | ||
1160 | /* ASSERT(list_empty(&listHead)); */ | 1163 | /* ASSERT(list_empty(&listHead)); */ |
1161 | 1164 | ||
1162 | PutNetDevice(device); | 1165 | put_net_device(device); |
1163 | } | 1166 | } |
1164 | 1167 | ||
1165 | static void NetVscSendReceiveCompletion(struct hv_device *device, | 1168 | static void netvsc_send_recv_completion(struct hv_device *device, |
1166 | u64 transaction_id) | 1169 | u64 transaction_id) |
1167 | { | 1170 | { |
1168 | struct nvsp_message recvcompMessage; | 1171 | struct nvsp_message recvcompMessage; |
@@ -1207,7 +1210,7 @@ retry_send_cmplt: | |||
1207 | } | 1210 | } |
1208 | 1211 | ||
1209 | /* Send a receive completion packet to RNDIS device (ie NetVsp) */ | 1212 | /* Send a receive completion packet to RNDIS device (ie NetVsp) */ |
1210 | static void NetVscOnReceiveCompletion(void *context) | 1213 | static void netvsc_receive_completion(void *context) |
1211 | { | 1214 | { |
1212 | struct hv_netvsc_packet *packet = context; | 1215 | struct hv_netvsc_packet *packet = context; |
1213 | struct hv_device *device = (struct hv_device *)packet->Device; | 1216 | struct hv_device *device = (struct hv_device *)packet->Device; |
@@ -1223,7 +1226,7 @@ static void NetVscOnReceiveCompletion(void *context) | |||
1223 | * send out receive completion, we are using GetInboundNetDevice() | 1226 | * send out receive completion, we are using GetInboundNetDevice() |
1224 | * since we may have disable outbound traffic already. | 1227 | * since we may have disable outbound traffic already. |
1225 | */ | 1228 | */ |
1226 | net_device = GetInboundNetDevice(device); | 1229 | net_device = get_inbound_net_device(device); |
1227 | if (!net_device) { | 1230 | if (!net_device) { |
1228 | DPRINT_ERR(NETVSC, "unable to get net device..." | 1231 | DPRINT_ERR(NETVSC, "unable to get net device..." |
1229 | "device being destroyed?"); | 1232 | "device being destroyed?"); |
@@ -1254,12 +1257,12 @@ static void NetVscOnReceiveCompletion(void *context) | |||
1254 | 1257 | ||
1255 | /* Send a receive completion for the xfer page packet */ | 1258 | /* Send a receive completion for the xfer page packet */ |
1256 | if (fsend_receive_comp) | 1259 | if (fsend_receive_comp) |
1257 | NetVscSendReceiveCompletion(device, transaction_id); | 1260 | netvsc_send_recv_completion(device, transaction_id); |
1258 | 1261 | ||
1259 | PutNetDevice(device); | 1262 | put_net_device(device); |
1260 | } | 1263 | } |
1261 | 1264 | ||
1262 | static void NetVscOnChannelCallback(void *context) | 1265 | static void netvsc_channel_cb(void *context) |
1263 | { | 1266 | { |
1264 | int ret; | 1267 | int ret; |
1265 | struct hv_device *device = context; | 1268 | struct hv_device *device = context; |
@@ -1279,7 +1282,7 @@ static void NetVscOnChannelCallback(void *context) | |||
1279 | return; | 1282 | return; |
1280 | buffer = packet; | 1283 | buffer = packet; |
1281 | 1284 | ||
1282 | net_device = GetInboundNetDevice(device); | 1285 | net_device = get_inbound_net_device(device); |
1283 | if (!net_device) { | 1286 | if (!net_device) { |
1284 | DPRINT_ERR(NETVSC, "net device (%p) shutting down..." | 1287 | DPRINT_ERR(NETVSC, "net device (%p) shutting down..." |
1285 | "ignoring inbound packets", net_device); | 1288 | "ignoring inbound packets", net_device); |
@@ -1297,11 +1300,11 @@ static void NetVscOnChannelCallback(void *context) | |||
1297 | desc = (struct vmpacket_descriptor *)buffer; | 1300 | desc = (struct vmpacket_descriptor *)buffer; |
1298 | switch (desc->Type) { | 1301 | switch (desc->Type) { |
1299 | case VmbusPacketTypeCompletion: | 1302 | case VmbusPacketTypeCompletion: |
1300 | NetVscOnSendCompletion(device, desc); | 1303 | netvsc_send_completion(device, desc); |
1301 | break; | 1304 | break; |
1302 | 1305 | ||
1303 | case VmbusPacketTypeDataUsingTransferPages: | 1306 | case VmbusPacketTypeDataUsingTransferPages: |
1304 | NetVscOnReceive(device, desc); | 1307 | netvsc_receive(device, desc); |
1305 | break; | 1308 | break; |
1306 | 1309 | ||
1307 | default: | 1310 | default: |
@@ -1344,7 +1347,7 @@ static void NetVscOnChannelCallback(void *context) | |||
1344 | } | 1347 | } |
1345 | } while (1); | 1348 | } while (1); |
1346 | 1349 | ||
1347 | PutNetDevice(device); | 1350 | put_net_device(device); |
1348 | out: | 1351 | out: |
1349 | kfree(buffer); | 1352 | kfree(buffer); |
1350 | return; | 1353 | return; |
diff --git a/drivers/staging/hv/netvsc_api.h b/drivers/staging/hv/netvsc_api.h index 4b5b3ac458c..dbf154acd96 100644 --- a/drivers/staging/hv/netvsc_api.h +++ b/drivers/staging/hv/netvsc_api.h | |||
@@ -109,7 +109,7 @@ struct netvsc_device_info { | |||
109 | }; | 109 | }; |
110 | 110 | ||
111 | /* Interface */ | 111 | /* Interface */ |
112 | int NetVscInitialize(struct hv_driver *drv); | 112 | int netvsc_initialize(struct hv_driver *drv); |
113 | int RndisFilterOnOpen(struct hv_device *Device); | 113 | int RndisFilterOnOpen(struct hv_device *Device); |
114 | int RndisFilterOnClose(struct hv_device *Device); | 114 | int RndisFilterOnClose(struct hv_device *Device); |
115 | 115 | ||
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index f527e5f24f5..cd3eef04e59 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c | |||
@@ -539,7 +539,7 @@ static int __init netvsc_init(void) | |||
539 | if (!dmi_check_system(hv_netvsc_dmi_table)) | 539 | if (!dmi_check_system(hv_netvsc_dmi_table)) |
540 | return -ENODEV; | 540 | return -ENODEV; |
541 | 541 | ||
542 | return netvsc_drv_init(NetVscInitialize); | 542 | return netvsc_drv_init(netvsc_initialize); |
543 | } | 543 | } |
544 | 544 | ||
545 | static void __exit netvsc_exit(void) | 545 | static void __exit netvsc_exit(void) |