win-pvdrivers

changeset 318:0488ef11be09 0.9.10

final changes for 0.9.10
author James Harper <james.harper@bendigoit.com.au>
date Tue Jun 17 20:51:52 2008 +1000 (2008-06-17)
parents 0c6ea46f2199
children 412d78748344
files common.inc installer.nsi xennet/xennet.c xenvbd/scsiport.c xenvbd/xenvbd.c xenvbd/xenvbd.h
line diff
     1.1 --- a/common.inc	Tue Jun 17 14:28:58 2008 +1000
     1.2 +++ b/common.inc	Tue Jun 17 20:51:52 2008 +1000
     1.3 @@ -1,4 +1,4 @@
     1.4 -VERSION=0.9.9.3
     1.5 +VERSION=0.9.10.0
     1.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     1.7  MSC_WARNING_LEVEL=/W4
     1.8  INCLUDES = ..\common\include;..\common\include\public
     2.1 --- a/installer.nsi	Tue Jun 17 14:28:58 2008 +1000
     2.2 +++ b/installer.nsi	Tue Jun 17 20:51:52 2008 +1000
     2.3 @@ -3,7 +3,7 @@
     2.4  
     2.5  !define AppName "Xen PV Drivers"
     2.6  !define StartMenu "$SMPROGRAMS\${AppName}"
     2.7 -!define Version "0.9.10-pre3"
     2.8 +!define Version "0.9.10"
     2.9  #!define Version "$%VERSION%"
    2.10  Name "${AppName}"
    2.11  InstallDir "$PROGRAMFILES\${AppName}"
     3.1 --- a/xennet/xennet.c	Tue Jun 17 14:28:58 2008 +1000
     3.2 +++ b/xennet/xennet.c	Tue Jun 17 20:51:52 2008 +1000
     3.3 @@ -138,6 +138,7 @@ XenNet_Init(
     3.4    NDIS_HANDLE config_handle;
     3.5    NDIS_STRING config_param_name;
     3.6    PNDIS_CONFIGURATION_PARAMETER config_param;
     3.7 +  CHAR buf[128];
     3.8    
     3.9    UNREFERENCED_PARAMETER(OpenErrorStatus);
    3.10  
    3.11 @@ -339,7 +340,7 @@ XenNet_Init(
    3.12    else
    3.13    {
    3.14      KdPrint(("ChecksumOffload = %d\n", config_param->ParameterData.IntegerData));
    3.15 -    xi->config_csum = config_param->ParameterData.IntegerData;
    3.16 +    xi->config_csum = !!config_param->ParameterData.IntegerData;
    3.17    }
    3.18  
    3.19    NdisInitUnicodeString(&config_param_name, L"MTU");
    3.20 @@ -365,9 +366,12 @@ XenNet_Init(
    3.21    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_RING, "rx-ring-ref", NULL);
    3.22    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_EVENT_CHANNEL_IRQ, "event-channel", NULL);
    3.23    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "mac", NULL);
    3.24 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-no-csum-offload", "0");
    3.25 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-sg", "1");
    3.26 -  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-gso-tcpv4", "1");
    3.27 +  RtlStringCbPrintfA(buf, ARRAY_SIZE(buf), "%d", !xi->config_csum);
    3.28 +  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-no-csum-offload", buf);
    3.29 +  RtlStringCbPrintfA(buf, ARRAY_SIZE(buf), "%d", xi->config_sg);
    3.30 +  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-sg", buf);
    3.31 +  RtlStringCbPrintfA(buf, ARRAY_SIZE(buf), "%d", !!xi->config_gso);
    3.32 +  ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-gso-tcpv4", buf);
    3.33    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "request-rx-copy", "1");
    3.34    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_WRITE_STRING, "feature-rx-notify", "1");
    3.35    ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_END, NULL, NULL);
     4.1 --- a/xenvbd/scsiport.c	Tue Jun 17 14:28:58 2008 +1000
     4.2 +++ b/xenvbd/scsiport.c	Tue Jun 17 20:51:52 2008 +1000
     4.3 @@ -146,7 +146,6 @@ XenVbd_HwScsiFindAdapter(PVOID DeviceExt
     4.4      access_range->RangeStart,
     4.5      access_range->RangeLength,
     4.6      !access_range->RangeInMemory);
     4.7 -  //ptr = MmMapIoSpace(access_range->RangeStart, access_range->RangeLength, MmCached);
     4.8    if (ptr == NULL)
     4.9    {
    4.10      KdPrint((__DRIVER_NAME "     Unable to map range\n"));
    4.11 @@ -245,7 +244,7 @@ XenVbd_HwScsiFindAdapter(PVOID DeviceExt
    4.12    xvdd->total_sectors /= xvdd->bytes_per_sector / 512;
    4.13    
    4.14    ConfigInfo->MaximumTransferLength = BLKIF_MAX_SEGMENTS_PER_REQUEST * PAGE_SIZE;
    4.15 -  ConfigInfo->NumberOfPhysicalBreaks = BLKIF_MAX_SEGMENTS_PER_REQUEST - 1;
    4.16 +  ConfigInfo->NumberOfPhysicalBreaks = 0; //BLKIF_MAX_SEGMENTS_PER_REQUEST - 1;
    4.17    ConfigInfo->ScatterGather = TRUE;
    4.18    ConfigInfo->AlignmentMask = 0;
    4.19    ConfigInfo->NumberOfBuses = 1;
     5.1 --- a/xenvbd/xenvbd.c	Tue Jun 17 14:28:58 2008 +1000
     5.2 +++ b/xenvbd/xenvbd.c	Tue Jun 17 20:51:52 2008 +1000
     5.3 @@ -35,129 +35,6 @@ DRIVER_INITIALIZE DriverEntry;
     5.4  #pragma alloc_text (INIT, DriverEntry)
     5.5  #endif
     5.6  
     5.7 -#if 0
     5.8 -static PDRIVER_DISPATCH XenVbd_Pnp_Original;
     5.9 -
    5.10 -static NTSTATUS
    5.11 -XenVbd_Pnp(PDEVICE_OBJECT device_object, PIRP irp)
    5.12 -{
    5.13 -  PIO_STACK_LOCATION stack;
    5.14 -  NTSTATUS status;
    5.15 -  PCM_RESOURCE_LIST old_crl, new_crl;
    5.16 -  ULONG i;
    5.17 -  PCM_PARTIAL_RESOURCE_LIST prl;
    5.18 -  PCM_PARTIAL_RESOURCE_DESCRIPTOR prd;
    5.19 -  ULONG old_length, new_length;
    5.20 -  PMDL mdl;
    5.21 -  PUCHAR start, ptr;
    5.22 -
    5.23 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    5.24 -
    5.25 -  stack = IoGetCurrentIrpStackLocation(irp);
    5.26 -
    5.27 -  // check if the Irp is meant for us... maybe the stack->DeviceObject field?
    5.28 -  
    5.29 -  switch (stack->MinorFunction)
    5.30 -  {
    5.31 -  case IRP_MN_START_DEVICE:
    5.32 -    KdPrint((__DRIVER_NAME "     IRP_MN_START_DEVICE - DeviceObject = %p\n", stack->DeviceObject));
    5.33 -    old_crl = stack->Parameters.StartDevice.AllocatedResourcesTranslated;
    5.34 -    if (old_crl != NULL)
    5.35 -    {
    5.36 -      mdl = AllocateUncachedPage();
    5.37 -      old_length = FIELD_OFFSET(CM_RESOURCE_LIST, List) + 
    5.38 -        FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList) +
    5.39 -        FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) +
    5.40 -        sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) * old_crl->List[0].PartialResourceList.Count;
    5.41 -      new_length = old_length + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) * 1;
    5.42 -      new_crl = ExAllocatePoolWithTag(PagedPool, new_length, XENVBD_POOL_TAG);
    5.43 -      memcpy(new_crl, old_crl, old_length);
    5.44 -      prl = &new_crl->List[0].PartialResourceList;
    5.45 -      prd = &prl->PartialDescriptors[prl->Count++];
    5.46 -      prd->Type = CmResourceTypeMemory;
    5.47 -      prd->ShareDisposition = CmResourceShareDeviceExclusive;
    5.48 -      prd->Flags = CM_RESOURCE_MEMORY_READ_WRITE; //|CM_RESOURCE_MEMORY_PREFETCHABLE; //|CM_RESOURCE_MEMORY_CACHEABLE;
    5.49 -      KdPrint((__DRIVER_NAME "     PFN[0] = %p\n", MmGetMdlPfnArray(mdl)[0]));
    5.50 -      prd->u.Memory.Start.QuadPart = MmGetMdlPfnArray(mdl)[0] << PAGE_SHIFT;
    5.51 -      prd->u.Memory.Length = PAGE_SIZE;
    5.52 -      KdPrint((__DRIVER_NAME "     Start = %08x:%08x, Length = %d\n", prd->u.Memory.Start.HighPart, prd->u.Memory.Start.LowPart, prd->u.Memory.Length));
    5.53 -      ptr = start = MmGetMdlVirtualAddress(mdl);
    5.54 -      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_RING, "ring-ref", NULL);
    5.55 -      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_EVENT_CHANNEL_IRQ, "event-channel", NULL);
    5.56 -      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_FRONT, "device-type", NULL);
    5.57 -      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sectors", NULL);
    5.58 -      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_READ_STRING_BACK, "sector-size", NULL);
    5.59 -      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_VECTORS, NULL, NULL);
    5.60 -      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_GRANT_ENTRIES, NULL, UlongToPtr(GRANT_ENTRIES));
    5.61 -      ADD_XEN_INIT_REQ(&ptr, XEN_INIT_TYPE_END, NULL, NULL);
    5.62 -      
    5.63 -      stack->Parameters.StartDevice.AllocatedResourcesTranslated = new_crl;
    5.64 -
    5.65 -      old_crl = stack->Parameters.StartDevice.AllocatedResources;
    5.66 -      new_crl = ExAllocatePoolWithTag(PagedPool, new_length, XENVBD_POOL_TAG);
    5.67 -      memcpy(new_crl, old_crl, old_length);
    5.68 -      prl = &new_crl->List[0].PartialResourceList;
    5.69 -      prd = &prl->PartialDescriptors[prl->Count++];
    5.70 -      prd->Type = CmResourceTypeMemory;
    5.71 -      prd->ShareDisposition = CmResourceShareDeviceExclusive;
    5.72 -      prd->Flags = CM_RESOURCE_MEMORY_READ_WRITE|CM_RESOURCE_MEMORY_PREFETCHABLE|CM_RESOURCE_MEMORY_CACHEABLE;
    5.73 -      prd->u.Memory.Start.QuadPart = MmGetMdlPfnArray(mdl)[0] << PAGE_SHIFT;
    5.74 -      prd->u.Memory.Length = PAGE_SIZE;
    5.75 -      stack->Parameters.StartDevice.AllocatedResources = new_crl;
    5.76 -      IoCopyCurrentIrpStackLocationToNext(irp);
    5.77 -    }
    5.78 -    status = XenVbd_Pnp_Original(device_object, irp);
    5.79 -
    5.80 -    break;
    5.81 -#if 0
    5.82 -  case IRP_MN_QUERY_STOP_DEVICE:
    5.83 -    KdPrint((__DRIVER_NAME "     IRP_MN_QUERY_STOP_DEVICE\n"));
    5.84 -    status = XenVbd_Pnp_Original(device_object, irp);
    5.85 -    break;
    5.86 -
    5.87 -  case IRP_MN_STOP_DEVICE:
    5.88 -    KdPrint((__DRIVER_NAME "     IRP_MN_STOP_DEVICE\n"));
    5.89 -    status = XenVbd_Pnp_Original(device_object, irp);
    5.90 -    break;
    5.91 -
    5.92 -  case IRP_MN_CANCEL_STOP_DEVICE:
    5.93 -    KdPrint((__DRIVER_NAME "     IRP_MN_CANCEL_STOP_DEVICE\n"));
    5.94 -    status = XenVbd_Pnp_Original(device_object, irp);
    5.95 -    break;
    5.96 -
    5.97 -  case IRP_MN_QUERY_REMOVE_DEVICE:
    5.98 -    KdPrint((__DRIVER_NAME "     IRP_MN_QUERY_REMOVE_DEVICE\n"));
    5.99 -    status = XenVbd_Pnp_Original(device_object, irp);
   5.100 -    break;
   5.101 -
   5.102 -  case IRP_MN_REMOVE_DEVICE:
   5.103 -    KdPrint((__DRIVER_NAME "     IRP_MN_REMOVE_DEVICE\n"));
   5.104 -    status = XenVbd_Pnp_Original(device_object, irp);
   5.105 -    break;
   5.106 -
   5.107 -  case IRP_MN_CANCEL_REMOVE_DEVICE:
   5.108 -    KdPrint((__DRIVER_NAME "     IRP_MN_CANCEL_REMOVE_DEVICE\n"));
   5.109 -    status = XenVbd_Pnp_Original(device_object, irp);
   5.110 -    break;
   5.111 -
   5.112 -  case IRP_MN_SURPRISE_REMOVAL:
   5.113 -    KdPrint((__DRIVER_NAME "     IRP_MN_SURPRISE_REMOVAL\n"));
   5.114 -    status = XenVbd_Pnp_Original(device_object, irp);
   5.115 -    break;
   5.116 -#endif
   5.117 -
   5.118 -  default:
   5.119 -    //KdPrint((__DRIVER_NAME "     Unknown Minor = %d\n", stack->MinorFunction));
   5.120 -    status = XenVbd_Pnp_Original(device_object, irp);
   5.121 -    break;
   5.122 -  }
   5.123 -
   5.124 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__"\n"));
   5.125 -
   5.126 -  return status;
   5.127 -}
   5.128 -#endif
   5.129 -
   5.130  NTSTATUS
   5.131  DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
   5.132  {
   5.133 @@ -191,19 +68,6 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
   5.134  
   5.135    status = ScsiPortInitialize(DriverObject, RegistryPath, &HwInitializationData, NULL);
   5.136    
   5.137 -
   5.138 -#if 0
   5.139 -  /* DriverObject will be NULL if we are being called in dump mode */
   5.140 -  if (DriverObject != NULL)
   5.141 -  {
   5.142 -    /* this is a bit naughty... */
   5.143 -    XenVbd_Pnp_Original = DriverObject->MajorFunction[IRP_MJ_PNP];
   5.144 -    DriverObject->MajorFunction[IRP_MJ_PNP] = XenVbd_Pnp;
   5.145 -  }
   5.146 -  else
   5.147 -    XenVbd_Pnp_Original = NULL;
   5.148 -#endif
   5.149 -
   5.150    if(!NT_SUCCESS(status))
   5.151    {
   5.152      KdPrint((__DRIVER_NAME " ScsiPortInitialize failed with status 0x%08x\n", status));
     6.1 --- a/xenvbd/xenvbd.h	Tue Jun 17 14:28:58 2008 +1000
     6.2 +++ b/xenvbd/xenvbd.h	Tue Jun 17 20:51:52 2008 +1000
     6.3 @@ -117,7 +117,6 @@ struct
     6.4    ULONGLONG total_sectors;
     6.5    XENPCI_VECTORS vectors;
     6.6    PSCSI_REQUEST_BLOCK pending_srb;
     6.7 -  BOOLEAN split_request_in_progress;
     6.8    
     6.9    ULONGLONG interrupts;
    6.10    ULONGLONG aligned_requests;