From 7608f1604f994fa45de8e54c46901e3cbde20e14 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 16 Jan 2017 06:21:34 +0100 Subject: [PATCH] Attempt to fix BusLogic scatter gather by increasing source buffer position after every read. --- src/buslogic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/buslogic.c b/src/buslogic.c index 5d263c8ae..6cd9b318b 100644 --- a/src/buslogic.c +++ b/src/buslogic.c @@ -792,6 +792,8 @@ uint32_t BuslogicGetDataLength(BuslogicRequests_t *BuslogicRequests) void BuslogicDataBufferFree(BuslogicRequests_t *BuslogicRequests) { + uint32_t sg_buffer_pos = 0; + if (BuslogicRequests->Is24bit) { DataPointer = ADDR_TO_U32(BuslogicRequests->CmdBlock.old.DataPointer); @@ -839,7 +841,8 @@ void BuslogicDataBufferFree(BuslogicRequests_t *BuslogicRequests) Address = ScatterGatherBuffer[ScatterEntry].SegmentPointer; DataToTransfer = ScatterGatherBuffer[ScatterEntry].Segment; - DMAPageWrite(Address, SCSIDevices[BuslogicRequests->TargetID].CmdBuffer, DataToTransfer); + DMAPageWrite(Address, SCSIDevices[BuslogicRequests->TargetID].CmdBuffer + sg_buffer_pos, DataToTransfer); + sg_buffer_pos += DataToTransfer; } ScatterGatherAddrCurrent += ScatterGatherRead * (BuslogicRequests->Is24bit ? sizeof(SGE) : sizeof(SGE32));