mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Disable flushing if the device doesn't support it or if it isn't enabled.
svn path=/trunk/; revision=18139
This commit is contained in:
parent
b88678d1a3
commit
87bf9958a5
1 changed files with 23 additions and 6 deletions
|
@ -1171,6 +1171,11 @@ AtapiFindDevices(PATAPI_MINIPORT_EXTENSION DeviceExtension,
|
|||
DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_DMA_CMD;
|
||||
}
|
||||
#endif
|
||||
if (!(DeviceExtension->DeviceParams[UnitNumber].SupportedFeatures83 & 0x1000) ||
|
||||
!(DeviceExtension->DeviceParams[UnitNumber].EnabledFeatures86 & 0x1000))
|
||||
{
|
||||
DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_NO_FLUSH;
|
||||
}
|
||||
DeviceFound = TRUE;
|
||||
}
|
||||
else
|
||||
|
@ -1212,6 +1217,22 @@ AtapiFindDevices(PATAPI_MINIPORT_EXTENSION DeviceExtension,
|
|||
DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_DMA_CMD;
|
||||
}
|
||||
#endif
|
||||
if (DeviceExtension->DeviceFlags[UnitNumber] & DEVICE_48BIT_ADDRESS)
|
||||
{
|
||||
if (!(DeviceExtension->DeviceParams[UnitNumber].SupportedFeatures83 & 0x2000) ||
|
||||
!(DeviceExtension->DeviceParams[UnitNumber].EnabledFeatures86 & 0x2000))
|
||||
{
|
||||
DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_NO_FLUSH;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(DeviceExtension->DeviceParams[UnitNumber].SupportedFeatures83 & 0x1000) ||
|
||||
!(DeviceExtension->DeviceParams[UnitNumber].EnabledFeatures86 & 0x1000))
|
||||
{
|
||||
DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_NO_FLUSH;
|
||||
}
|
||||
}
|
||||
DeviceFound = TRUE;
|
||||
}
|
||||
else
|
||||
|
@ -2311,12 +2332,8 @@ AtapiFlushCache(PATAPI_MINIPORT_EXTENSION DeviceExtension,
|
|||
* it doesn't make sense to flush cache on devices we don't
|
||||
* write to.
|
||||
*/
|
||||
return SRB_STATUS_INVALID_REQUEST;
|
||||
}
|
||||
|
||||
if (!(DeviceExtension->DeviceParams[Srb->TargetId].SupportedFeatures83 & 0x1000))
|
||||
{
|
||||
/* The device states it doesn't support the command */
|
||||
|
||||
/* The device states it doesn't support the command or it is disabled */
|
||||
DPRINT("The drive doesn't support FLUSH_CACHE\n");
|
||||
return SRB_STATUS_INVALID_REQUEST;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue