Commit graph

576 commits

Author SHA1 Message Date
Dmitry Fleytman
f01408384a UsbDk: Simplify and refactor filter attachment code
This is a refactoring commit, no functional changes introduced.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-06-29 17:32:09 +03:00
Dmitry Fleytman
0b7487ba56 UsbDk: Retire old hiding logic
This commit retires old device hider logic based
on wiping PDOs from BusRelations array.

Previous commits introduce new logic based on IDs
patching.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-06-29 17:32:05 +03:00
Dmitry Fleytman
a9bbb929f5 UsbDk: Implement hider logic via patching device IDs
Wiping PDOs from BusRelations list has side effect
of absence of hotplug events from the OS.

This is not good for applications that want devices
appear hidden and start redirection process on plug
at the same time.

Following patches will retire old hiding logic.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-06-29 17:32:00 +03:00
Dmitry Fleytman
c80effc7dd UsbDk: Introduce hider strategy class
This class will be used by following patches to
implement hiding via patching device IDs.

See commit messages of corresponfing patches
for rationale.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-06-29 17:31:55 +03:00
Dmitry Fleytman
b354d0ea35 UsbDk: Trivial: Remove comments numbering
It is ridiculous to update numbering manually after
each change in that function.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-06-29 17:31:50 +03:00
Dmitry Fleytman
eadd31b315 UsbTarget: Trivial: Remove m_ prefix from stack variables names
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-03-09 11:03:26 +02:00
Dmitry Fleytman
0a4f4811bc RedirectorStrategy: Add request counters to traces
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-02-10 12:03:39 +02:00
Dmitry Fleytman
074128a491 Utils: Introduce CAtomicCounter class
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-02-10 11:59:49 +02:00
Dmitry Fleytman
3d0a2050b3 UsbTarget: Introduce TargetRequest class
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-02-10 11:02:14 +02:00
Dmitry Fleytman
603d98e602 FilterDevice: Use generic WDF request context
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-02-10 10:56:23 +02:00
Dmitry Fleytman
32e08302d0 WdfRequest: Introduce generic request context
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-02-10 10:56:22 +02:00
Dmitry Fleytman
346554ff0c RedirectorStrategy: Use more specific type for request objects
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-02-10 10:56:21 +02:00
Dmitry Fleytman
44e3837eff RedirectorStrategy: Replace explicit type names with auto where possible
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-02-10 10:56:09 +02:00
Dmitry Fleytman
fa23267405 DeviceAccess: Drop UsbDkWdmUsbDeviceIsHub
This function is not used anymore.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-01-28 15:55:11 +02:00
Dmitry Fleytman
6b21ddc78c FilterDevice: Use cached device descriptor for strategy selection
Querying device descriptor fails in that context.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-01-28 15:53:35 +02:00
Dmitry Fleytman
4f1bec2125 ControlDevice: Add method for device descriptor retrieval
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-01-28 14:57:47 +02:00
Leonid Bloch
50a1e5058d Documentation: Include directions for older versions of Windows in WDF log dumping manual
Signed-off-by: Leonid Bloch <leonid@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-01-27 09:52:13 +02:00
Dmitry Fleytman
82b9a59bc4 UsbDk: Introduce tracing for BusRelations processing
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-01-25 15:05:59 +02:00
Dmitry Fleytman
c0b12e7678 Documentation: Improve WDF log dumping manual
Changes are based on users experience.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-01-25 11:52:42 +02:00
Leonid Bloch
98cf4d7298 UsbDk: Added documentation on WDF log generation
Also added a .reg file to quickly add the registry settings needed for
the log generation.

Signed-off-by: Leonid Bloch <leonid@daynix.com>
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-01-21 14:24:48 +02:00
Dmitry Fleytman
c573972ff1 RedirectorStrategy: Do not report STALL conditions on control pipe
STALL condition on control pipe cleared automatically
by underlying infrastructure. Do not report it to client
otherwise it may decide to clear it via ResetPipe and
reset of control pipe is not supported by WDF.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-01-14 11:30:59 +02:00
Dmitry Fleytman
0fbeb04527 UsbDk: Trivial: Minor comments fix
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2016-01-14 10:45:44 +02:00
Dmitry Fleytman
60fb3fc181 Docs: Adding documentation for UsbView operation
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-28 10:56:36 +02:00
Dmitry Fleytman
3b1f461d5c Revert "RedirectorStrategy: Ensure there are no short buffers on read"
This reverts commit 32aadcb4fe.

Reverting commit because a regression was discovered on some devices.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-25 08:44:38 +02:00
Dmitry Fleytman
51ca12740b UsdDkController: Clarify redirection option in the help screen
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 18:39:59 +02:00
Dmitry Fleytman
910c71c191 UsbTarget: Add trace for ResetDevice
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 16:40:13 +02:00
Dmitry Fleytman
00cf4cbb04 FilterStrategy: Simplify requests forwarding code
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 12:04:07 +02:00
Dmitry Fleytman
32aadcb4fe RedirectorStrategy: Ensure there are no short buffers on read
To avoid "BABBLE" conditions.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 11:25:31 +02:00
Dmitry Fleytman
f322815084 UsbTarget: Protect pipes from concurrent accesses
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 11:25:31 +02:00
Dmitry Fleytman
b005694c69 Utils: Introduce RW-locks
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 10:35:38 +02:00
Dmitry Fleytman
39e3a4709c Utils: Generalize auto-locking mechanisms
This patch makes code ready for other lock types like RW-locks

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 10:35:37 +02:00
Dmitry Fleytman
fa27333c0e Utils: Make spinlock copying prohibited
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 10:35:36 +02:00
Dmitry Fleytman
a39d901f7d Utils: Replace dummy class with alias
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 10:35:36 +02:00
Dmitry Fleytman
fb4f04253e UsbDk: Trivial: Ditch dummy TODOs
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 10:35:35 +02:00
Dmitry Fleytman
14c1730d5a Control/Hider: Trivial: Simplify queues creation
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 10:35:34 +02:00
Dmitry Fleytman
e46947dd23 UsbDk: Make USB transfers execute at dispatch level
Change ExecutionLevel for redirector data queue
to WdfExecutionLevelDispatch.

There is no real reason to force USB transfers exection
on PASSIVE_LEVEL and DISPATCH_LEVEL execution is definitely
faster.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 10:35:34 +02:00
Dmitry Fleytman
3bca6777e7 RedirectorStrategy: Trivial: Make variable names follow the convention
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 10:35:33 +02:00
Dmitry Fleytman
785f05451f RedirectorStrategy: Extend transfer error traces
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-24 10:35:32 +02:00
Dmitry Fleytman
74cba9509d UsbDk: Make WdfRequest constructor explicit
To avoid implicit CWdfRequest objects construction
and requests completion.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-21 18:46:34 +02:00
Dmitry Fleytman
47c5eb6e02 UsbDkTarget: Add tracing for target creation
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-21 18:46:33 +02:00
Dmitry Fleytman
2b207ae5e8 UsbDk: Trivial: Drop extra empty line
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-20 12:13:16 +02:00
Dmitry Fleytman
42916dc5ce UsbTarget: Extend error traces
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-20 10:01:10 +02:00
Dmitry Fleytman
31febd34cd UsbDk: Use precompiled headers to speed-up compilation
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-12-01 11:08:15 +02:00
Dmitry Fleytman
1a97440166 UsbDk: Propagate USBD errors to user mode clients
WARNING: This patch breaks compilation of client code
due to changes in interface structures.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-11-24 13:04:17 +02:00
Dmitry Fleytman
d5f12a4699 UsbDk: Eliminate camelCase notation from interface definitions
This is a cosmetic change that unifies naming convention
in UsbDk public API.

WARNING: This change breaks compilation of client code.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-11-24 13:04:17 +02:00
Dmitry Fleytman
b3c36ea439 UsbDkData: Trivial: typo fixed
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-11-24 13:04:16 +02:00
Dmitry Fleytman
d9de2214ba CWdfUsbTarget: Do not delete USB target explicitely
USB target will be deleted together with its parent device

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-11-24 13:03:43 +02:00
Dmitry Fleytman
192195f6f2 CWdfDevice: Pacify excessive traces
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-11-24 12:32:39 +02:00
Dmitry Fleytman
72a4bcc5c1 CWdmSet: Prohibit copying
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-11-24 12:32:38 +02:00
Dmitry Fleytman
295fb0d871 CWdmList: Prohibit copying
Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
2015-11-24 12:32:37 +02:00