Skip to content

Commit

Permalink
Merge pull request #34 from meisners/fix-wlan-v4v
Browse files Browse the repository at this point in the history
Remove use of V4V from WLAN driver
  • Loading branch information
jean-edouard authored Jul 14, 2017
2 parents 8933def + c7751ec commit 35b1449
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 6 deletions.
3 changes: 2 additions & 1 deletion inc/v4vkapi.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#ifdef USE_V4V
//
// v4vkm.h - Xen Windows XenGfx v4v
//
Expand Down Expand Up @@ -582,4 +583,4 @@ XenV4VDestroy(PXEN_V4V pV4v)
ExFreePoolWithTag(pV4v, XENV4V_TAG );
}
}

#endif
10 changes: 10 additions & 0 deletions wnet/xenwnet6/receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ ReceiverReleaseNetBufferList (
/* The net buffer will be automatically released when the net
buffer list is, but we still need to clean it up. */
mdl = NET_BUFFER_FIRST_MDL(buffer);
#ifdef USE_V4V
if ((mdl != Receiver->V4vRxBufMdl) && (mdl->Next != Receiver->V4vRxBufMdl))
#endif
ReceiverCommonReleaseMdlChain(&Receiver->Common,
NET_BUFFER_FIRST_MDL(buffer));

Expand Down Expand Up @@ -752,11 +754,17 @@ ReceiverReceiveBufferList (
}
else
{
#ifdef USE_V4V
Flags = 0; //@@@ This seems like possibly a bad idea...
buffer = Receiver->V4vRxBufMdl;
totOctets = Receiver->V4vBytesReceived;
totFrags = 1;
buffer_length = Receiver->V4vBytesReceived;
#else
XM_BUGCHECK_TYPE_ASSERT;
// Avoid compiler error:
buffer = &headRfd->Mdl;
#endif
}
ethernetHeader = (struct ethhdr *)buffer->MappedSystemVa;
if (!AdapterIsMacAddressInteresting(Receiver->Common.Adapter,
Expand Down Expand Up @@ -802,6 +810,7 @@ ReceiverReceiveBufferList (
*BufferList = NULL;
}

#ifdef USE_V4V
VOID
ReceiverHandleV4vPacket (
IN PRECEIVER Receiver
Expand Down Expand Up @@ -867,6 +876,7 @@ ReceiverHandleV4vPacket (

return;
}
#endif

VOID
ReceiverHandleNotification (
Expand Down
4 changes: 4 additions & 0 deletions wnet/xenwnet6/receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ typedef struct _RECEIVER {
ULONG nRxTcpUdpCsumOffload;
ULONG nRxTcpUdpCsumFixup;

#ifdef USE_V4V
ULONG V4vBytesReceived;
PMDL V4vRxBufMdl;
#endif

/* Do we expect Windows to be able to handle a csum_blank
* packet? */
Expand Down Expand Up @@ -121,10 +123,12 @@ ReceiverCleanup (
BOOLEAN TearDown
);

#ifdef USE_V4V
VOID
ReceiverHandleV4vPacket (
IN PRECEIVER Receiver
);
#endif

VOID
ReceiverHandleNotification (
Expand Down
7 changes: 6 additions & 1 deletion wnet/xenwnet6/transmitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,8 @@ TransmitterSend (
PXENNET_NET_BUFFER_RESERVED xennetBuffer;
ULONG sent;

UNREFERENCED_PARAMETER(dpcLevel);

sent = 0;

entry = Transmitter->QueuedList.Flink;
Expand All @@ -1363,6 +1365,7 @@ TransmitterSend (
(ULONG_PTR)netBuffer, xennetBuffer->State);

if (xennetBuffer->State == Prepared) {
#ifdef USE_V4V
if (xennetBuffer->EapPacket)
{
NTSTATUS status;
Expand Down Expand Up @@ -1407,7 +1410,9 @@ TransmitterSend (
Transmitter->CompletedFrames++;
xennetBuffer->State = Completed;
}
else if (!TransmitterSendNetBuffer(Transmitter, netBuffer)) {
else
#endif
if (!TransmitterSendNetBuffer(Transmitter, netBuffer)) {
nbl_log(netBufferList, NBL_TRANSMITTER_SEND_FAILED,
(ULONG_PTR)netBuffer);
goto done;
Expand Down
6 changes: 6 additions & 0 deletions wnet/xenwnet6/wlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ WlanAdapterDefaults (
sizeof(DOT11_STATISTICS));
}

#ifdef USE_V4V
NTSTATUS
WlanV4vConnect(
IN PADAPTER Adapter
Expand Down Expand Up @@ -606,6 +607,7 @@ WlanV4vWorkItem (
TraceNotice (("V4VDG asynchronous datagram receiver exit\n"));
PsTerminateSystemThread(STATUS_SUCCESS);
}
#endif

NDIS_STATUS
WlanAdapterInitialize (
Expand Down Expand Up @@ -663,6 +665,7 @@ WlanAdapterInitialize (
pwa->OperationModeCapability.uNumOfRXBuffers = 64;
pwa->OperationModeCapability.uOpModeCapability = DOT11_OPERATION_MODE_EXTENSIBLE_STATION | DOT11_OPERATION_MODE_NETWORK_MONITOR;

#ifdef USE_V4V
//
// V4V stuff
//
Expand All @@ -671,6 +674,7 @@ WlanAdapterInitialize (
INVALID_HANDLE_VALUE, NULL,
WlanV4vWorkItem, Adapter);
//
#endif

/* Setup the main 802.11 attributes */
return WlanSet80211Attributes(Adapter);
Expand All @@ -690,6 +694,7 @@ WlanAdapterDelete (
return;
}

#ifdef USE_V4V
//
// V4V stuff
//
Expand All @@ -702,6 +707,7 @@ WlanAdapterDelete (
if (pwa->V4vThread) ZwClose (pwa->V4vThread); pwa->V4vThread = NULL;
TraceNotice (("[V4VDG]: V4VDG work item has cleaned up and exited\n"));
//
#endif

do {
NdisAcquireSpinLock(&(pwa->Lock));
Expand Down
6 changes: 4 additions & 2 deletions wnet/xenwnet6/wlan_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@

typedef struct _V4V_CONFIG {

#ifdef USE_V4V
PXEN_V4V V4v;
#endif

ULONG txSize;
ULONG rxSize;
Expand All @@ -70,8 +72,8 @@ typedef struct _V4V_CONFIG {
ULONG seqnum;
ULONG seqrx;
ULONG status;
BOOL ack;
BOOL done;
BOOLEAN ack;
BOOLEAN done;
} dfile;
} r;
} V4V_CONFIG, *PV4V_CONFIG;
Expand Down
4 changes: 2 additions & 2 deletions wnet/xenwnet6/xenwnet6.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\inc;..\..\xenhdrs;C:\WinDDK\6001.18002\inc\ddk"
PreprocessorDefinitions="NDIS60_MINIPORT;XEN_WIRELESS;USE_V4V"
PreprocessorDefinitions="NDIS60_MINIPORT;XEN_WIRELESS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
Expand Down Expand Up @@ -116,7 +116,7 @@
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\..\inc;..\..\xenhdrs;C:\WinDDK\6001.18002\inc\ddk"
PreprocessorDefinitions="NDIS60_MINIPORT;XEN_WIRELESS;USE_V4V"
PreprocessorDefinitions="NDIS60_MINIPORT;XEN_WIRELESS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
Expand Down

0 comments on commit 35b1449

Please sign in to comment.