win-pvdrivers

diff xenvbd/xenvbd.c @ 310:60372bd2582d

First cut of putting xenbus config details in the .inf file - xenvbd may yet pass WHQL
author James Harper <james.harper@bendigoit.com.au>
date Fri Jun 13 14:16:50 2008 +1000 (2008-06-13)
parents b4f7d75fbe24
children 0488ef11be09
line diff
     1.1 --- a/xenvbd/xenvbd.c	Wed Jun 11 21:24:57 2008 +1000
     1.2 +++ b/xenvbd/xenvbd.c	Fri Jun 13 14:16:50 2008 +1000
     1.3 @@ -35,6 +35,7 @@ DRIVER_INITIALIZE DriverEntry;
     1.4  #pragma alloc_text (INIT, DriverEntry)
     1.5  #endif
     1.6  
     1.7 +#if 0
     1.8  static PDRIVER_DISPATCH XenVbd_Pnp_Original;
     1.9  
    1.10  static NTSTATUS
    1.11 @@ -60,26 +61,6 @@ XenVbd_Pnp(PDEVICE_OBJECT device_object,
    1.12    {
    1.13    case IRP_MN_START_DEVICE:
    1.14      KdPrint((__DRIVER_NAME "     IRP_MN_START_DEVICE - DeviceObject = %p\n", stack->DeviceObject));
    1.15 -#if 0
    1.16 -    crl = stack->Parameters.StartDevice.AllocatedResourcesTranslated;
    1.17 -    prl = &crl->List[0].PartialResourceList;
    1.18 -    for (i = 0; i < prl->Count; i++)
    1.19 -    {
    1.20 -      prd = &prl->PartialDescriptors[i];
    1.21 -      if (prd->Type == CmResourceTypeMemory)
    1.22 -      {
    1.23 -        ptr = MmMapIoSpace(prd->u.Memory.Start, prd->u.Memory.Length, MmNonCached);
    1.24 -        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_RING, "ring-ref", NULL);
    1.25 -        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_EVENT_CHANNEL_IRQ, "event-channel", NULL);
    1.26 -        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_FRONT, "device-type", NULL);
    1.27 -        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sectors", NULL);
    1.28 -        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sector-size", NULL);
    1.29 -        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_VECTORS, NULL, NULL);
    1.30 -        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_GRANT_ENTRIES, UlongToPtr(GRANT_ENTRIES), NULL);
    1.31 -        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_END, NULL, NULL);        
    1.32 -      }
    1.33 -    }
    1.34 -#endif
    1.35      old_crl = stack->Parameters.StartDevice.AllocatedResourcesTranslated;
    1.36      if (old_crl != NULL)
    1.37      {
    1.38 @@ -107,7 +88,7 @@ XenVbd_Pnp(PDEVICE_OBJECT device_object,
    1.39        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sectors", NULL);
    1.40        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sector-size", NULL);
    1.41        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_VECTORS, NULL, NULL);
    1.42 -      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_GRANT_ENTRIES, UlongToPtr(GRANT_ENTRIES), NULL);
    1.43 +      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_GRANT_ENTRIES, NULL, UlongToPtr(GRANT_ENTRIES));
    1.44        ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_END, NULL, NULL);
    1.45        
    1.46        stack->Parameters.StartDevice.AllocatedResourcesTranslated = new_crl;
    1.47 @@ -175,6 +156,7 @@ XenVbd_Pnp(PDEVICE_OBJECT device_object,
    1.48  
    1.49    return status;
    1.50  }
    1.51 +#endif
    1.52  
    1.53  NTSTATUS
    1.54  DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
    1.55 @@ -209,6 +191,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    1.56  
    1.57    status = ScsiPortInitialize(DriverObject, RegistryPath, &HwInitializationData, NULL);
    1.58    
    1.59 +
    1.60 +#if 0
    1.61    /* DriverObject will be NULL if we are being called in dump mode */
    1.62    if (DriverObject != NULL)
    1.63    {
    1.64 @@ -218,6 +202,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    1.65    }
    1.66    else
    1.67      XenVbd_Pnp_Original = NULL;
    1.68 +#endif
    1.69  
    1.70    if(!NT_SUCCESS(status))
    1.71    {