Commit graph

154 commits

Author SHA1 Message Date
Victor Perevertkin 88cf5b0a3c
[USB] Enable *_new usb stack 2019-08-20 01:34:58 +03:00
Victor Perevertkin fc14c095f5
[USBPORT] Fix endless loop, occasionally happened on real hardware 2019-08-20 01:30:52 +03:00
Victor Perevertkin 90b8646790
[USBOHCI_NEW] Fix unused variable 2019-08-16 20:37:11 +03:00
Stanislav Motylkov 2a8fc2b411 [USBOHCI_NEW] Refactor OHCI_AbortTransfer function
- Added SAL annotation
- Simplified local variables
- Replace counterintuitive `do {} while ()` loops with nice `for` loops
- Get rid of goto and its label, it can be simply avoided
2019-08-16 19:08:04 +02:00
Oleg Dubinskiy 47303268e1 [USBAUDIO] Fix compilation issues 2019-08-03 14:55:57 +02:00
Victor Perevertkin e831f8530b
[USBSTOR] Do not print device descriptor by default.
Add SrbGetCdb macro
2019-06-25 19:04:20 +03:00
Victor Perevertkin 10260f40d9
[USBOHCI_NEW] Rename counter-intuitive field of Transfer Descriptor 2019-06-25 15:14:21 +03:00
Victor Perevertkin 9004e64b57
[USBOHCI_NEW] Zero out the transfer descriptor right after allocation.
Cleaned up transfer routines and added some more docs.
2019-06-25 15:03:26 +03:00
Victor Perevertkin 3fe397818a
[USBOHCI_NEW] Simplify the MapTransferToTD routine and add some docs 2019-06-25 13:02:35 +03:00
Victor Perevertkin da1b08e842 [USBSTOR] Properly handle IRP_MN_QUERY_DEVICE_RELATIONS(BusRelations) for FDO.
This fixes Driver Verifier warnings
2019-06-11 04:39:43 +03:00
Victor Perevertkin 04409942d6 [USBSTOR] Register dumb IRP_MJ_SYSTEM_CONTROL handler.
This satisfies Driver Verifier
2019-06-11 04:39:43 +03:00
Victor Perevertkin 126abaf88f [USBSTOR] Improve handling of IRP_MN_QUERY_DEVICE_TEXT for PDOs
CORE-15883
2019-06-11 04:39:43 +03:00
Victor Perevertkin 40b25634ff [USBSTOR] Do not leak fields of DeviceExtensions upon device removal 2019-06-11 04:39:43 +03:00
Victor Perevertkin b7de5870e6 [USBSTOR] Weaken the type checks of a device.
This adds usb-cdrom support to usbstor.sys
2019-06-11 04:39:43 +03:00
Victor Perevertkin 7bb93db372 [USBSTOR] Refactor device reset and pipe reset code.
Return correct status codes from completion routines.
Reject requests while the device is being reset
2019-06-11 04:39:43 +03:00
Victor Perevertkin aaa90f6986 [USBSTOR] Do not try to retry a failed request
for all cases except receiving a USBD_STATUS_STALL_PID status.
This decision should be made by higher-level driver (and classpnp drivers do it)
2019-06-11 04:39:43 +03:00
Victor Perevertkin c7ed299aaa [USBSTOR] Issue a SCSI Request Sense after receiving
a CSW with failed status. CORE-15884
Based on Vadim Galyant's patches to usbstor
2019-06-11 04:39:43 +03:00
Victor Perevertkin 5046f1b3fa [USBSTOR] Keep CBW and CSW inside an IRP context.
Remove obsolete fields from the IRP context structure.
2019-06-11 04:39:43 +03:00
Victor Perevertkin c452f7dab4 [USBSTOR] Refactor request issue code.
Pipe handle selection now made more correctly.
Simplified an MDL allocation for a request.
2019-06-11 04:39:43 +03:00
Victor Perevertkin 84f78cb0d7 [USBSTOR] Better handle CBW/CSW transfer errors
and set SrbStatus correctly.
2019-06-11 04:39:43 +03:00
Victor Perevertkin 3faf5efd49 [USBSTOR] Better validate SCSI IRPs.
Patch by Vadim Galyant
2019-06-11 04:39:43 +03:00
Victor Perevertkin f3fd12b9be [USBSTOR] Rework the routines for sending internal SCSI requests.
Now for each request SenseBuffer is correctly set
and 3 attempts are made to be sure the STALL state is cleared and
the error is in something else.
Remove the usage of UFI_INQUIRY_DATA structure in favor of "standard"
INQUIRYDATA structure from scsi.h

Based in Vadim Galyant's patches to usbstor
2019-06-11 04:39:43 +03:00
Victor Perevertkin ed6724cd7e [USBSTOR] Do not create a new Irp for USB requests - use the original one
from higher-level driver instead.
Refactored CSWCompletionRoutine for correct handling different CSW
statuses, more work to be done here.
2019-06-11 04:39:43 +03:00
Victor Perevertkin b4c03399ba [USBSTOR] Do not attempt additional processing of SCSI requests.
Now the driver sends all requests transparently.
Inspired by Vadim Galyant's patches to usbstor
2019-06-11 04:39:43 +03:00
Victor Perevertkin d17d15ab6c [FORMATTING][USBSTOR] Remove Captain Obvious and line-wasting comments.
Now the driver conforms with our current Coding Style.
No functional changes
2019-06-11 04:39:43 +03:00
Thomas Faber a7634b8e1d
[USBHUB_NEW] Support NULL HubExtension in USBH_PdoRemoveDevice.
Device removal can happen multiple times for PDOs.
2019-04-14 15:32:18 +02:00
Thomas Faber 477cf902e4
[USBHUB_NEW] Fix inverted check in USBH_RestoreDevice.
This allows re-enabling a disabled device.
2019-04-14 15:32:16 +02:00
Thomas Faber 46b0f6d9de
[USBCCGP] Allow unconfiguring the device in USBCCGP_PDOSelectConfiguration.
Fixes device removal for USB audio devices.
2019-04-14 15:32:14 +02:00
Thomas Faber 528fc589c0
[USBCCGP] Do not try to unconfigure a device that is not configured.
Fixes handling failed IRP_MN_START_DEVICE.
2019-04-14 15:32:12 +02:00
Jérôme Gardou 23373acbb9 [CMAKE] Use modules instead of shared libraries
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.

On my system, this reduces the configure-time by a factor of two.
2019-04-06 17:43:38 +02:00
Thomas Faber fc9d5d2f55
[USBUHCI_NEW] Fix an infinite loop. 2019-03-11 08:54:03 +01:00
Thomas Faber 026a12fe39
[USBPORT] Implement interface setting in USBPORT_OpenInterface. 2019-03-11 08:54:01 +01:00
Thomas Faber ac20ab031c
[USBPORT] Correctly handle alternate settings returned from USBPORT_ParseConfigurationDescriptor.
The last parameter of USBPORT_ParseConfigurationDescriptor is a pointer
to a boolean indicating whether any alternate interface settings were
found for the specified interface.
Interpreting it as an alternate setting value, as we did before,
would always override the alternate setting to '1' (if any alternate
descriptors were present), therefore selecting the wrong interface
setting, and possibly causing a buffer overflow on the InterfaceList's
Pipes array.

Found by Special Pool.
2019-03-11 08:53:55 +01:00
Thomas Faber 36c1cb0910
[USBPORT] Correctly find interface descriptor in USBPORT_ParseConfigurationDescriptor
There can be other descriptors between the config descriptor and the
first interface descriptor, so we specifically need to check for
the interface descriptor type and skip anything before that.
We also need to guard against bLength == 0, which would cause an
infinite loop, instead of doing a second bDescriptorType check.
2019-03-11 08:53:53 +01:00
Thomas Faber 1946f6bb25
[USBPORT] Acquire EndpointSpinLock in addition to MiniportSpinLock in USBPORT_ReopenPipe. 2019-03-11 08:53:52 +01:00
Thomas Faber e47240fb37
[USBPORT] Release StateChangeSpinLock before acquiring MiniportSpinLock.
Found by Driver Verifier.
2019-03-11 08:53:50 +01:00
Thomas Faber 267f5633ee
[USBPORT] Leave IRP status untouched for unhandled interfaces.
Found by Driver Verifier.
2019-03-11 08:53:49 +01:00
Thomas Faber 12a66769fc
[USBPORT] Don't change the status of IRP_MJ_SYSTEM_CONTROL requests.
Found by Driver Verifier.
2019-03-11 08:53:47 +01:00
Thomas Faber e10e6a85fb
[USBHUB_NEW] Don't leak IRP_MJ_SYSTEM_CONTROL requests.
Found by Driver Verifier.
2019-03-11 08:53:45 +01:00
Hermès Bélusca-Maïto 38be848f68
[USBSTOR][USBSTOR_NEW] Fix a comparison made for assigning the ScsiInquiryData->RemovableMedia flag.
Now removable drives are really reported as such.

See https://github.com/reactos/reactos/pull/308/files#r163224294
for more details.
2019-02-10 22:40:59 +01:00
Amine Khaldi 3bf751e046 [USBEHCI_NEW] Bring-in the USB EHCI miniport driver created by Vadim Galyant. (#301) 2018-09-10 09:05:35 +02:00
Vadim Galyant 3baf43c5de
[USBHUB_NEW][USBPORT] Fix buffer size calculation for multi-sz values in IRP_MN_QUERY_ID.
Also fix some copypasta'd DPRINTs.
2018-09-09 11:24:48 +02:00
Thomas Faber e400519cb5
[USBUHCI_NEW] Add license headers. 2018-09-08 10:16:02 +02:00
Thomas Faber 855df84fb2
[USBOHCI_NEW] Add license headers. 2018-09-08 10:15:52 +02:00
Thomas Faber d6d6b329be
[USBOHCI_NEW][USBUHCI_NEW] Avoid unnecessary/incorrect status defines. 2018-09-08 08:45:18 +02:00
Thomas Faber c188e387e3
[USBOHCI_NEW] Avoid storing pointers as ULONG and physical addresses as pointers. 2018-09-01 18:23:25 +02:00
Thomas Faber 0dfa7356c8
[USBHUB_NEW] Fix x64 warnings. 2018-09-01 18:23:14 +02:00
Amine Khaldi a1a65e940a [USBUHCI_NEW] Bring-in the USB UHCI miniport driver created by Vadim Galyant. (#245) 2018-09-01 17:45:45 +02:00
Thomas Faber 5403094339
[USBPORT] Fix 64 bit warnings. 2018-08-16 14:14:42 +02:00
Thomas Faber bd4529b717
[USBPORT] Specify the correct length for the root hub's hub descriptor. 2018-08-16 14:14:31 +02:00