diff options
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/hv/netvsc.c | 79 |
1 files changed, 35 insertions, 44 deletions
diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c index 71a8dbaaefa..be3825690a2 100644 --- a/drivers/staging/hv/netvsc.c +++ b/drivers/staging/hv/netvsc.c | |||
@@ -263,12 +263,11 @@ static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *Device) | |||
263 | initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID; | 263 | initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID; |
264 | 264 | ||
265 | /* Send the gpadl notification request */ | 265 | /* Send the gpadl notification request */ |
266 | ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, | 266 | ret = vmbus_sendpacket(Device->channel, initPacket, |
267 | initPacket, | 267 | sizeof(struct nvsp_message), |
268 | sizeof(struct nvsp_message), | 268 | (unsigned long)initPacket, |
269 | (unsigned long)initPacket, | 269 | VmbusPacketTypeDataInBand, |
270 | VmbusPacketTypeDataInBand, | 270 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); |
271 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); | ||
272 | if (ret != 0) { | 271 | if (ret != 0) { |
273 | DPRINT_ERR(NETVSC, | 272 | DPRINT_ERR(NETVSC, |
274 | "unable to send receive buffer's gpadl to netvsp"); | 273 | "unable to send receive buffer's gpadl to netvsp"); |
@@ -390,11 +389,11 @@ static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *Device) | |||
390 | initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_SEND_BUFFER_ID; | 389 | initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_SEND_BUFFER_ID; |
391 | 390 | ||
392 | /* Send the gpadl notification request */ | 391 | /* Send the gpadl notification request */ |
393 | ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, | 392 | ret = vmbus_sendpacket(Device->channel, initPacket, |
394 | initPacket, sizeof(struct nvsp_message), | 393 | sizeof(struct nvsp_message), |
395 | (unsigned long)initPacket, | 394 | (unsigned long)initPacket, |
396 | VmbusPacketTypeDataInBand, | 395 | VmbusPacketTypeDataInBand, |
397 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); | 396 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); |
398 | if (ret != 0) { | 397 | if (ret != 0) { |
399 | DPRINT_ERR(NETVSC, | 398 | DPRINT_ERR(NETVSC, |
400 | "unable to send receive buffer's gpadl to netvsp"); | 399 | "unable to send receive buffer's gpadl to netvsp"); |
@@ -446,12 +445,10 @@ static int NetVscDestroyReceiveBuffer(struct netvsc_device *NetDevice) | |||
446 | revokePacket->Header.MessageType = NvspMessage1TypeRevokeReceiveBuffer; | 445 | revokePacket->Header.MessageType = NvspMessage1TypeRevokeReceiveBuffer; |
447 | revokePacket->Messages.Version1Messages.RevokeReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID; | 446 | revokePacket->Messages.Version1Messages.RevokeReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID; |
448 | 447 | ||
449 | ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket( | 448 | ret = vmbus_sendpacket(NetDevice->Device->channel, revokePacket, |
450 | NetDevice->Device, | 449 | sizeof(struct nvsp_message), |
451 | revokePacket, | 450 | (unsigned long)revokePacket, |
452 | sizeof(struct nvsp_message), | 451 | VmbusPacketTypeDataInBand, 0); |
453 | (unsigned long)revokePacket, | ||
454 | VmbusPacketTypeDataInBand, 0); | ||
455 | /* | 452 | /* |
456 | * If we failed here, we might as well return and | 453 | * If we failed here, we might as well return and |
457 | * have a leak rather than continue and a bugchk | 454 | * have a leak rather than continue and a bugchk |
@@ -519,11 +516,10 @@ static int NetVscDestroySendBuffer(struct netvsc_device *NetDevice) | |||
519 | revokePacket->Header.MessageType = NvspMessage1TypeRevokeSendBuffer; | 516 | revokePacket->Header.MessageType = NvspMessage1TypeRevokeSendBuffer; |
520 | revokePacket->Messages.Version1Messages.RevokeSendBuffer.Id = NETVSC_SEND_BUFFER_ID; | 517 | revokePacket->Messages.Version1Messages.RevokeSendBuffer.Id = NETVSC_SEND_BUFFER_ID; |
521 | 518 | ||
522 | ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device, | 519 | ret = vmbus_sendpacket(NetDevice->Device->channel, revokePacket, |
523 | revokePacket, | 520 | sizeof(struct nvsp_message), |
524 | sizeof(struct nvsp_message), | 521 | (unsigned long)revokePacket, |
525 | (unsigned long)revokePacket, | 522 | VmbusPacketTypeDataInBand, 0); |
526 | VmbusPacketTypeDataInBand, 0); | ||
527 | /* | 523 | /* |
528 | * If we failed here, we might as well return and have a leak | 524 | * If we failed here, we might as well return and have a leak |
529 | * rather than continue and a bugchk | 525 | * rather than continue and a bugchk |
@@ -590,12 +586,11 @@ static int NetVscConnectToVsp(struct hv_device *Device) | |||
590 | DPRINT_INFO(NETVSC, "Sending NvspMessageTypeInit..."); | 586 | DPRINT_INFO(NETVSC, "Sending NvspMessageTypeInit..."); |
591 | 587 | ||
592 | /* Send the init request */ | 588 | /* Send the init request */ |
593 | ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, | 589 | ret = vmbus_sendpacket(Device->channel, initPacket, |
594 | initPacket, | 590 | sizeof(struct nvsp_message), |
595 | sizeof(struct nvsp_message), | 591 | (unsigned long)initPacket, |
596 | (unsigned long)initPacket, | 592 | VmbusPacketTypeDataInBand, |
597 | VmbusPacketTypeDataInBand, | 593 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); |
598 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); | ||
599 | 594 | ||
600 | if (ret != 0) { | 595 | if (ret != 0) { |
601 | DPRINT_ERR(NETVSC, "unable to send NvspMessageTypeInit"); | 596 | DPRINT_ERR(NETVSC, "unable to send NvspMessageTypeInit"); |
@@ -640,11 +635,10 @@ static int NetVscConnectToVsp(struct hv_device *Device) | |||
640 | ndisVersion & 0xFFFF; | 635 | ndisVersion & 0xFFFF; |
641 | 636 | ||
642 | /* Send the init request */ | 637 | /* Send the init request */ |
643 | ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, | 638 | ret = vmbus_sendpacket(Device->channel, initPacket, |
644 | initPacket, | 639 | sizeof(struct nvsp_message), |
645 | sizeof(struct nvsp_message), | 640 | (unsigned long)initPacket, |
646 | (unsigned long)initPacket, | 641 | VmbusPacketTypeDataInBand, 0); |
647 | VmbusPacketTypeDataInBand, 0); | ||
648 | if (ret != 0) { | 642 | if (ret != 0) { |
649 | DPRINT_ERR(NETVSC, | 643 | DPRINT_ERR(NETVSC, |
650 | "unable to send NvspMessage1TypeSendNdisVersion"); | 644 | "unable to send NvspMessage1TypeSendNdisVersion"); |
@@ -919,12 +913,11 @@ static int NetVscOnSend(struct hv_device *Device, | |||
919 | sizeof(struct nvsp_message), | 913 | sizeof(struct nvsp_message), |
920 | (unsigned long)Packet); | 914 | (unsigned long)Packet); |
921 | } else { | 915 | } else { |
922 | ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, | 916 | ret = vmbus_sendpacket(Device->channel, &sendMessage, |
923 | &sendMessage, | 917 | sizeof(struct nvsp_message), |
924 | sizeof(struct nvsp_message), | 918 | (unsigned long)Packet, |
925 | (unsigned long)Packet, | 919 | VmbusPacketTypeDataInBand, |
926 | VmbusPacketTypeDataInBand, | 920 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); |
927 | VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); | ||
928 | 921 | ||
929 | } | 922 | } |
930 | 923 | ||
@@ -1152,11 +1145,9 @@ static void NetVscSendReceiveCompletion(struct hv_device *Device, | |||
1152 | 1145 | ||
1153 | retry_send_cmplt: | 1146 | retry_send_cmplt: |
1154 | /* Send the completion */ | 1147 | /* Send the completion */ |
1155 | ret = Device->Driver->VmbusChannelInterface.SendPacket(Device, | 1148 | ret = vmbus_sendpacket(Device->channel, &recvcompMessage, |
1156 | &recvcompMessage, | 1149 | sizeof(struct nvsp_message), TransactionId, |
1157 | sizeof(struct nvsp_message), | 1150 | VmbusPacketTypeCompletion, 0); |
1158 | TransactionId, | ||
1159 | VmbusPacketTypeCompletion, 0); | ||
1160 | if (ret == 0) { | 1151 | if (ret == 0) { |
1161 | /* success */ | 1152 | /* success */ |
1162 | /* no-op */ | 1153 | /* no-op */ |