mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-23 18:07:03 +00:00
Staging: hv: netvsc: call vmbus_sendpacket directly
Don't do the interface indirection, it's not needed at all. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
b3289aa819
commit
5a4df29058
@ -263,12 +263,11 @@ static int NetVscInitializeReceiveBufferWithNetVsp(struct hv_device *Device)
|
|||||||
initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID;
|
initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID;
|
||||||
|
|
||||||
/* Send the gpadl notification request */
|
/* Send the gpadl notification request */
|
||||||
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
|
ret = vmbus_sendpacket(Device->channel, initPacket,
|
||||||
initPacket,
|
sizeof(struct nvsp_message),
|
||||||
sizeof(struct nvsp_message),
|
(unsigned long)initPacket,
|
||||||
(unsigned long)initPacket,
|
VmbusPacketTypeDataInBand,
|
||||||
VmbusPacketTypeDataInBand,
|
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
||||||
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
DPRINT_ERR(NETVSC,
|
DPRINT_ERR(NETVSC,
|
||||||
"unable to send receive buffer's gpadl to netvsp");
|
"unable to send receive buffer's gpadl to netvsp");
|
||||||
@ -390,11 +389,11 @@ static int NetVscInitializeSendBufferWithNetVsp(struct hv_device *Device)
|
|||||||
initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_SEND_BUFFER_ID;
|
initPacket->Messages.Version1Messages.SendReceiveBuffer.Id = NETVSC_SEND_BUFFER_ID;
|
||||||
|
|
||||||
/* Send the gpadl notification request */
|
/* Send the gpadl notification request */
|
||||||
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
|
ret = vmbus_sendpacket(Device->channel, initPacket,
|
||||||
initPacket, sizeof(struct nvsp_message),
|
sizeof(struct nvsp_message),
|
||||||
(unsigned long)initPacket,
|
(unsigned long)initPacket,
|
||||||
VmbusPacketTypeDataInBand,
|
VmbusPacketTypeDataInBand,
|
||||||
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
DPRINT_ERR(NETVSC,
|
DPRINT_ERR(NETVSC,
|
||||||
"unable to send receive buffer's gpadl to netvsp");
|
"unable to send receive buffer's gpadl to netvsp");
|
||||||
@ -446,12 +445,10 @@ static int NetVscDestroyReceiveBuffer(struct netvsc_device *NetDevice)
|
|||||||
revokePacket->Header.MessageType = NvspMessage1TypeRevokeReceiveBuffer;
|
revokePacket->Header.MessageType = NvspMessage1TypeRevokeReceiveBuffer;
|
||||||
revokePacket->Messages.Version1Messages.RevokeReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID;
|
revokePacket->Messages.Version1Messages.RevokeReceiveBuffer.Id = NETVSC_RECEIVE_BUFFER_ID;
|
||||||
|
|
||||||
ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(
|
ret = vmbus_sendpacket(NetDevice->Device->channel, revokePacket,
|
||||||
NetDevice->Device,
|
sizeof(struct nvsp_message),
|
||||||
revokePacket,
|
(unsigned long)revokePacket,
|
||||||
sizeof(struct nvsp_message),
|
VmbusPacketTypeDataInBand, 0);
|
||||||
(unsigned long)revokePacket,
|
|
||||||
VmbusPacketTypeDataInBand, 0);
|
|
||||||
/*
|
/*
|
||||||
* If we failed here, we might as well return and
|
* If we failed here, we might as well return and
|
||||||
* have a leak rather than continue and a bugchk
|
* have a leak rather than continue and a bugchk
|
||||||
@ -519,11 +516,10 @@ static int NetVscDestroySendBuffer(struct netvsc_device *NetDevice)
|
|||||||
revokePacket->Header.MessageType = NvspMessage1TypeRevokeSendBuffer;
|
revokePacket->Header.MessageType = NvspMessage1TypeRevokeSendBuffer;
|
||||||
revokePacket->Messages.Version1Messages.RevokeSendBuffer.Id = NETVSC_SEND_BUFFER_ID;
|
revokePacket->Messages.Version1Messages.RevokeSendBuffer.Id = NETVSC_SEND_BUFFER_ID;
|
||||||
|
|
||||||
ret = NetDevice->Device->Driver->VmbusChannelInterface.SendPacket(NetDevice->Device,
|
ret = vmbus_sendpacket(NetDevice->Device->channel, revokePacket,
|
||||||
revokePacket,
|
sizeof(struct nvsp_message),
|
||||||
sizeof(struct nvsp_message),
|
(unsigned long)revokePacket,
|
||||||
(unsigned long)revokePacket,
|
VmbusPacketTypeDataInBand, 0);
|
||||||
VmbusPacketTypeDataInBand, 0);
|
|
||||||
/*
|
/*
|
||||||
* If we failed here, we might as well return and have a leak
|
* If we failed here, we might as well return and have a leak
|
||||||
* rather than continue and a bugchk
|
* rather than continue and a bugchk
|
||||||
@ -590,12 +586,11 @@ static int NetVscConnectToVsp(struct hv_device *Device)
|
|||||||
DPRINT_INFO(NETVSC, "Sending NvspMessageTypeInit...");
|
DPRINT_INFO(NETVSC, "Sending NvspMessageTypeInit...");
|
||||||
|
|
||||||
/* Send the init request */
|
/* Send the init request */
|
||||||
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
|
ret = vmbus_sendpacket(Device->channel, initPacket,
|
||||||
initPacket,
|
sizeof(struct nvsp_message),
|
||||||
sizeof(struct nvsp_message),
|
(unsigned long)initPacket,
|
||||||
(unsigned long)initPacket,
|
VmbusPacketTypeDataInBand,
|
||||||
VmbusPacketTypeDataInBand,
|
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
||||||
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
DPRINT_ERR(NETVSC, "unable to send NvspMessageTypeInit");
|
DPRINT_ERR(NETVSC, "unable to send NvspMessageTypeInit");
|
||||||
@ -640,11 +635,10 @@ static int NetVscConnectToVsp(struct hv_device *Device)
|
|||||||
ndisVersion & 0xFFFF;
|
ndisVersion & 0xFFFF;
|
||||||
|
|
||||||
/* Send the init request */
|
/* Send the init request */
|
||||||
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
|
ret = vmbus_sendpacket(Device->channel, initPacket,
|
||||||
initPacket,
|
sizeof(struct nvsp_message),
|
||||||
sizeof(struct nvsp_message),
|
(unsigned long)initPacket,
|
||||||
(unsigned long)initPacket,
|
VmbusPacketTypeDataInBand, 0);
|
||||||
VmbusPacketTypeDataInBand, 0);
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
DPRINT_ERR(NETVSC,
|
DPRINT_ERR(NETVSC,
|
||||||
"unable to send NvspMessage1TypeSendNdisVersion");
|
"unable to send NvspMessage1TypeSendNdisVersion");
|
||||||
@ -919,12 +913,11 @@ static int NetVscOnSend(struct hv_device *Device,
|
|||||||
sizeof(struct nvsp_message),
|
sizeof(struct nvsp_message),
|
||||||
(unsigned long)Packet);
|
(unsigned long)Packet);
|
||||||
} else {
|
} else {
|
||||||
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
|
ret = vmbus_sendpacket(Device->channel, &sendMessage,
|
||||||
&sendMessage,
|
sizeof(struct nvsp_message),
|
||||||
sizeof(struct nvsp_message),
|
(unsigned long)Packet,
|
||||||
(unsigned long)Packet,
|
VmbusPacketTypeDataInBand,
|
||||||
VmbusPacketTypeDataInBand,
|
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
||||||
VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1152,11 +1145,9 @@ static void NetVscSendReceiveCompletion(struct hv_device *Device,
|
|||||||
|
|
||||||
retry_send_cmplt:
|
retry_send_cmplt:
|
||||||
/* Send the completion */
|
/* Send the completion */
|
||||||
ret = Device->Driver->VmbusChannelInterface.SendPacket(Device,
|
ret = vmbus_sendpacket(Device->channel, &recvcompMessage,
|
||||||
&recvcompMessage,
|
sizeof(struct nvsp_message), TransactionId,
|
||||||
sizeof(struct nvsp_message),
|
VmbusPacketTypeCompletion, 0);
|
||||||
TransactionId,
|
|
||||||
VmbusPacketTypeCompletion, 0);
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
/* success */
|
/* success */
|
||||||
/* no-op */
|
/* no-op */
|
||||||
|
Loading…
Reference in New Issue
Block a user