https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b7de5870e6e6a845b4b45…
commit b7de5870e6e6a845b4b452d0c6fb105c00392ca5
Author: Victor Perevertkin <victor(a)perevertkin.ru>
AuthorDate: Sat Apr 27 23:29:45 2019 +0300
Commit: Victor Perevertkin <victor(a)perevertkin.ru>
CommitDate: Tue Jun 11 04:39:43 2019 +0300
[USBSTOR] Weaken the type checks of a device.
This adds usb-cdrom support to usbstor.sys
---
drivers/usb/usbstor/fdo.c | 4 ++--
drivers/usb/usbstor/pdo.c | 2 +-
media/inf/usbstor.inf | 4 +++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/usbstor/fdo.c b/drivers/usb/usbstor/fdo.c
index 16e00da1964..1c1949533f9 100644
--- a/drivers/usb/usbstor/fdo.c
+++ b/drivers/usb/usbstor/fdo.c
@@ -177,12 +177,12 @@ USBSTOR_FdoHandleStartDevice(
return STATUS_NOT_SUPPORTED;
}
- if (InterfaceDesc->bInterfaceSubClass != 0x06)
+ if (InterfaceDesc->bInterfaceSubClass == 0x04) // UFI subclass
{
// FIXME: need to pad CDBs to 12 byte
// mode select commands must be translated from 1AH / 15h to 5AH / 55h
DPRINT1("[USBSTOR] Error: need to pad CDBs\n");
- return STATUS_NOT_IMPLEMENTED;
+ return STATUS_NOT_SUPPORTED;
}
// now select an interface
diff --git a/drivers/usb/usbstor/pdo.c b/drivers/usb/usbstor/pdo.c
index 93caca4e1ef..b41cb9345d1 100644
--- a/drivers/usb/usbstor/pdo.c
+++ b/drivers/usb/usbstor/pdo.c
@@ -897,7 +897,7 @@ USBSTOR_CreatePDO(
return Status;
}
- if (PDODeviceExtension->InquiryData->DeviceType == DIRECT_ACCESS_DEVICE)
+ if (PDODeviceExtension->InquiryData->DeviceType == DIRECT_ACCESS_DEVICE ||
PDODeviceExtension->InquiryData->DeviceType == READ_ONLY_DIRECT_ACCESS_DEVICE)
{
PDODeviceExtension->IsFloppy = FALSE; // TODO: implement the actual check
}
diff --git a/media/inf/usbstor.inf b/media/inf/usbstor.inf
index a7fd9ff3651..87a80f63cb4 100644
--- a/media/inf/usbstor.inf
+++ b/media/inf/usbstor.inf
@@ -18,7 +18,9 @@ DefaultDestDir = 12
%GenericMfg% = GenericMfg
[GenericMfg]
-%GenericBulkOnlyTransport.DeviceDesc% =
USBBulkOnly_Inst,USB\Class_08&SubClass_06&Prot_50
+%GenericBulkOnlyTransport.DeviceDesc% =
USBBulkOnly_Inst,USB\Class_08&SubClass_06&Prot_50 ; SCSI devices
+; usbstor.sys supports usb-cdroms but cdrom.sys from ReactOS does not like it
+;%GenericBulkOnlyTransport.DeviceDesc% =
USBBulkOnly_Inst,USB\Class_08&SubClass_02&Prot_50 ; SFF-8020i (ATAPI)
;-------------------------- USB STORAGE DRIVER --------------------------