Compare commits

...

35 Commits

Author SHA1 Message Date
Vardan Mikayelyan
c86dab5d90 revert r72459 (there were difference between blocks which I assumed as identical)
svn path=/branches/GSoC_2016/USB/; revision=72462
2016-08-25 18:17:44 +00:00
Vardan Mikayelyan
319fedc3b7 fastfat: Remove code dublication, which has added r6279
svn path=/branches/GSoC_2016/USB/; revision=72459
2016-08-25 14:08:19 +00:00
Vardan Mikayelyan
3eefafd099 Fix for copypasta done in "usb: HUB: Add PnP state tracking"(r72388)
svn path=/branches/GSoC_2016/USB/; revision=72453
2016-08-25 10:13:11 +00:00
Vardan Mikayelyan
ee57b4f95d hid: hidparser: Fix for CORE-11538.
This commit fixes issue https://jira.reactos.org/browse/CORE-11538.

There were mistakes in buffer manipulation loops.

svn path=/branches/GSoC_2016/USB/; revision=72394
2016-08-19 16:57:49 +00:00
Vardan Mikayelyan
ada3e93b63 usb: hub: PDO: InternalDeviceControl can be called in DPC
As InternalDeviceControl can be called in DPC, we should avoid scanning
of parent's child list because it uses guarded mutex for
synchronization. So here we just adding new checking for safety and
removing isValidPDO() call.

svn path=/branches/GSoC_2016/USB/; revision=72393
2016-08-19 16:56:35 +00:00
Vardan Mikayelyan
23d8d3841b usb: HUB: Fix DV's enhanced I/O validation issues
Added USBHUB_DispatchSystemControl stub

svn path=/branches/GSoC_2016/USB/; revision=72392
2016-08-19 16:55:09 +00:00
Vardan Mikayelyan
087e7ada2a usb: HUB: Refactor power dispatcher, add remove synch
Refactored power dispatcher, added remove sychronization to avoid early
remove or call on removed device.

svn path=/branches/GSoC_2016/USB/; revision=72391
2016-08-19 16:52:21 +00:00
Vardan Mikayelyan
01a0ce006a usb: HUB: FDO: Add IRP_MN_REMOVE_DEVICE handler
Added remove handler for usbhub FDO. When FDO is being removed, it
should delete all it's child PDOs. Because when PnP sends removes to
child devices they are still presented on the bus, so their handler will
not delete PDO.

svn path=/branches/GSoC_2016/USB/; revision=72390
2016-08-19 16:50:26 +00:00
Vardan Mikayelyan
a872bb83df usb: hub: Add remove synchronization
Added PDO/FDO remove synchronization to prevent device removal while
another IRP is in process.

As guidelines used ch6 of Walter Oney's "Programming the Microsoft
Windows Driver Model 2ed"

svn path=/branches/GSoC_2016/USB/; revision=72389
2016-08-19 16:47:45 +00:00
Vardan Mikayelyan
c2c6b0f59a usb: HUB: Add PnP state tracking
Added PDO/FDO PnP state tracking, which is done according MSDN's
"State Transitions for PnP Devices" topic.

svn path=/branches/GSoC_2016/USB/; revision=72388
2016-08-19 16:46:18 +00:00
Vardan Mikayelyan
b1c13811c0 usb: hub: FDO: Handle surprise removal, fail stop request.
svn path=/branches/GSoC_2016/USB/; revision=72387
2016-08-19 16:38:11 +00:00
Vardan Mikayelyan
3b17e8fe12 usb: hub: Add sychronization for FDO's child list access.
As FDO's child list is getting changed not from PnP dispatcher but
from DeviceStatusChangeThread(), we need to sychronize access for it.

svn path=/branches/GSoC_2016/USB/; revision=72386
2016-08-19 16:36:43 +00:00
Vardan Mikayelyan
4d099209d9 Change CMakLists to use GuardedMutexes
svn path=/branches/GSoC_2016/USB/; revision=72385
2016-08-19 16:35:06 +00:00
Vardan Mikayelyan
e33b567165 usb: hub: PDO: Refernce interface before passing up
svn path=/branches/GSoC_2016/USB/; revision=72384
2016-08-19 16:33:34 +00:00
Vardan Mikayelyan
0f9441b762 usb: hub: PDO: Added query-remove and query-cancel-remove handlers
On IRP_MN_QUERY_REMOVE_DEVICE we are freeing interface obtained from
bottom according MSDN we should check interfaces provided to top, but
here we are not checking. All checking will be performed in roothub
driver's IRP_MN_QUERY_REMOVE_DEVICE handler. This will make problems
when buggy driver is loaded on top of us. But we decided to keep source
simpler, because in any case buggy driver will prevent removing of
whole stack.

svn path=/branches/GSoC_2016/USB/; revision=72383
2016-08-19 16:30:53 +00:00
Vardan Mikayelyan
a0b1bf29ba usb: hub: FDO: Removed dublicated functions and fields
FDO_QueryInterface() is unuseful beacuse we have more generic
QueryInterface() function which is able to replace all functionality
which provides FDO_QueryInterface().

Also we do not need to have two "USB_BUS_INTERFACE_USBDI_V2" fields in
"HUB_DEVICE_EXTENSION".

FDO_QueryInterface() was added in svn-rev 55983, and on review of that
commit I have found some copypasta issues and also tricks which was not
documented and marked by me as wrong. For example changing if
buscontext which was fixed in previous commits of this commit set.

svn path=/branches/GSoC_2016/USB/; revision=72382
2016-08-19 16:29:16 +00:00
Vardan Mikayelyan
c1fb2cc04a usb: hub: FDO: Fix USBHUB_FdoStartDevice()
Done fixes in cleanup also refactored code to be more readable and error
safe.

svn path=/branches/GSoC_2016/USB/; revision=72381
2016-08-19 16:27:37 +00:00
Vardan Mikayelyan
a504c6b0d3 usb: libusb: hub: Refernce interface before passing up
Added InterfaceReference() calls before passing interface to upper
layer.

svn path=/branches/GSoC_2016/USB/; revision=72380
2016-08-19 16:24:25 +00:00
Vardan Mikayelyan
4d173b14d0 usb: hub: FDO: Fix CreateUsbChildDeviceObject()
There were code dublication on copy device interface, also after
 copying interface, we should call InterfaceReference() routine of
 interface, to prevent interface provider deleiton.

 I have moved RtlCopyMemory() and InterfaceReference() to the end
 of this function to siplify cleanup part, because otherwise we should
 call InterfaceDereference() in cleanup part.

 The changing of interface context seems wrong for me, let me give just
 one example. When we are changing only buscontext, then when upper
 layer calls interfaceDereference(), which is "thinking" that works with
 it's buscontext, and tries to work with it using it's buscontext
 pointer. So changing of buscontext is completely wrong.

svn path=/branches/GSoC_2016/USB/; revision=72379
2016-08-19 16:22:18 +00:00
Vardan Mikayelyan
c48f1cfa02 usb: libusb: hub_controller: Fix PnP handler
In some cases our driver was changing IRP status in places where it
shouldn't.

svn path=/branches/GSoC_2016/USB/; revision=72378
2016-08-19 16:20:32 +00:00
Vardan Mikayelyan
f07098aa95 usb: hub: Fix in USBHUB_DispatchPower
In case of FDO it should pass IRP down.

svn path=/branches/GSoC_2016/USB/; revision=72377
2016-08-19 16:18:59 +00:00
Vardan Mikayelyan
259b1957ef usb: hub: PDO: Fix in IRP_MN_QUERY_DEVICE_RELATIONS handler
I don't see the reason for allocation from NonPagedPool, also
the information field writing was wrong.

svn path=/branches/GSoC_2016/USB/; revision=72376
2016-08-19 16:15:31 +00:00
Vardan Mikayelyan
aaa4941fa6 usb: hub: FDO: Fix PnP handling issues.
There is many cases where we should forward IRP instead of complete it.

svn path=/branches/GSoC_2016/USB/; revision=72375
2016-08-19 16:13:09 +00:00
Vardan Mikayelyan
1462b6ddaf usb: hub: FDO: Fix QueryInterface()
The status block of an IRP must be initialized before calling driver.

svn path=/branches/GSoC_2016/USB/; revision=72374
2016-08-19 16:08:48 +00:00
Vardan Mikayelyan
754923088a usb: hub: PDO: Fix in IRP_MN_QUERY_DEVICE_RELATIONS
Here we shouldn't modify information field of IRP, because for example
in case of bus relations IRP must reach the stack's PDO collecting on
its way all relations.

This was the one of the causes of MS's usbccgp fail. usbccgp was not
able to report to PnP manager about it's child devices.

There is also another issues in usbuhci, which prevents usbccgp from
normal operation.

[THIS PATCH SHULD NOT BE MERGED WITH TRUNK UNTIL UHCI BUGS ARE NOT FIXED]

svn path=/branches/GSoC_2016/USB/; revision=72373
2016-08-19 15:50:18 +00:00
Vardan Mikayelyan
87a3559cff usb: hub: FDO: Rework IRP_MN_QUERY_DEVICE_RELATIONS
First of all we should keep in account that there might be device
relations below and above this FDO, so we should save previous relations
coming from top object and shuld pass this IRP down to stack after
adding our relations. In case of success query devcie relations must be
completed in the PDO.

As MSDN requires, if the upper layer provided this IRP with initialized
DeviceRelation, then we should replace that relation with another one
which will contain our child PDOs too. And after replacement we should
free the recources allocated for previous relation structure.

If there is relations coming from upper layer, we shuldn't complete this
IRP with fail, because that will bring upper layer into unstabile state,
it will 'think' that succesfully reported it's relations.

svn path=/branches/GSoC_2016/USB/; revision=72372
2016-08-19 15:47:45 +00:00
Vardan Mikayelyan
ba43f5b145 usb: hub: PDO: Changed handling of IRP_MN_REMOVE_DEVICE
On this IRP we should free recources and delete
child's PDO ONLY if it isn't presented physically
on the bus.

If it is presented we're leaving as it was, thinking
that devices on top of it already frees otained from it
resources.

If child PDO is presented physically, then should be
already marked as remove_pending when it will receive
this IRP.

svn path=/branches/GSoC_2016/USB/; revision=72371
2016-08-19 15:43:43 +00:00
Vardan Mikayelyan
d1f4b366b3 usb: hub: PDO: Add debug prints into USBHUB_PdoHandlePnp
NO-OP changes.

svn path=/branches/GSoC_2016/USB/; revision=72370
2016-08-19 15:41:30 +00:00
Vardan Mikayelyan
b3b98dee61 usb: hub: PDO: Fail IRP_MN_QUERY_STOP_DEVICE.
We should fail this request, because we're not handling
IRP_MN_STOP_DEVICE for now. On systems above win2000 we'll
receive this IRP ONLY when the PnP manager rebalances resources.

svn path=/branches/GSoC_2016/USB/; revision=72369
2016-08-19 15:37:57 +00:00
Vardan Mikayelyan
3a74eae484 usb: hub: PDO: New checking in IsValidPDO()
As child's parent FDO at any moment can receive surprise removal,
Before being it should notify it's childs by setting their parents to NULL.
So if we see PDO with parent==NULL then we can consider it as physically
removed, i.e. invalid.

svn path=/branches/GSoC_2016/USB/; revision=72368
2016-08-19 15:34:48 +00:00
Vardan Mikayelyan
262687ef42 usb: hub: PDO: Add IsRemovePending flag to HUB_CHILDDEVICE_EXTENSION
This flag is set in IRP_MN_QUERY_REMOVE_DEVICE and IRP_MN_SURPRISE_REMOVAL,
and then checked in PDO's IRP dispatch routines to prevent starting of
any operation which can prevent device removal.

svn path=/branches/GSoC_2016/USB/; revision=72367
2016-08-19 15:31:15 +00:00
Vardan Mikayelyan
ce01b38240 usb: hub: fdo: Fixes in cleanup of CreateUsbChildDeviceObject()
svn path=/branches/GSoC_2016/USB/; revision=72366
2016-08-19 15:29:24 +00:00
Vardan Mikayelyan
222c77de10 usb: hub: fdo: Add debug prints and comments
NO-OP changes.

svn path=/branches/GSoC_2016/USB/; revision=72365
2016-08-19 15:22:34 +00:00
Vardan Mikayelyan
6ee0e98c49 merge up to trunk r72363
svn path=/branches/GSoC_2016/USB/; revision=72364
2016-08-19 14:10:27 +00:00
Pierre Schweitzer
a6065cdd32 Create the USB branch for Vardan's work
svn path=/branches/GSoC_2016/USB/; revision=71410
2016-05-26 16:44:14 +00:00
23005 changed files with 2214 additions and 1311330 deletions

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Some files were not shown because too many files have changed in this diff Show More