mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Fix broken DEVICE_NO_FLUSH handling for ATAPI devices, with augmentation to check the SupportedFeatures83 of the device. Thanks to tinus_ for finding and fixing.
svn path=/trunk/; revision=13577
This commit is contained in:
parent
f0222daf5d
commit
03b34e7857
1 changed files with 9 additions and 2 deletions
|
@ -2231,7 +2231,7 @@ AtapiFlushCache(PATAPI_MINIPORT_EXTENSION DeviceExtension,
|
||||||
DPRINT("SCSIOP_SYNCRONIZE_CACHE: TargetId: %lu\n",
|
DPRINT("SCSIOP_SYNCRONIZE_CACHE: TargetId: %lu\n",
|
||||||
Srb->TargetId);
|
Srb->TargetId);
|
||||||
|
|
||||||
if (!(DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_NO_FLUSH))
|
if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_NO_FLUSH)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* NOTE: Don't flush the cache for CD/DVD drives. Although
|
* NOTE: Don't flush the cache for CD/DVD drives. Although
|
||||||
|
@ -2240,7 +2240,14 @@ AtapiFlushCache(PATAPI_MINIPORT_EXTENSION DeviceExtension,
|
||||||
* it doesn't make sense to flush cache on devices we don't
|
* it doesn't make sense to flush cache on devices we don't
|
||||||
* write to.
|
* write to.
|
||||||
*/
|
*/
|
||||||
return STATUS_SUCCESS;
|
return SRB_STATUS_INVALID_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(DeviceExtension->DeviceParams[Srb->TargetId].SupportedFeatures83 & 0x1000))
|
||||||
|
{
|
||||||
|
/* The device states it doesn't support the command */
|
||||||
|
DPRINT("The drive doesn't support FLUSH_CACHE\n");
|
||||||
|
return SRB_STATUS_INVALID_REQUEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for BUSY to clear */
|
/* Wait for BUSY to clear */
|
||||||
|
|
Loading…
Reference in a new issue