BusLogic scatter/gather now processes 1 more block if the data length is not divisible by the length of a scatter/gather block.

This commit is contained in:
OBattler
2017-01-16 21:06:38 +01:00
parent 8a16c015b9
commit a15a8ac57d

View File

@@ -821,9 +821,16 @@ void BuslogicDataBufferFree(BuslogicRequests_t *BuslogicRequests)
uint32_t ScatterGatherRead;
uint32_t ScatterEntry;
SGE32 ScatterGatherBuffer[MAX_SG_DESCRIPTORS];
uint32_t ScatterGatherLeft = DataLength / (BuslogicRequests->Is24bit ? sizeof(SGE) : sizeof(SGE32));
uint32_t ScatterGatherReqSize = (BuslogicRequests->Is24bit ? sizeof(SGE) : sizeof(SGE32));
uint32_t ScatterGatherLeft = DataLength / ScatterGatherReqSize;
uint32_t ScatterGatherLength = (ScatterGatherLeft * ScatterGatherReqSize);
uint32_t ScatterGatherAddrCurrent = DataPointer;
if (DataLength > ScatterGatherLength)
{
ScatterGatherLeft++;
}
do
{
ScatterGatherRead = (ScatterGatherLeft < ELEMENTS(ScatterGatherBuffer))