Author: apriyadarshi
Date: Tue Jul 26 14:15:15 2016
New Revision: 72002
URL:
http://svn.reactos.org/svn/reactos?rev=72002&view=rev
Log:
Added write support, next operation code 53 27.
Modified:
branches/GSoC_2016/AHCI/drivers/storage/storahci/storahci.c
Modified: branches/GSoC_2016/AHCI/drivers/storage/storahci/storahci.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/AHCI/drivers/storage/…
==============================================================================
--- branches/GSoC_2016/AHCI/drivers/storage/storahci/storahci.c [iso-8859-1] (original)
+++ branches/GSoC_2016/AHCI/drivers/storage/storahci/storahci.c [iso-8859-1] Tue Jul 26
14:15:15 2016
@@ -849,7 +849,7 @@
Srb->SrbStatus = DeviceRequestSense(AdapterExtension, Srb,
cdb);
break;
case SCSIOP_READ:
- //case SCSIOP_WRITE:
+ case SCSIOP_WRITE:
Srb->SrbStatus = DeviceRequestReadWrite(AdapterExtension, Srb,
cdb);
break;
default:
@@ -1726,7 +1726,7 @@
ModeHeader->ModeDataLength = sizeof(MODE_PARAMETER_HEADER);
ModeHeader->MediumType = 0;
- ModeHeader->DeviceSpecificParameter = MODE_DSP_WRITE_PROTECT;
+ ModeHeader->DeviceSpecificParameter = 0;
ModeHeader->BlockDescriptorLength = 0;
if (Cdb->MODE_SENSE.PageCode == MODE_SENSE_CURRENT_VALUES)
@@ -1776,9 +1776,12 @@
NT_ASSERT(BytesPerSector > 0);
- ROUND_UP(DataTransferLength, BytesPerSector);
+ //ROUND_UP(DataTransferLength, BytesPerSector);
SectorCount = DataTransferLength / BytesPerSector;
+
+ Srb->DataTransferLength = SectorCount * BytesPerSector;
+
StartOffset = AhciGetLba(Cdb, Srb->CdbLength);
IsReading = (Cdb->CDB10.OperationCode == SCSIOP_READ);
@@ -1796,7 +1799,8 @@
else
{
SrbExtension->Flags |= ATA_FLAGS_DATA_OUT;
- NT_ASSERT(FALSE);
+ SrbExtension->CommandReg = IDE_COMMAND_WRITE_DMA;
+ //NT_ASSERT(FALSE);
}
SrbExtension->FeaturesLow = 0;