mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[SCSIPORT] Flush and Free Map Registers (#5190)
- Flush Map registers once the DMA completes - Free Map registers once the DMA completes - Add support for SGL allocated from NonPagedPool Test: Force Allocations of SGL from Non Paged Pool and ensure OS boots and functions properly Test Logs: SpiAdapterControlFORCING ALLOCATION FROM SGPOOL SpiAdapterControlFORCING ALLOCATION FROM SGPOOL SpiAdapterControlFORCING ALLOCATION FROM SGPOOL SpiAdapterControlFORCING ALLOCATION FROM SGPOOL SpiAdapterControlFORCING ALLOCATION FROM SGPOOL SpiAdapterControlFORCING ALLOCATION FROM SGPOOL DHCPCSVC: Adapter Name: [{7cd69ac0-dabb-410a-b927-cb3961d174da}] (dynamic) SpiAdapterControlFORCING ALLOCATION FROM SGPOOL WARNING: HalCalculateScatterGatherListSize at hal\halx86\generic\dma.c:1168 is UNIMPLEMENTED! SpiAdapterControlFORCING ALLOCATION FROM SGPOOL SpiAdapterControlFORCING ALLOCATION FROM SGPOO
This commit is contained in:
parent
6eb8fe4f82
commit
6eee9f9daf
1 changed files with 28 additions and 6 deletions
|
@ -653,7 +653,6 @@ SpiProcessCompletedRequest(
|
|||
PSCSI_PORT_LUN_EXTENSION LunExtension;
|
||||
LONG Result;
|
||||
PIRP Irp;
|
||||
//ULONG SequenceNumber;
|
||||
|
||||
Srb = SrbInfo->Srb;
|
||||
Irp = Srb->OriginalRequest;
|
||||
|
@ -681,10 +680,25 @@ SpiProcessCompletedRequest(
|
|||
}
|
||||
|
||||
/* Flush adapter if needed */
|
||||
if (SrbInfo->BaseOfMapRegister)
|
||||
if (SrbInfo->BaseOfMapRegister && SrbInfo->ScatterGather)
|
||||
{
|
||||
/* TODO: Implement */
|
||||
ASSERT(FALSE);
|
||||
ULONG transferLen = 0;
|
||||
BOOLEAN isWrite = !!(Srb->SrbFlags & SRB_FLAGS_DATA_OUT);
|
||||
ULONG i;
|
||||
|
||||
for (i = 0;
|
||||
i < SrbInfo->NumberOfMapRegisters && transferLen < Srb->DataTransferLength;
|
||||
i++)
|
||||
{
|
||||
transferLen += SrbInfo->ScatterGather[i].Length;
|
||||
}
|
||||
|
||||
IoFlushAdapterBuffers(DeviceExtension->AdapterObject,
|
||||
Irp->MdlAddress,
|
||||
SrbInfo->BaseOfMapRegister,
|
||||
Srb->DataBuffer,
|
||||
transferLen,
|
||||
isWrite);
|
||||
}
|
||||
|
||||
/* Clear the request */
|
||||
|
@ -718,8 +732,16 @@ SpiProcessCompletedRequest(
|
|||
/* Scatter/gather */
|
||||
if (Srb->SrbFlags & SRB_FLAGS_SGLIST_FROM_POOL)
|
||||
{
|
||||
/* TODO: Implement */
|
||||
ASSERT(FALSE);
|
||||
ExFreePoolWithTag(SrbInfo->ScatterGather, TAG_SCSIPORT);
|
||||
SrbInfo->ScatterGather = NULL;
|
||||
}
|
||||
|
||||
/* Free Map Registers */
|
||||
if (SrbInfo->NumberOfMapRegisters)
|
||||
{
|
||||
IoFreeMapRegisters(DeviceExtension->AdapterObject,
|
||||
SrbInfo->BaseOfMapRegister,
|
||||
SrbInfo->NumberOfMapRegisters);
|
||||
}
|
||||
|
||||
/* Acquire spinlock (we're freeing SrbExtension) */
|
||||
|
|
Loading…
Reference in a new issue