Commit 5a71ae30 authored by Haiyang Zhang's avatar Haiyang Zhang Committed by Greg Kroah-Hartman

staging: hv: Convert camel cased functions in netvsc.c to lower cases

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 85799a37
...@@ -41,40 +41,40 @@ static const struct hv_guid netvsc_device_type = { ...@@ -41,40 +41,40 @@ static const struct hv_guid netvsc_device_type = {
} }
}; };
static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info); static int netvsc_device_add(struct hv_device *device, void *additional_info);
static int NetVscOnDeviceRemove(struct hv_device *device); static int netvsc_device_remove(struct hv_device *device);
static void NetVscOnCleanup(struct hv_driver *driver); static void netvsc_cleanup(struct hv_driver *driver);
static void NetVscOnChannelCallback(void *context); static void netvsc_channel_cb(void *context);
static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *device); static int netvsc_init_send_buf(struct hv_device *device);
static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *device); static int netvsc_init_recv_buf(struct hv_device *device);
static int NetVscDestroySendBuffer(struct netvsc_device *net_device); static int netvsc_destroy_send_buf(struct netvsc_device *net_device);
static int NetVscDestroyReceiveBuffer(struct netvsc_device *net_device); static int netvsc_destroy_recv_buf(struct netvsc_device *net_device);
static int NetVscConnectToVsp(struct hv_device *device); static int netvsc_connect_vsp(struct hv_device *device);
static void NetVscOnSendCompletion(struct hv_device *device, static void netvsc_send_completion(struct hv_device *device,
struct vmpacket_descriptor *packet); struct vmpacket_descriptor *packet);
static int NetVscOnSend(struct hv_device *device, static int netvsc_send(struct hv_device *device,
struct hv_netvsc_packet *packet); struct hv_netvsc_packet *packet);
static void NetVscOnReceive(struct hv_device *device, static void netvsc_receive(struct hv_device *device,
struct vmpacket_descriptor *packet); struct vmpacket_descriptor *packet);
static void NetVscOnReceiveCompletion(void *context); static void netvsc_receive_completion(void *context);
static void NetVscSendReceiveCompletion(struct hv_device *device, static void netvsc_send_recv_completion(struct hv_device *device,
u64 transaction_id); u64 transaction_id);
static struct netvsc_device *AllocNetDevice(struct hv_device *device) static struct netvsc_device *alloc_net_device(struct hv_device *device)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
...@@ -91,7 +91,7 @@ static struct netvsc_device *AllocNetDevice(struct hv_device *device) ...@@ -91,7 +91,7 @@ static struct netvsc_device *AllocNetDevice(struct hv_device *device)
return net_device; return net_device;
} }
static void FreeNetDevice(struct netvsc_device *device) static void free_net_device(struct netvsc_device *device)
{ {
WARN_ON(atomic_read(&device->RefCount) == 0); WARN_ON(atomic_read(&device->RefCount) == 0);
device->Device->Extension = NULL; device->Device->Extension = NULL;
...@@ -100,7 +100,7 @@ static void FreeNetDevice(struct netvsc_device *device) ...@@ -100,7 +100,7 @@ static void FreeNetDevice(struct netvsc_device *device)
/* Get the net device object iff exists and its refcount > 1 */ /* Get the net device object iff exists and its refcount > 1 */
static struct netvsc_device *GetOutboundNetDevice(struct hv_device *device) static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
...@@ -114,7 +114,7 @@ static struct netvsc_device *GetOutboundNetDevice(struct hv_device *device) ...@@ -114,7 +114,7 @@ static struct netvsc_device *GetOutboundNetDevice(struct hv_device *device)
} }
/* Get the net device object iff exists and its refcount > 0 */ /* Get the net device object iff exists and its refcount > 0 */
static struct netvsc_device *GetInboundNetDevice(struct hv_device *device) static struct netvsc_device *get_inbound_net_device(struct hv_device *device)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
...@@ -127,7 +127,7 @@ static struct netvsc_device *GetInboundNetDevice(struct hv_device *device) ...@@ -127,7 +127,7 @@ static struct netvsc_device *GetInboundNetDevice(struct hv_device *device)
return net_device; return net_device;
} }
static void PutNetDevice(struct hv_device *device) static void put_net_device(struct hv_device *device)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
...@@ -137,7 +137,8 @@ static void PutNetDevice(struct hv_device *device) ...@@ -137,7 +137,8 @@ static void PutNetDevice(struct hv_device *device)
atomic_dec(&net_device->RefCount); atomic_dec(&net_device->RefCount);
} }
static struct netvsc_device *ReleaseOutboundNetDevice(struct hv_device *device) static struct netvsc_device *release_outbound_net_device(
struct hv_device *device)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
...@@ -152,7 +153,8 @@ static struct netvsc_device *ReleaseOutboundNetDevice(struct hv_device *device) ...@@ -152,7 +153,8 @@ static struct netvsc_device *ReleaseOutboundNetDevice(struct hv_device *device)
return net_device; return net_device;
} }
static struct netvsc_device *ReleaseInboundNetDevice(struct hv_device *device) static struct netvsc_device *release_inbound_net_device(
struct hv_device *device)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
...@@ -169,9 +171,9 @@ static struct netvsc_device *ReleaseInboundNetDevice(struct hv_device *device) ...@@ -169,9 +171,9 @@ static struct netvsc_device *ReleaseInboundNetDevice(struct hv_device *device)
} }
/* /*
* NetVscInitialize - Main entry point * netvsc_initialize - Main entry point
*/ */
int NetVscInitialize(struct hv_driver *drv) int netvsc_initialize(struct hv_driver *drv)
{ {
struct netvsc_driver *driver = (struct netvsc_driver *)drv; struct netvsc_driver *driver = (struct netvsc_driver *)drv;
...@@ -194,23 +196,23 @@ int NetVscInitialize(struct hv_driver *drv) ...@@ -194,23 +196,23 @@ int NetVscInitialize(struct hv_driver *drv)
/* ASSERT(driver->OnLinkStatusChanged); */ /* ASSERT(driver->OnLinkStatusChanged); */
/* Setup the dispatch table */ /* Setup the dispatch table */
driver->Base.OnDeviceAdd = NetVscOnDeviceAdd; driver->Base.OnDeviceAdd = netvsc_device_add;
driver->Base.OnDeviceRemove = NetVscOnDeviceRemove; driver->Base.OnDeviceRemove = netvsc_device_remove;
driver->Base.OnCleanup = NetVscOnCleanup; driver->Base.OnCleanup = netvsc_cleanup;
driver->OnSend = NetVscOnSend; driver->OnSend = netvsc_send;
RndisFilterInit(driver); RndisFilterInit(driver);
return 0; return 0;
} }
static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *device) static int netvsc_init_recv_buf(struct hv_device *device)
{ {
int ret = 0; int ret = 0;
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct nvsp_message *init_packet; struct nvsp_message *init_packet;
net_device = GetOutboundNetDevice(device); net_device = get_outbound_net_device(device);
if (!net_device) { if (!net_device) {
DPRINT_ERR(NETVSC, "unable to get net device..." DPRINT_ERR(NETVSC, "unable to get net device..."
"device being destroyed?"); "device being destroyed?");
...@@ -330,20 +332,20 @@ static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *device) ...@@ -330,20 +332,20 @@ static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *device)
goto Exit; goto Exit;
Cleanup: Cleanup:
NetVscDestroyReceiveBuffer(net_device); netvsc_destroy_recv_buf(net_device);
Exit: Exit:
PutNetDevice(device); put_net_device(device);
return ret; return ret;
} }
static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *device) static int netvsc_init_send_buf(struct hv_device *device)
{ {
int ret = 0; int ret = 0;
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct nvsp_message *init_packet; struct nvsp_message *init_packet;
net_device = GetOutboundNetDevice(device); net_device = get_outbound_net_device(device);
if (!net_device) { if (!net_device) {
DPRINT_ERR(NETVSC, "unable to get net device..." DPRINT_ERR(NETVSC, "unable to get net device..."
"device being destroyed?"); "device being destroyed?");
...@@ -429,14 +431,14 @@ static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *device) ...@@ -429,14 +431,14 @@ static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *device)
goto Exit; goto Exit;
Cleanup: Cleanup:
NetVscDestroySendBuffer(net_device); netvsc_destroy_send_buf(net_device);
Exit: Exit:
PutNetDevice(device); put_net_device(device);
return ret; return ret;
} }
static int NetVscDestroyReceiveBuffer(struct netvsc_device *net_device) static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
{ {
struct nvsp_message *revoke_packet; struct nvsp_message *revoke_packet;
int ret = 0; int ret = 0;
...@@ -510,7 +512,7 @@ static int NetVscDestroyReceiveBuffer(struct netvsc_device *net_device) ...@@ -510,7 +512,7 @@ static int NetVscDestroyReceiveBuffer(struct netvsc_device *net_device)
return ret; return ret;
} }
static int NetVscDestroySendBuffer(struct netvsc_device *net_device) static int netvsc_destroy_send_buf(struct netvsc_device *net_device)
{ {
struct nvsp_message *revoke_packet; struct nvsp_message *revoke_packet;
int ret = 0; int ret = 0;
...@@ -581,14 +583,14 @@ static int NetVscDestroySendBuffer(struct netvsc_device *net_device) ...@@ -581,14 +583,14 @@ static int NetVscDestroySendBuffer(struct netvsc_device *net_device)
} }
static int NetVscConnectToVsp(struct hv_device *device) static int netvsc_connect_vsp(struct hv_device *device)
{ {
int ret; int ret;
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct nvsp_message *init_packet; struct nvsp_message *init_packet;
int ndis_version; int ndis_version;
net_device = GetOutboundNetDevice(device); net_device = get_outbound_net_device(device);
if (!net_device) { if (!net_device) {
DPRINT_ERR(NETVSC, "unable to get net device..." DPRINT_ERR(NETVSC, "unable to get net device..."
"device being destroyed?"); "device being destroyed?");
...@@ -680,25 +682,26 @@ static int NetVscConnectToVsp(struct hv_device *device) ...@@ -680,25 +682,26 @@ static int NetVscConnectToVsp(struct hv_device *device)
/* osd_waitevent_wait(NetVscChannel->ChannelInitEvent); */ /* osd_waitevent_wait(NetVscChannel->ChannelInitEvent); */
/* Post the big receive buffer to NetVSP */ /* Post the big receive buffer to NetVSP */
ret = NetVscInitializeReceiveBufferWithNetVsp(device); ret = netvsc_init_recv_buf(device);
if (ret == 0) if (ret == 0)
ret = NetVscInitializeSendBufferWithNetVsp(device); ret = netvsc_init_send_buf(device);
Cleanup: Cleanup:
PutNetDevice(device); put_net_device(device);
return ret; return ret;
} }
static void NetVscDisconnectFromVsp(struct netvsc_device *net_device) static void NetVscDisconnectFromVsp(struct netvsc_device *net_device)
{ {
NetVscDestroyReceiveBuffer(net_device); netvsc_destroy_recv_buf(net_device);
NetVscDestroySendBuffer(net_device); netvsc_destroy_send_buf(net_device);
} }
/* /*
* NetVscOnDeviceAdd - Callback when the device belonging to this driver is added * netvsc_device_add - Callback when the device belonging to this
* driver is added
*/ */
static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info) static int netvsc_device_add(struct hv_device *device, void *additional_info)
{ {
int ret = 0; int ret = 0;
int i; int i;
...@@ -707,7 +710,7 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info) ...@@ -707,7 +710,7 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info)
struct netvsc_driver *net_driver = struct netvsc_driver *net_driver =
(struct netvsc_driver *)device->Driver; (struct netvsc_driver *)device->Driver;
net_device = AllocNetDevice(device); net_device = alloc_net_device(device);
if (!net_device) { if (!net_device) {
ret = -1; ret = -1;
goto Cleanup; goto Cleanup;
...@@ -745,7 +748,7 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info) ...@@ -745,7 +748,7 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info)
/* Open the channel */ /* Open the channel */
ret = vmbus_open(device->channel, net_driver->RingBufferSize, ret = vmbus_open(device->channel, net_driver->RingBufferSize,
net_driver->RingBufferSize, NULL, 0, net_driver->RingBufferSize, NULL, 0,
NetVscOnChannelCallback, device); netvsc_channel_cb, device);
if (ret != 0) { if (ret != 0) {
DPRINT_ERR(NETVSC, "unable to open channel: %d", ret); DPRINT_ERR(NETVSC, "unable to open channel: %d", ret);
...@@ -757,7 +760,7 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info) ...@@ -757,7 +760,7 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info)
DPRINT_INFO(NETVSC, "*** NetVSC channel opened successfully! ***"); DPRINT_INFO(NETVSC, "*** NetVSC channel opened successfully! ***");
/* Connect with the NetVsp */ /* Connect with the NetVsp */
ret = NetVscConnectToVsp(device); ret = netvsc_connect_vsp(device);
if (ret != 0) { if (ret != 0) {
DPRINT_ERR(NETVSC, "unable to connect to NetVSP - %d", ret); DPRINT_ERR(NETVSC, "unable to connect to NetVSP - %d", ret);
ret = -1; ret = -1;
...@@ -785,19 +788,19 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info) ...@@ -785,19 +788,19 @@ static int NetVscOnDeviceAdd(struct hv_device *device, void *additional_info)
kfree(packet); kfree(packet);
} }
ReleaseOutboundNetDevice(device); release_outbound_net_device(device);
ReleaseInboundNetDevice(device); release_inbound_net_device(device);
FreeNetDevice(net_device); free_net_device(net_device);
} }
return ret; return ret;
} }
/* /*
* NetVscOnDeviceRemove - Callback when the root bus device is removed * netvsc_device_remove - Callback when the root bus device is removed
*/ */
static int NetVscOnDeviceRemove(struct hv_device *device) static int netvsc_device_remove(struct hv_device *device)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct hv_netvsc_packet *netvsc_packet, *pos; struct hv_netvsc_packet *netvsc_packet, *pos;
...@@ -806,7 +809,7 @@ static int NetVscOnDeviceRemove(struct hv_device *device) ...@@ -806,7 +809,7 @@ static int NetVscOnDeviceRemove(struct hv_device *device)
device->Extension); device->Extension);
/* Stop outbound traffic ie sends and receives completions */ /* Stop outbound traffic ie sends and receives completions */
net_device = ReleaseOutboundNetDevice(device); net_device = release_outbound_net_device(device);
if (!net_device) { if (!net_device) {
DPRINT_ERR(NETVSC, "No net device present!!"); DPRINT_ERR(NETVSC, "No net device present!!");
return -1; return -1;
...@@ -827,7 +830,7 @@ static int NetVscOnDeviceRemove(struct hv_device *device) ...@@ -827,7 +830,7 @@ static int NetVscOnDeviceRemove(struct hv_device *device)
device->Extension); device->Extension);
/* Stop inbound traffic ie receives and sends completions */ /* Stop inbound traffic ie receives and sends completions */
net_device = ReleaseInboundNetDevice(device); net_device = release_inbound_net_device(device);
/* At this point, no one should be accessing netDevice except in here */ /* At this point, no one should be accessing netDevice except in here */
DPRINT_INFO(NETVSC, "net device (%p) safe to remove", net_device); DPRINT_INFO(NETVSC, "net device (%p) safe to remove", net_device);
...@@ -843,25 +846,25 @@ static int NetVscOnDeviceRemove(struct hv_device *device) ...@@ -843,25 +846,25 @@ static int NetVscOnDeviceRemove(struct hv_device *device)
} }
kfree(net_device->ChannelInitEvent); kfree(net_device->ChannelInitEvent);
FreeNetDevice(net_device); free_net_device(net_device);
return 0; return 0;
} }
/* /*
* NetVscOnCleanup - Perform any cleanup when the driver is removed * netvsc_cleanup - Perform any cleanup when the driver is removed
*/ */
static void NetVscOnCleanup(struct hv_driver *drv) static void netvsc_cleanup(struct hv_driver *drv)
{ {
} }
static void NetVscOnSendCompletion(struct hv_device *device, static void netvsc_send_completion(struct hv_device *device,
struct vmpacket_descriptor *packet) struct vmpacket_descriptor *packet)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
struct nvsp_message *nvsp_packet; struct nvsp_message *nvsp_packet;
struct hv_netvsc_packet *nvsc_packet; struct hv_netvsc_packet *nvsc_packet;
net_device = GetInboundNetDevice(device); net_device = get_inbound_net_device(device);
if (!net_device) { if (!net_device) {
DPRINT_ERR(NETVSC, "unable to get net device..." DPRINT_ERR(NETVSC, "unable to get net device..."
"device being destroyed?"); "device being destroyed?");
...@@ -900,10 +903,10 @@ static void NetVscOnSendCompletion(struct hv_device *device, ...@@ -900,10 +903,10 @@ static void NetVscOnSendCompletion(struct hv_device *device,
"%d received!!", nvsp_packet->Header.MessageType); "%d received!!", nvsp_packet->Header.MessageType);
} }
PutNetDevice(device); put_net_device(device);
} }
static int NetVscOnSend(struct hv_device *device, static int netvsc_send(struct hv_device *device,
struct hv_netvsc_packet *packet) struct hv_netvsc_packet *packet)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
...@@ -911,7 +914,7 @@ static int NetVscOnSend(struct hv_device *device, ...@@ -911,7 +914,7 @@ static int NetVscOnSend(struct hv_device *device,
struct nvsp_message sendMessage; struct nvsp_message sendMessage;
net_device = GetOutboundNetDevice(device); net_device = get_outbound_net_device(device);
if (!net_device) { if (!net_device) {
DPRINT_ERR(NETVSC, "net device (%p) shutting down..." DPRINT_ERR(NETVSC, "net device (%p) shutting down..."
"ignoring outbound packets", net_device); "ignoring outbound packets", net_device);
...@@ -952,11 +955,11 @@ static int NetVscOnSend(struct hv_device *device, ...@@ -952,11 +955,11 @@ static int NetVscOnSend(struct hv_device *device,
packet, ret); packet, ret);
atomic_inc(&net_device->NumOutstandingSends); atomic_inc(&net_device->NumOutstandingSends);
PutNetDevice(device); put_net_device(device);
return ret; return ret;
} }
static void NetVscOnReceive(struct hv_device *device, static void netvsc_receive(struct hv_device *device,
struct vmpacket_descriptor *packet) struct vmpacket_descriptor *packet)
{ {
struct netvsc_device *net_device; struct netvsc_device *net_device;
...@@ -972,7 +975,7 @@ static void NetVscOnReceive(struct hv_device *device, ...@@ -972,7 +975,7 @@ static void NetVscOnReceive(struct hv_device *device,
unsigned long flags; unsigned long flags;
LIST_HEAD(listHead); LIST_HEAD(listHead);
net_device = GetInboundNetDevice(device); net_device = get_inbound_net_device(device);
if (!net_device) { if (!net_device) {
DPRINT_ERR(NETVSC, "unable to get net device..." DPRINT_ERR(NETVSC, "unable to get net device..."
"device being destroyed?"); "device being destroyed?");
...@@ -986,7 +989,7 @@ static void NetVscOnReceive(struct hv_device *device, ...@@ -986,7 +989,7 @@ static void NetVscOnReceive(struct hv_device *device,
if (packet->Type != VmbusPacketTypeDataUsingTransferPages) { if (packet->Type != VmbusPacketTypeDataUsingTransferPages) {
DPRINT_ERR(NETVSC, "Unknown packet type received - %d", DPRINT_ERR(NETVSC, "Unknown packet type received - %d",
packet->Type); packet->Type);
PutNetDevice(device); put_net_device(device);
return; return;
} }
...@@ -998,7 +1001,7 @@ static void NetVscOnReceive(struct hv_device *device, ...@@ -998,7 +1001,7 @@ static void NetVscOnReceive(struct hv_device *device,
NvspMessage1TypeSendRNDISPacket) { NvspMessage1TypeSendRNDISPacket) {
DPRINT_ERR(NETVSC, "Unknown nvsp packet type received - %d", DPRINT_ERR(NETVSC, "Unknown nvsp packet type received - %d",
nvsp_packet->Header.MessageType); nvsp_packet->Header.MessageType);
PutNetDevice(device); put_net_device(device);
return; return;
} }
...@@ -1011,7 +1014,7 @@ static void NetVscOnReceive(struct hv_device *device, ...@@ -1011,7 +1014,7 @@ static void NetVscOnReceive(struct hv_device *device,
DPRINT_ERR(NETVSC, "Invalid xfer page set id - " DPRINT_ERR(NETVSC, "Invalid xfer page set id - "
"expecting %x got %x", NETVSC_RECEIVE_BUFFER_ID, "expecting %x got %x", NETVSC_RECEIVE_BUFFER_ID,
vmxferpage_packet->TransferPageSetId); vmxferpage_packet->TransferPageSetId);
PutNetDevice(device); put_net_device(device);
return; return;
} }
...@@ -1051,10 +1054,10 @@ static void NetVscOnReceive(struct hv_device *device, ...@@ -1051,10 +1054,10 @@ static void NetVscOnReceive(struct hv_device *device,
spin_unlock_irqrestore(&net_device->receive_packet_list_lock, spin_unlock_irqrestore(&net_device->receive_packet_list_lock,
flags); flags);
NetVscSendReceiveCompletion(device, netvsc_send_recv_completion(device,
vmxferpage_packet->d.TransactionId); vmxferpage_packet->d.TransactionId);
PutNetDevice(device); put_net_device(device);
return; return;
} }
...@@ -1081,7 +1084,7 @@ static void NetVscOnReceive(struct hv_device *device, ...@@ -1081,7 +1084,7 @@ static void NetVscOnReceive(struct hv_device *device,
/* Initialize the netvsc packet */ /* Initialize the netvsc packet */
netvsc_packet->XferPagePacket = xferpage_packet; netvsc_packet->XferPagePacket = xferpage_packet;
netvsc_packet->Completion.Recv.OnReceiveCompletion = netvsc_packet->Completion.Recv.OnReceiveCompletion =
NetVscOnReceiveCompletion; netvsc_receive_completion;
netvsc_packet->Completion.Recv.ReceiveCompletionContext = netvsc_packet->Completion.Recv.ReceiveCompletionContext =
netvsc_packet; netvsc_packet;
netvsc_packet->Device = device; netvsc_packet->Device = device;
...@@ -1153,16 +1156,16 @@ static void NetVscOnReceive(struct hv_device *device, ...@@ -1153,16 +1156,16 @@ static void NetVscOnReceive(struct hv_device *device,
((struct netvsc_driver *)device->Driver)-> ((struct netvsc_driver *)device->Driver)->
OnReceiveCallback(device, netvsc_packet); OnReceiveCallback(device, netvsc_packet);
NetVscOnReceiveCompletion(netvsc_packet-> netvsc_receive_completion(netvsc_packet->
Completion.Recv.ReceiveCompletionContext); Completion.Recv.ReceiveCompletionContext);
} }
/* ASSERT(list_empty(&listHead)); */ /* ASSERT(list_empty(&listHead)); */
PutNetDevice(device); put_net_device(device);
} }
static void NetVscSendReceiveCompletion(struct hv_device *device, static void netvsc_send_recv_completion(struct hv_device *device,
u64 transaction_id) u64 transaction_id)
{ {
struct nvsp_message recvcompMessage; struct nvsp_message recvcompMessage;
...@@ -1207,7 +1210,7 @@ static void NetVscSendReceiveCompletion(struct hv_device *device, ...@@ -1207,7 +1210,7 @@ static void NetVscSendReceiveCompletion(struct hv_device *device,
} }
/* Send a receive completion packet to RNDIS device (ie NetVsp) */ /* Send a receive completion packet to RNDIS device (ie NetVsp) */
static void NetVscOnReceiveCompletion(void *context) static void netvsc_receive_completion(void *context)
{ {
struct hv_netvsc_packet *packet = context; struct hv_netvsc_packet *packet = context;
struct hv_device *device = (struct hv_device *)packet->Device; struct hv_device *device = (struct hv_device *)packet->Device;
...@@ -1223,7 +1226,7 @@ static void NetVscOnReceiveCompletion(void *context) ...@@ -1223,7 +1226,7 @@ static void NetVscOnReceiveCompletion(void *context)
* send out receive completion, we are using GetInboundNetDevice() * send out receive completion, we are using GetInboundNetDevice()
* since we may have disable outbound traffic already. * since we may have disable outbound traffic already.
*/ */
net_device = GetInboundNetDevice(device); net_device = get_inbound_net_device(device);
if (!net_device) { if (!net_device) {
DPRINT_ERR(NETVSC, "unable to get net device..." DPRINT_ERR(NETVSC, "unable to get net device..."
"device being destroyed?"); "device being destroyed?");
...@@ -1254,12 +1257,12 @@ static void NetVscOnReceiveCompletion(void *context) ...@@ -1254,12 +1257,12 @@ static void NetVscOnReceiveCompletion(void *context)
/* Send a receive completion for the xfer page packet */ /* Send a receive completion for the xfer page packet */
if (fsend_receive_comp) if (fsend_receive_comp)
NetVscSendReceiveCompletion(device, transaction_id); netvsc_send_recv_completion(device, transaction_id);
PutNetDevice(device); put_net_device(device);
} }
static void NetVscOnChannelCallback(void *context) static void netvsc_channel_cb(void *context)
{ {
int ret; int ret;
struct hv_device *device = context; struct hv_device *device = context;
...@@ -1279,7 +1282,7 @@ static void NetVscOnChannelCallback(void *context) ...@@ -1279,7 +1282,7 @@ static void NetVscOnChannelCallback(void *context)
return; return;
buffer = packet; buffer = packet;
net_device = GetInboundNetDevice(device); net_device = get_inbound_net_device(device);
if (!net_device) { if (!net_device) {
DPRINT_ERR(NETVSC, "net device (%p) shutting down..." DPRINT_ERR(NETVSC, "net device (%p) shutting down..."
"ignoring inbound packets", net_device); "ignoring inbound packets", net_device);
...@@ -1297,11 +1300,11 @@ static void NetVscOnChannelCallback(void *context) ...@@ -1297,11 +1300,11 @@ static void NetVscOnChannelCallback(void *context)
desc = (struct vmpacket_descriptor *)buffer; desc = (struct vmpacket_descriptor *)buffer;
switch (desc->Type) { switch (desc->Type) {
case VmbusPacketTypeCompletion: case VmbusPacketTypeCompletion:
NetVscOnSendCompletion(device, desc); netvsc_send_completion(device, desc);
break; break;
case VmbusPacketTypeDataUsingTransferPages: case VmbusPacketTypeDataUsingTransferPages:
NetVscOnReceive(device, desc); netvsc_receive(device, desc);
break; break;
default: default:
...@@ -1344,7 +1347,7 @@ static void NetVscOnChannelCallback(void *context) ...@@ -1344,7 +1347,7 @@ static void NetVscOnChannelCallback(void *context)
} }
} while (1); } while (1);
PutNetDevice(device); put_net_device(device);
out: out:
kfree(buffer); kfree(buffer);
return; return;
......
...@@ -109,7 +109,7 @@ struct netvsc_device_info { ...@@ -109,7 +109,7 @@ struct netvsc_device_info {
}; };
/* Interface */ /* Interface */
int NetVscInitialize(struct hv_driver *drv); int netvsc_initialize(struct hv_driver *drv);
int RndisFilterOnOpen(struct hv_device *Device); int RndisFilterOnOpen(struct hv_device *Device);
int RndisFilterOnClose(struct hv_device *Device); int RndisFilterOnClose(struct hv_device *Device);
......
...@@ -539,7 +539,7 @@ static int __init netvsc_init(void) ...@@ -539,7 +539,7 @@ static int __init netvsc_init(void)
if (!dmi_check_system(hv_netvsc_dmi_table)) if (!dmi_check_system(hv_netvsc_dmi_table))
return -ENODEV; return -ENODEV;
return netvsc_drv_init(NetVscInitialize); return netvsc_drv_init(netvsc_initialize);
} }
static void __exit netvsc_exit(void) static void __exit netvsc_exit(void)
......
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