Commit graph

14 commits

Author SHA1 Message Date
Dmitry Fleytman
76299389ce ControlIrp: Clear event state prior to sending IRP
This is needed in case client sends the same IRP
for a few times.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2017-02-08 13:00:16 +02:00
Pavel Gurvich
f36902947a Revert "UsbDk: Fix never completed IOCTLs issue"
This reverts commit eb1e6fc61d.

The fix is not needed. The problem observed was related to HW.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-08-20 17:28:51 +03:00
Pavel Gurvich
eb1e6fc61d UsbDk: Fix never completed IOCTLs issue
In some cases driver sends IOCTLS to the underlying devices.
It uses IoBuildDeviceIoControlRequest() function to allocate
IOCTL IRP.

This function allocates threaded IRP which has a number of
limitations for contexts it may be sent from.
In particular it must be sent from PASSIVE_LEVEL
and non-arbitrary thread context to complete successfully.

Since this is not always true for contexts driver sends IRPs from,
never completed IOCTLs were observed on load tests.

This patch fixes the problem by using IoAllocateIrp()
function to allocate IOCTL IRPs.

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-08-17 09:30:53 +03:00
Dmitry Fleytman
d5d51dfd47 UsbDk: place all system includes into stdafx.h
This makes include policy more strict and ensures
all system includes properly wrapped with extern "C"

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-06-09 11:50:26 +03:00
Pavel Gurvich
a77d8161e4 UsbDk: Add license-related files and headers
Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-20 11:56:20 +03:00
Dmitry Fleytman
a7cd673ab3 UsbDk: Fix invalid status returned for IOCTL IRPs
API doesn't fill IOSTATUS->STATUS field when IRP
processing finished synchronously. In this case IoCallDriver
returns proper status directly.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
94a5284e2c UsbDk: Fix verifier BSOD in CIrp
For some requests API requires iostatus->status
IRP field to be initialized with STATUS_NOT_SUPPORTED.

Driver verifier checks this and produces BSOD on violation.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
fada79a253 UsbDk: Introduce CIrp::ForwardAndWait
A generic function for sending IRP synchronously

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Dmitry Fleytman
fe447f627d UsbDk: CIrp: Set event for async. completions only
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:12 +03:00
Pavel Gurvich
395491d18d UsbDk: Introduce class for DeviceIoControl IRPs
class CIoControlIrp added

Signed-off-by: Pavel Gurvich <pavel@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
d2dc75c14b UsbDk: Fix CIrp cleanup
Do not hold target device reference in case IRP allocation failure

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
dd4cfefbe9 UsbDk: CIrp beautifications
NULL --> nullptr
VOID --> void

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
a60dffc87a UsbDk: Make CIrp use CWdmEvent
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:10 +03:00
Dmitry Fleytman
6749f9e714 UsbDk: Introduce CIrp class
CIrp is a wrapper for WDM IRP data structure
and related logic

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2014-05-11 19:26:09 +03:00