win-pvdrivers

changeset 653:6a160c1ad6e7

Added code to cater for sg list requesting virtual addresses to an offset in an mdl
author James Harper <james.harper@bendigoit.com.au>
date Mon Sep 07 21:19:23 2009 +1000 (2009-09-07)
parents 683e14a237fb
children 76b5aefeb46c
files xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/xenpci_pdo.c	Mon Sep 07 21:18:48 2009 +1000
     1.2 +++ b/xenpci/xenpci_pdo.c	Mon Sep 07 21:19:23 2009 +1000
     1.3 @@ -638,7 +638,7 @@ XenPci_DOP_BuildScatterGatherListButDont
     1.4      if (xen_dma_adapter->dma_extension->need_virtual_address && xen_dma_adapter->dma_extension->need_virtual_address(DeviceObject->CurrentIrp))
     1.5      {
     1.6        ASSERT(!Mdl->Next); /* can only virtual a single buffer */
     1.7 -      ASSERT(MmGetMdlVirtualAddress(Mdl) == CurrentVa);
     1.8 +      //ASSERT(MmGetMdlVirtualAddress(Mdl) == CurrentVa);
     1.9        map_type = MAP_TYPE_VIRTUAL;
    1.10        sglist->NumberOfElements = 1;
    1.11      }
    1.12 @@ -819,7 +819,7 @@ for (curr_mdl = Mdl; curr_mdl; curr_mdl 
    1.13    case MAP_TYPE_VIRTUAL:
    1.14      ptr = MmGetSystemAddressForMdlSafe(Mdl, NormalPagePriority);
    1.15      ASSERT(ptr); /* lazy */
    1.16 -    sglist->Elements[0].Address.QuadPart = (ULONGLONG)ptr;
    1.17 +    sglist->Elements[0].Address.QuadPart = (ULONGLONG)ptr + ((UINT_PTR)CurrentVa - (UINT_PTR)MmGetMdlVirtualAddress(Mdl));
    1.18      sglist->Elements[0].Length = Length;
    1.19      //KdPrint((__DRIVER_NAME "     MAP_TYPE_VIRTUAL - %08x\n", sglist->Elements[0].Address.LowPart));
    1.20      break;