Commit Graph

322 Commits

Author SHA1 Message Date
Jason A. Donenfeld
64c408a2e4 Don't discard unfitting NBLs and fix prepend ref counting
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-28 08:30:37 +01:00
Simon Rozman
9294d4b498 Fix uninitialized status and remove redundant locking in TunQueueProcess
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-28 07:41:44 +01:00
Simon Rozman
5e87977cf8 Kill some more Camels
Disclaimer: No animals were hurt in this commit.

Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-28 07:41:43 +01:00
Jason A. Donenfeld
03a45fb768 Better ctx management
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-27 17:16:35 +01:00
Jason A. Donenfeld
51f9f59ea9 Further specify LUID member 2019-03-27 16:13:00 +01:00
Simon Rozman
7c6591b4f6 Update documentation
Device name actually uses LUID index only. Not an entire LUID. IfType
in LUID is always 53 (IF_TYPE_PROP_VIRTUAL).

Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-27 15:18:37 +01:00
Simon Rozman
015999430f Simplify adapter context extraction from device extension
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-27 15:18:37 +01:00
Simon Rozman
b157105c58 Revise adapter pausing
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-27 13:47:38 +01:00
Jason A. Donenfeld
2ee3a99690 Add basic usage info
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-27 11:44:15 +01:00
Simon Rozman
269007f606 Kill some more Camels
Disclaimer: No animals were hurt in this commit.

Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-27 10:12:53 +01:00
Simon Rozman
894a7f54a1 Upgrade TunNBLRefDec() to provide IRQL hints to NDIS
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-27 09:18:47 +01:00
Jason A. Donenfeld
0dac9b2bc7 Use CSQ instead of StartIO
This also introduces a proper queueing and refcounting system, which
should increase performance and allow for IRP cancelation.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-27 09:00:19 +01:00
Jason A. Donenfeld
ce9936089c Add description of IO_CSQ algorithms
Remove this file when this is done.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-26 08:01:50 +01:00
Simon Rozman
9704a4d11f Terminate device connection on NDIS pause
If device connection is not terminated on NDIS pause, the driver doesn't
unload when adapter is disabled. This also prevents driver updates
without reboot.

Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22 16:52:31 -06:00
Simon Rozman
9fbc8091ab Add some basic assert checks
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22 16:52:31 -06:00
Simon Rozman
b6f0e07c2f Unify and revise NDIS pause checks
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22 16:52:31 -06:00
Simon Rozman
d6dfda0421 Rename ActiveNBLCount to ActiveTransactionCount
We are not using this counter for NBL counting only.

Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22 16:52:31 -06:00
Simon Rozman
775386173c Enable better debugging support for Debug driver builds
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22 16:52:31 -06:00
Simon Rozman
2e35974a24 Fix ActiveNBLCount management in TunDispatchWrite()
The ActiveNBLCount must be bumped _before_ adapter state is checked.
Otherwise, there is a window of code that may allow adapter transition
from pausing to paused state, followed by a
NdisMIndicateReceiveNetBufferLists() call.

Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22 16:52:31 -06:00
Simon Rozman
999cfaabcc Optimize ActiveNBLCount management in TunSendNetBufferLists
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22 16:52:31 -06:00
Simon Rozman
a9afa3a692 Fix the UAF issue with premature MDL release in IRP_MJ_WRITE
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22 16:52:31 -06:00
Jason A. Donenfeld
03479caf9d Initial commit
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-03-22 16:52:31 -06:00