win-pvdrivers

changeset 283:3c65d6c6453f wdm

Fixed a sense problem with xenscsi. scsi passthrough now working properly.
author James Harper <james.harper@bendigoit.com.au>
date Tue May 27 22:46:06 2008 +1000 (2008-05-27)
parents 652b93df8917
children 4954c15a4921
files xenpci/xenbus.c xenpci/xenpci.inx xenpci/xenpci_fdo.c xenpci/xenpci_pdo.c xenscsi/scsiport.c xenscsi/xenscsi.c xenvbd/scsiport.c xenvbd/xenvbd.c
line diff
     1.1 --- a/xenpci/xenbus.c	Mon May 26 11:56:06 2008 +1000
     1.2 +++ b/xenpci/xenbus.c	Tue May 27 22:46:06 2008 +1000
     1.3 @@ -557,7 +557,6 @@ XenBus_WatchThreadProc(PVOID StartContex
     1.4        entry->Running = 1;
     1.5        KeReleaseSpinLock(&xpdd->WatchLock, OldIrql);
     1.6        entry->Count++;
     1.7 -KdPrint((__DRIVER_NAME " --- for %s\n", xpdd->XenBus_WatchRing[xpdd->XenBus_WatchRingReadIndex].Path));
     1.8        entry->ServiceRoutine(xpdd->XenBus_WatchRing[xpdd->XenBus_WatchRingReadIndex].Path, entry->ServiceContext);
     1.9        entry->Running = 0;
    1.10        KeSetEvent(&entry->CompleteEvent, 1, FALSE);
    1.11 @@ -587,8 +586,8 @@ XenBus_SendAddWatch(
    1.12  
    1.13    rep = xenbus_msg_reply(xpdd, XS_WATCH, xbt, req, ARRAY_SIZE(req));
    1.14    msg = errmsg(rep);
    1.15 -
    1.16 -  ExFreePoolWithTag(rep, XENPCI_POOL_TAG);
    1.17 +  if (!msg)
    1.18 +    ExFreePoolWithTag(rep, XENPCI_POOL_TAG);
    1.19  
    1.20    return msg;
    1.21  }
     2.1 --- a/xenpci/xenpci.inx	Mon May 26 11:56:06 2008 +1000
     2.2 +++ b/xenpci/xenpci.inx	Tue May 27 22:46:06 2008 +1000
     2.3 @@ -34,10 +34,10 @@ xenpci.sys=1
     2.4  xenhide.sys=1
     2.5  
     2.6  [SourceDisksNames.x86]
     2.7 -1 = %DISK_NAME%,,,\i386
     2.8 +1 = %DISK_NAME%,,,.\i386
     2.9  
    2.10  [SourceDisksNames.amd64]
    2.11 -1 = %DISK_NAME%,,,\amd64
    2.12 +1 = %DISK_NAME%,,,.\amd64
    2.13  
    2.14  [XenPCI_Inst.NT.Services]
    2.15  AddService=XenPCI,2,XenPCI_Service
     3.1 --- a/xenpci/xenpci_fdo.c	Mon May 26 11:56:06 2008 +1000
     3.2 +++ b/xenpci/xenpci_fdo.c	Tue May 27 22:46:06 2008 +1000
     3.3 @@ -569,6 +569,11 @@ XenPci_Pnp_StartDeviceCallback(PDEVICE_O
     3.4    response = XenBus_AddWatch(xpdd, XBT_NIL, "device", XenPci_DeviceWatchHandler, xpdd);
     3.5    KdPrint((__DRIVER_NAME "     device watch response = '%s'\n", response)); 
     3.6  
     3.7 +#if 0
     3.8 +  response = XenBus_AddWatch(xpdd, XBT_NIL, BALLOON_PATH, XenPci_BalloonHandler, Device);
     3.9 +  KdPrint((__DRIVER_NAME "     balloon watch response = '%s'\n", response)); 
    3.10 +#endif
    3.11 +
    3.12    status = IoSetDeviceInterfaceState(&xpdd->interface_name, TRUE);
    3.13    if (!NT_SUCCESS(status))
    3.14    {
    3.15 @@ -896,11 +901,11 @@ XenPci_Pnp_QueryBusRelationsCallback(PDE
    3.16              InsertTailList(&xpdd->child_list, (PLIST_ENTRY)child);
    3.17              device_count++;
    3.18            }
    3.19 -          ExFreePoolWithTag(instances[j], XENPCI_POOL_TAG);
    3.20 +          XenPci_FreeMem(instances[j]);
    3.21          }
    3.22          XenPci_FreeMem(instances);
    3.23        }
    3.24 -      ExFreePoolWithTag(devices[i], XENPCI_POOL_TAG);
    3.25 +      XenPci_FreeMem(devices[i]);
    3.26      }
    3.27      XenPci_FreeMem(devices);
    3.28      dev_relations = ExAllocatePoolWithTag(NonPagedPool, sizeof(DEVICE_RELATIONS) + sizeof(PDEVICE_OBJECT) * (device_count - 1), XENPCI_POOL_TAG);
    3.29 @@ -1189,80 +1194,8 @@ XenPci_Irp_Cleanup_Fdo(PDEVICE_OBJECT de
    3.30  }
    3.31  
    3.32  #if 0
    3.33 -static NTSTATUS
    3.34 -XenPCI_D0Entry(
    3.35 -    IN WDFDEVICE  Device,
    3.36 -    IN WDF_POWER_DEVICE_STATE PreviousState
    3.37 -    )
    3.38 -{
    3.39 -  NTSTATUS status = STATUS_SUCCESS;
    3.40 -
    3.41 -  UNREFERENCED_PARAMETER(Device);
    3.42 -  UNREFERENCED_PARAMETER(PreviousState);
    3.43 -
    3.44 -  KdPrint((__DRIVER_NAME " --> EvtDeviceD0Entry\n"));
    3.45 -
    3.46 -  KdPrint((__DRIVER_NAME " <-- EvtDeviceD0Entry\n"));
    3.47 -
    3.48 -  return status;
    3.49 -}
    3.50 -
    3.51 -static NTSTATUS
    3.52 -XenPCI_D0EntryPostInterruptsEnabled(WDFDEVICE Device, WDF_POWER_DEVICE_STATE PreviousState)
    3.53 -{
    3.54 -  NTSTATUS status = STATUS_SUCCESS;
    3.55 -  //OBJECT_ATTRIBUTES oa;
    3.56 -  char *response;
    3.57 -  char *msgTypes;
    3.58 -  char **Types;
    3.59 -  int i;
    3.60 -  char buffer[128];
    3.61 -  WDFCHILDLIST ChildList;
    3.62 -
    3.63 -  UNREFERENCED_PARAMETER(PreviousState);
    3.64 -
    3.65 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    3.66 -
    3.67 -  XenBus_Start(Device);
    3.68 -
    3.69 -  response = XenBus_AddWatch(Device, XBT_NIL, SYSRQ_PATH, XenBus_SysrqHandler, Device);
    3.70 -  KdPrint((__DRIVER_NAME "     sysrqwatch response = '%s'\n", response)); 
    3.71 -  
    3.72 -  response = XenBus_AddWatch(Device, XBT_NIL, SHUTDOWN_PATH, XenBus_ShutdownHandler, Device);
    3.73 -  KdPrint((__DRIVER_NAME "     shutdown watch response = '%s'\n", response)); 
    3.74 -
    3.75 -  response = XenBus_AddWatch(Device, XBT_NIL, BALLOON_PATH, XenBus_BalloonHandler, Device);
    3.76 -  KdPrint((__DRIVER_NAME "     balloon watch response = '%s'\n", response)); 
    3.77 -
    3.78 -  response = XenBus_AddWatch(Device, XBT_NIL, "device", XenPCI_XenBusWatchHandler, Device);
    3.79 -  KdPrint((__DRIVER_NAME "     device watch response = '%s'\n", response)); 
    3.80 -
    3.81 -  ChildList = WdfFdoGetDefaultChildList(Device);
    3.82 -
    3.83 -  WdfChildListBeginScan(ChildList);
    3.84 -  msgTypes = XenBus_List(Device, XBT_NIL, "device", &Types);
    3.85 -  if (!msgTypes) {
    3.86 -    for (i = 0; Types[i]; i++)
    3.87 -    {
    3.88 -      RtlStringCbPrintfA(buffer, ARRAY_SIZE(buffer), "device/%s", Types[i]);
    3.89 -      XenPCI_XenBusWatchHandler(buffer, Device);
    3.90 -      ExFreePoolWithTag(Types[i], XENPCI_POOL_TAG);
    3.91 -    }
    3.92 -  }
    3.93 -  WdfChildListEndScan(ChildList);
    3.94 -
    3.95 -  XenPci_FreeMem(Types);
    3.96 -
    3.97 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    3.98 -
    3.99 -  return status;
   3.100 -}
   3.101 -
   3.102 -#endif
   3.103 -
   3.104 -#if 0
   3.105  static VOID
   3.106 -XenBus_BalloonHandler(char *Path, PVOID Data)
   3.107 +XenPci_BalloonHandler(char *Path, PVOID Data)
   3.108  {
   3.109    WDFDEVICE Device = Data;
   3.110    char *value;
   3.111 @@ -1288,46 +1221,4 @@ XenBus_BalloonHandler(char *Path, PVOID 
   3.112  
   3.113    KdPrint((__DRIVER_NAME " <-- XenBus_BalloonHandler\n"));
   3.114  }
   3.115 -
   3.116 -static NTSTATUS
   3.117 -XenPCI_DeviceResourceRequirementsQuery(WDFDEVICE Device, WDFIORESREQLIST IoResourceRequirementsList)
   3.118 -{
   3.119 -  NTSTATUS  status;
   3.120 -  WDFIORESLIST resourceList;
   3.121 -  IO_RESOURCE_DESCRIPTOR descriptor;
   3.122 -  PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
   3.123 -
   3.124 -  //KdPrint((__DRIVER_NAME " --> DeviceResourceRequirementsQuery\n"));
   3.125 -
   3.126 -  status = WdfIoResourceListCreate(IoResourceRequirementsList, WDF_NO_OBJECT_ATTRIBUTES, &resourceList);
   3.127 -  if (!NT_SUCCESS(status))
   3.128 -    return status;
   3.129 -
   3.130 -  RtlZeroMemory(&descriptor, sizeof(descriptor));
   3.131 -
   3.132 -  descriptor.Option = 0;
   3.133 -  descriptor.Type = CmResourceTypeMemory;
   3.134 -  descriptor.ShareDisposition = CmResourceShareShared; //CmResourceShareDeviceExclusive;
   3.135 -  descriptor.Flags = CM_RESOURCE_MEMORY_READ_WRITE;
   3.136 -  descriptor.u.Memory.Length = PAGE_SIZE;
   3.137 -  descriptor.u.Memory.Alignment = PAGE_SIZE;
   3.138 -  descriptor.u.Memory.MinimumAddress.QuadPart
   3.139 -    = xpdd->platform_mmio_addr.QuadPart + PAGE_SIZE;
   3.140 -  descriptor.u.Memory.MaximumAddress.QuadPart
   3.141 -    = xpdd->platform_mmio_addr.QuadPart + xpdd->platform_mmio_len - 1;
   3.142 -
   3.143 -  //KdPrint((__DRIVER_NAME "     MinimumAddress = %08x, MaximumAddress = %08X\n", descriptor.u.Memory.MinimumAddress.LowPart, descriptor.u.Memory.MaximumAddress.LowPart));
   3.144 -
   3.145 -  status = WdfIoResourceListAppendDescriptor(resourceList, &descriptor);
   3.146 -  if (!NT_SUCCESS(status))
   3.147 -    return status;
   3.148 -
   3.149 -  status = WdfIoResourceRequirementsListAppendIoResList(IoResourceRequirementsList, resourceList);
   3.150 -  if (!NT_SUCCESS(status))
   3.151 -    return status;
   3.152 -
   3.153 -  //KdPrint((__DRIVER_NAME " <-- DeviceResourceRequirementsQuery\n"));
   3.154 -
   3.155 -  return status;
   3.156 -}
   3.157 -#endif
   3.158 \ No newline at end of file
   3.159 +#endif
     4.1 --- a/xenpci/xenpci_pdo.c	Mon May 26 11:56:06 2008 +1000
     4.2 +++ b/xenpci/xenpci_pdo.c	Tue May 27 22:46:06 2008 +1000
     4.3 @@ -605,6 +605,7 @@ XenPci_Pnp_RemoveDevice(PDEVICE_OBJECT d
     4.4        case XEN_INIT_TYPE_RING: /* frontend ring */
     4.5          GntTbl_EndAccess(xpdd, xppdd->grant_refs[rings], FALSE);
     4.6          FreePages(xppdd->mdls[rings]);
     4.7 +        xppdd->mdls[rings] = NULL;
     4.8          rings++;
     4.9          break;
    4.10        case XEN_INIT_TYPE_EVENT_CHANNEL: /* frontend event channel */
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/xenscsi/scsiport.c	Tue May 27 22:46:06 2008 +1000
     5.3 @@ -0,0 +1,551 @@
     5.4 +/*
     5.5 +PV Drivers for Windows Xen HVM Domains
     5.6 +Copyright (C) 2007 James Harper
     5.7 +
     5.8 +This program is free software; you can redistribute it and/or
     5.9 +modify it under the terms of the GNU General Public License
    5.10 +as published by the Free Software Foundation; either version 2
    5.11 +of the License, or (at your option) any later version.
    5.12 +
    5.13 +This program is distributed in the hope that it will be useful,
    5.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    5.16 +GNU General Public License for more details.
    5.17 +
    5.18 +You should have received a copy of the GNU General Public License
    5.19 +along with this program; if not, write to the Free Software
    5.20 +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    5.21 +*/
    5.22 +
    5.23 +#include "xenscsi.h"
    5.24 +#include <scsi.h>
    5.25 +#include <ntddscsi.h>
    5.26 +#include <ntdddisk.h>
    5.27 +#include <stdlib.h>
    5.28 +#include <xen_public.h>
    5.29 +#include <io/xenbus.h>
    5.30 +#include <io/protocols.h>
    5.31 +
    5.32 +#pragma warning(disable: 4127)
    5.33 +
    5.34 +static vscsiif_shadow_t *
    5.35 +get_shadow_from_freelist(PXENSCSI_DEVICE_DATA xsdd)
    5.36 +{
    5.37 +  if (xsdd->shadow_free == 0)
    5.38 +  {
    5.39 +    KdPrint((__DRIVER_NAME "     No more shadow entries\n"));    
    5.40 +    return NULL;
    5.41 +  }
    5.42 +  xsdd->shadow_free--;
    5.43 +  return &xsdd->shadows[xsdd->shadow_free_list[xsdd->shadow_free]];
    5.44 +}
    5.45 +
    5.46 +static VOID
    5.47 +put_shadow_on_freelist(PXENSCSI_DEVICE_DATA xsdd, vscsiif_shadow_t *shadow)
    5.48 +{
    5.49 +  xsdd->shadow_free_list[xsdd->shadow_free] = (USHORT)shadow->req.rqid;
    5.50 +  shadow->Srb = NULL;
    5.51 +  xsdd->shadow_free++;
    5.52 +}
    5.53 +
    5.54 +static grant_ref_t
    5.55 +get_grant_from_freelist(PXENSCSI_DEVICE_DATA xsdd)
    5.56 +{
    5.57 +  if (xsdd->grant_free == 0)
    5.58 +  {
    5.59 +    KdPrint((__DRIVER_NAME "     No more grant refs\n"));    
    5.60 +    return (grant_ref_t)0x0FFFFFFF;
    5.61 +  }
    5.62 +  xsdd->grant_free--;
    5.63 +  return xsdd->grant_free_list[xsdd->grant_free];
    5.64 +}
    5.65 +
    5.66 +static VOID
    5.67 +put_grant_on_freelist(PXENSCSI_DEVICE_DATA xsdd, grant_ref_t grant)
    5.68 +{
    5.69 +  xsdd->grant_free_list[xsdd->grant_free] = grant;
    5.70 +  xsdd->grant_free++;
    5.71 +}
    5.72 +
    5.73 +static BOOLEAN
    5.74 +XenScsi_HwScsiInterrupt(PVOID DeviceExtension)
    5.75 +{
    5.76 +  PXENSCSI_DEVICE_DATA xsdd = (PXENSCSI_DEVICE_DATA)DeviceExtension;
    5.77 +  PSCSI_REQUEST_BLOCK Srb;
    5.78 +  RING_IDX i, rp;
    5.79 +  int j;
    5.80 +  vscsiif_response_t *rep;
    5.81 +  int more_to_do = TRUE;
    5.82 +  vscsiif_shadow_t *shadow;
    5.83 +  ULONG remaining;
    5.84 +
    5.85 +  //KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    5.86 +
    5.87 +  while (more_to_do)
    5.88 +  {
    5.89 +    rp = xsdd->ring.sring->rsp_prod;
    5.90 +    KeMemoryBarrier();
    5.91 +    for (i = xsdd->ring.rsp_cons; i != rp; i++)
    5.92 +    {
    5.93 +      rep = RING_GET_RESPONSE(&xsdd->ring, i);
    5.94 +      shadow = &xsdd->shadows[rep->rqid];
    5.95 +      KdPrint((__DRIVER_NAME "     Operation complete - result = 0x%08x\n", rep->rslt));
    5.96 +      Srb = shadow->Srb;
    5.97 +      Srb->ScsiStatus = (UCHAR)rep->rslt;
    5.98 +      if (rep->sense_len > 0 && Srb->SenseInfoBuffer != NULL)
    5.99 +      {
   5.100 +        memcpy(Srb->SenseInfoBuffer, rep->sense_buffer, min(Srb->SenseInfoBufferLength, rep->sense_len));
   5.101 +      }
   5.102 +      if (!rep->rslt)
   5.103 +      {
   5.104 +        Srb->SrbStatus = SRB_STATUS_SUCCESS;
   5.105 +      }
   5.106 +      else
   5.107 +      {
   5.108 +        KdPrint((__DRIVER_NAME "     Xen Operation returned error (result = 0x%08x)\n", rep->rslt));
   5.109 +        Srb->SrbStatus = SRB_STATUS_ERROR;
   5.110 +        if (rep->sense_len > 0 && !(Srb->SrbFlags & SRB_FLAGS_DISABLE_AUTOSENSE) && Srb->SenseInfoBuffer != NULL)
   5.111 +        {
   5.112 +          Srb->SrbStatus |= SRB_STATUS_AUTOSENSE_VALID;
   5.113 +        }
   5.114 +      }
   5.115 +      remaining = Srb->DataTransferLength;
   5.116 +      for (j = 0; remaining != 0; j++)
   5.117 +      {
   5.118 +        xsdd->vectors.GntTbl_EndAccess(xsdd->vectors.context, shadow->req.seg[j].gref, TRUE);
   5.119 +        put_grant_on_freelist(xsdd, shadow->req.seg[j].gref);
   5.120 +        shadow->req.seg[j].gref = 0;
   5.121 +        remaining -= shadow->req.seg[j].length;
   5.122 +      }
   5.123 +      put_shadow_on_freelist(xsdd, shadow);
   5.124 +      ScsiPortNotification(RequestComplete, xsdd, Srb);
   5.125 +      ScsiPortNotification(NextRequest, xsdd);
   5.126 +    }
   5.127 +
   5.128 +    xsdd->ring.rsp_cons = i;
   5.129 +    if (i != xsdd->ring.req_prod_pvt)
   5.130 +    {
   5.131 +      RING_FINAL_CHECK_FOR_RESPONSES(&xsdd->ring, more_to_do);
   5.132 +    }
   5.133 +    else
   5.134 +    {
   5.135 +      xsdd->ring.sring->rsp_event = i + 1;
   5.136 +      more_to_do = FALSE;
   5.137 +    }
   5.138 +  }
   5.139 +
   5.140 +  //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.141 +  
   5.142 +  return FALSE; /* we just don't know... */
   5.143 +}
   5.144 +
   5.145 +static VOID
   5.146 +XenScsi_ParseBackendDevice(PXENSCSI_DEVICE_DATA xsdd, PCHAR value)
   5.147 +{
   5.148 +  int i = 0;
   5.149 +  int j = 0;
   5.150 +  BOOLEAN scanning = TRUE;
   5.151 +
   5.152 +  while (scanning)
   5.153 +  {
   5.154 +    if (value[i] == 0)
   5.155 +      scanning = FALSE;
   5.156 +    if (value[i] == ':' || value[i] == 0)
   5.157 +    {
   5.158 +       value[i] = 0;
   5.159 +       xsdd->host = xsdd->channel;
   5.160 +       xsdd->channel = xsdd->id;
   5.161 +       xsdd->id = xsdd->lun;
   5.162 +       xsdd->lun = atoi(&value[j]);
   5.163 +       j = i + 1;
   5.164 +    }
   5.165 +    i++;
   5.166 +  }
   5.167 +  KdPrint((__DRIVER_NAME "     host = %d, channel = %d, id = %d, lun = %d\n",
   5.168 +    xsdd->host, xsdd->channel, xsdd->id, xsdd->lun));  
   5.169 +}
   5.170 +
   5.171 +static ULONG
   5.172 +XenScsi_HwScsiFindAdapter(PVOID DeviceExtension, PVOID HwContext, PVOID BusInformation, PCHAR ArgumentString, PPORT_CONFIGURATION_INFORMATION ConfigInfo, PBOOLEAN Again)
   5.173 +{
   5.174 +  ULONG i;
   5.175 +//  PACCESS_RANGE AccessRange;
   5.176 +  PXENSCSI_DEVICE_DATA xsdd = (PXENSCSI_DEVICE_DATA)DeviceExtension;
   5.177 +//  ULONG status;
   5.178 +//  PXENPCI_XEN_DEVICE_DATA XenDeviceData;
   5.179 +  PACCESS_RANGE access_range;
   5.180 +  PUCHAR ptr;
   5.181 +  USHORT type;
   5.182 +  PCHAR setting, value;
   5.183 +  vscsiif_sring_t *sring;
   5.184 +
   5.185 +  UNREFERENCED_PARAMETER(HwContext);
   5.186 +  UNREFERENCED_PARAMETER(BusInformation);
   5.187 +  UNREFERENCED_PARAMETER(ArgumentString);
   5.188 +
   5.189 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));  
   5.190 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.191 +
   5.192 +  *Again = FALSE;
   5.193 +
   5.194 +  KdPrint((__DRIVER_NAME "     BusInterruptLevel = %d\n", ConfigInfo->BusInterruptLevel));
   5.195 +  KdPrint((__DRIVER_NAME "     BusInterruptVector = %03x\n", ConfigInfo->BusInterruptVector));
   5.196 +
   5.197 +  if (ConfigInfo->NumberOfAccessRanges != 1)
   5.198 +  {
   5.199 +    KdPrint((__DRIVER_NAME "     NumberOfAccessRanges = %d\n", ConfigInfo->NumberOfAccessRanges));    
   5.200 +    return SP_RETURN_BAD_CONFIG;
   5.201 +  }
   5.202 +
   5.203 +  access_range = &((*(ConfigInfo->AccessRanges))[0]);
   5.204 +
   5.205 +  KdPrint((__DRIVER_NAME "     RangeStart = %08x, RangeLength = %08x\n",
   5.206 +    access_range->RangeStart.LowPart, access_range->RangeLength));
   5.207 +
   5.208 +  ptr = ScsiPortGetDeviceBase(
   5.209 +    DeviceExtension,
   5.210 +    ConfigInfo->AdapterInterfaceType,
   5.211 +    ConfigInfo->SystemIoBusNumber,
   5.212 +    access_range->RangeStart,
   5.213 +    access_range->RangeLength,
   5.214 +    !access_range->RangeInMemory);
   5.215 +  //ptr = MmMapIoSpace(access_range->RangeStart, access_range->RangeLength, MmCached);
   5.216 +  if (ptr == NULL)
   5.217 +  {
   5.218 +    KdPrint((__DRIVER_NAME "     Unable to map range\n"));
   5.219 +    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));  
   5.220 +    return SP_RETURN_BAD_CONFIG;
   5.221 +  }
   5.222 +
   5.223 +  sring = NULL;
   5.224 +  xsdd->event_channel = 0;
   5.225 +  while((type = GET_XEN_INIT_RSP(&ptr, &setting, &value)) != XEN_INIT_TYPE_END)
   5.226 +  {
   5.227 +    switch(type)
   5.228 +    {
   5.229 +    case XEN_INIT_TYPE_RING: /* frontend ring */
   5.230 +      KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_RING - %s = %p\n", setting, value));
   5.231 +      if (strcmp(setting, "ring-ref") == 0)
   5.232 +      {
   5.233 +        sring = (vscsiif_sring_t *)value;
   5.234 +        FRONT_RING_INIT(&xsdd->ring, sring, PAGE_SIZE);
   5.235 +      }
   5.236 +      break;
   5.237 +    case XEN_INIT_TYPE_EVENT_CHANNEL: /* frontend event channel */
   5.238 +    case XEN_INIT_TYPE_EVENT_CHANNEL_IRQ: /* frontend event channel */
   5.239 +      KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_EVENT_CHANNEL - %s = %d\n", setting, PtrToUlong(value)));
   5.240 +      if (strcmp(setting, "event-channel") == 0)
   5.241 +      {
   5.242 +        xsdd->event_channel = PtrToUlong(value);
   5.243 +      }
   5.244 +      break;
   5.245 +    case XEN_INIT_TYPE_READ_STRING_BACK:
   5.246 +    case XEN_INIT_TYPE_READ_STRING_FRONT:
   5.247 +      KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_READ_STRING - %s = %s\n", setting, value));
   5.248 +      if (strcmp(setting, "b-dev") == 0)
   5.249 +      {
   5.250 +        XenScsi_ParseBackendDevice(xsdd, value);
   5.251 +      }
   5.252 +      break;
   5.253 +    case XEN_INIT_TYPE_VECTORS:
   5.254 +      KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_VECTORS\n"));
   5.255 +      if (((PXENPCI_VECTORS)value)->length != sizeof(XENPCI_VECTORS) ||
   5.256 +        ((PXENPCI_VECTORS)value)->magic != XEN_DATA_MAGIC)
   5.257 +      {
   5.258 +        KdPrint((__DRIVER_NAME "     vectors mismatch (magic = %08x, length = %d)\n",
   5.259 +          ((PXENPCI_VECTORS)value)->magic, ((PXENPCI_VECTORS)value)->length));
   5.260 +        KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.261 +        return SP_RETURN_BAD_CONFIG;
   5.262 +      }
   5.263 +      else
   5.264 +        memcpy(&xsdd->vectors, value, sizeof(XENPCI_VECTORS));
   5.265 +      break;
   5.266 +    case XEN_INIT_TYPE_GRANT_ENTRIES:
   5.267 +      KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_GRANT_ENTRIES - %d\n", PtrToUlong(setting)));
   5.268 +      if (PtrToUlong(setting) != GRANT_ENTRIES)
   5.269 +      {
   5.270 +        KdPrint((__DRIVER_NAME "     grant entries mismatch\n"));
   5.271 +        KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.272 +        return SP_RETURN_BAD_CONFIG;
   5.273 +      }
   5.274 +      else
   5.275 +      {
   5.276 +        memcpy(&xsdd->grant_free_list, value, sizeof(ULONG) * PtrToUlong(setting));
   5.277 +        xsdd->grant_free = GRANT_ENTRIES;
   5.278 +      }
   5.279 +      break;
   5.280 +    default:
   5.281 +      KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_%d\n", type));
   5.282 +      break;
   5.283 +    }
   5.284 +  }
   5.285 +#if 0
   5.286 +  if (xsdd->device_type == XENSCSI_DEVICETYPE_UNKNOWN
   5.287 +    || sring == NULL
   5.288 +    || xsdd->event_channel == 0)
   5.289 +  {
   5.290 +    KdPrint((__DRIVER_NAME "     Missing settings\n"));
   5.291 +    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.292 +    return SP_RETURN_BAD_CONFIG;
   5.293 +  }
   5.294 +#endif
   5.295 +  ConfigInfo->MaximumTransferLength = VSCSIIF_SG_TABLESIZE * PAGE_SIZE;
   5.296 +  ConfigInfo->NumberOfPhysicalBreaks = VSCSIIF_SG_TABLESIZE - 1;
   5.297 +  ConfigInfo->ScatterGather = TRUE;
   5.298 +  ConfigInfo->AlignmentMask = 0;
   5.299 +  ConfigInfo->NumberOfBuses = 1;
   5.300 +  ConfigInfo->InitiatorBusId[0] = 1;
   5.301 +  ConfigInfo->MaximumNumberOfLogicalUnits = 1;
   5.302 +  ConfigInfo->MaximumNumberOfTargets = 2;
   5.303 +  ConfigInfo->BufferAccessScsiPortControlled = TRUE;
   5.304 +  if (ConfigInfo->Dma64BitAddresses == SCSI_DMA64_SYSTEM_SUPPORTED)
   5.305 +  {
   5.306 +    ConfigInfo->Master = TRUE;
   5.307 +    ConfigInfo->Dma64BitAddresses = SCSI_DMA64_MINIPORT_SUPPORTED;
   5.308 +    KdPrint((__DRIVER_NAME "     Dma64BitAddresses supported\n"));
   5.309 +  }
   5.310 +  else
   5.311 +  {
   5.312 +    ConfigInfo->Master = FALSE;
   5.313 +    KdPrint((__DRIVER_NAME "     Dma64BitAddresses not supported\n"));
   5.314 +  }
   5.315 +
   5.316 +  xsdd->shadow_free = 0;
   5.317 +  memset(xsdd->shadows, 0, sizeof(vscsiif_shadow_t) * SHADOW_ENTRIES);
   5.318 +  for (i = 0; i < SHADOW_ENTRIES; i++)
   5.319 +  {
   5.320 +    xsdd->shadows[i].req.rqid = (USHORT)i;
   5.321 +    put_shadow_on_freelist(xsdd, &xsdd->shadows[i]);
   5.322 +  }
   5.323 +
   5.324 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));  
   5.325 +
   5.326 +  return SP_RETURN_FOUND;
   5.327 +}
   5.328 +
   5.329 +static BOOLEAN
   5.330 +XenScsi_HwScsiInitialize(PVOID DeviceExtension)
   5.331 +{
   5.332 +  //PXENSCSI_DEVICE_DATA xsdd = (PXENSCSI_DEVICE_DATA)DeviceExtension;
   5.333 +  
   5.334 +  UNREFERENCED_PARAMETER(DeviceExtension);
   5.335 +
   5.336 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   5.337 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.338 +
   5.339 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.340 +
   5.341 +  return TRUE;
   5.342 +}
   5.343 +
   5.344 +static VOID
   5.345 +XenScsi_PutSrbOnRing(PXENSCSI_DEVICE_DATA xsdd, PSCSI_REQUEST_BLOCK Srb)
   5.346 +{
   5.347 +  PUCHAR ptr;
   5.348 +  PHYSICAL_ADDRESS physical_address;
   5.349 +  PFN_NUMBER pfn;
   5.350 +  //int i;
   5.351 +  vscsiif_shadow_t *shadow;
   5.352 +  int remaining;
   5.353 +
   5.354 +//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   5.355 +
   5.356 +  shadow = get_shadow_from_freelist(xsdd);
   5.357 +  ASSERT(shadow);
   5.358 +  shadow->Srb = Srb;
   5.359 +  shadow->req.cmd = VSCSIIF_CMND_SCSI;
   5.360 +  memset(shadow->req.cmnd, 0, VSCSIIF_MAX_COMMAND_SIZE);
   5.361 +  memcpy(shadow->req.cmnd, Srb->Cdb, Srb->CdbLength);
   5.362 +  shadow->req.cmd_len = Srb->CdbLength;
   5.363 +  shadow->req.id = (USHORT)xsdd->id;
   5.364 +  shadow->req.lun = (USHORT)xsdd->lun;
   5.365 +  shadow->req.channel = (USHORT)xsdd->channel;
   5.366 +  if (Srb->DataTransferLength && (Srb->SrbFlags & SRB_FLAGS_DATA_IN) && (Srb->SrbFlags & SRB_FLAGS_DATA_OUT))
   5.367 +  {
   5.368 +    KdPrint((__DRIVER_NAME "     Cmd = %02x, Length = %d, DMA_BIDIRECTIONAL\n", Srb->Cdb[0], Srb->DataTransferLength));
   5.369 +    shadow->req.sc_data_direction = DMA_BIDIRECTIONAL;
   5.370 +  }
   5.371 +  else if (Srb->DataTransferLength && (Srb->SrbFlags & SRB_FLAGS_DATA_IN))
   5.372 +  {
   5.373 +    KdPrint((__DRIVER_NAME "     Cmd = %02x, Length = %d, DMA_FROM_DEVICE\n", Srb->Cdb[0], Srb->DataTransferLength));
   5.374 +    shadow->req.sc_data_direction = DMA_FROM_DEVICE;
   5.375 +  }
   5.376 +  else if (Srb->DataTransferLength && (Srb->SrbFlags & SRB_FLAGS_DATA_OUT))
   5.377 +  {
   5.378 +    KdPrint((__DRIVER_NAME "     Cmd = %02x, Length = %d, DMA_TO_DEVICE\n", Srb->Cdb[0], Srb->DataTransferLength));
   5.379 +    shadow->req.sc_data_direction = DMA_TO_DEVICE;
   5.380 +  }
   5.381 +  else
   5.382 +  {
   5.383 +    KdPrint((__DRIVER_NAME "     Cmd = %02x, Length = %d, DMA_NONE\n", Srb->Cdb[0], Srb->DataTransferLength));
   5.384 +    shadow->req.sc_data_direction = DMA_NONE;
   5.385 +  }
   5.386 +  //shadow->req.use_sg = (UINT8)((Srb->DataTransferLength + PAGE_SIZE - 1) >> PAGE_SHIFT);
   5.387 +  shadow->req.request_bufflen = Srb->DataTransferLength;
   5.388 +
   5.389 +  remaining = Srb->DataTransferLength;
   5.390 +  shadow->req.seg[0].offset = 0;
   5.391 +  shadow->req.seg[0].length = 0;
   5.392 +
   5.393 +  ptr = Srb->DataBuffer;
   5.394 +
   5.395 +  for (shadow->req.use_sg = 0; remaining != 0; shadow->req.use_sg++)
   5.396 +  {
   5.397 +    physical_address = MmGetPhysicalAddress(ptr);
   5.398 +    pfn = (ULONG)(physical_address.QuadPart >> PAGE_SHIFT);
   5.399 +    shadow->req.seg[shadow->req.use_sg].gref = get_grant_from_freelist(xsdd);
   5.400 +    ASSERT(shadow->req.seg[shadow->req.use_sg].gref);
   5.401 +    xsdd->vectors.GntTbl_GrantAccess(xsdd->vectors.context, 0, (ULONG)pfn, 0, shadow->req.seg[shadow->req.use_sg].gref);
   5.402 +    shadow->req.seg[shadow->req.use_sg].offset = (USHORT)(physical_address.LowPart & (PAGE_SIZE - 1));
   5.403 +    shadow->req.seg[shadow->req.use_sg].length = (USHORT)min(PAGE_SIZE - shadow->req.seg[shadow->req.use_sg].offset, remaining);
   5.404 +    remaining -= shadow->req.seg[shadow->req.use_sg].length;
   5.405 +    ptr += shadow->req.seg[shadow->req.use_sg].length;
   5.406 +    //KdPrint((__DRIVER_NAME "     Page = %d, Offset = %d, Length = %d, Remaining = %d\n", shadow->req.use_sg, shadow->req.seg[shadow->req.use_sg].offset, shadow->req.seg[shadow->req.use_sg].length, remaining));
   5.407 +  }
   5.408 +  *RING_GET_REQUEST(&xsdd->ring, xsdd->ring.req_prod_pvt) = shadow->req;
   5.409 +  xsdd->ring.req_prod_pvt++;
   5.410 +
   5.411 +//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.412 +}
   5.413 +
   5.414 +static BOOLEAN
   5.415 +XenScsi_HwScsiStartIo(PVOID DeviceExtension, PSCSI_REQUEST_BLOCK Srb)
   5.416 +{
   5.417 +  PXENSCSI_DEVICE_DATA xsdd = DeviceExtension;
   5.418 +  int notify;
   5.419 +
   5.420 +  //KdPrint((__DRIVER_NAME " --> HwScsiStartIo PathId = %d, TargetId = %d, Lun = %d\n", Srb->PathId, Srb->TargetId, Srb->Lun));
   5.421 +
   5.422 +//  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.423 +
   5.424 +  if (Srb->PathId != 0 || Srb->TargetId != 0)
   5.425 +  {
   5.426 +    Srb->SrbStatus = SRB_STATUS_NO_DEVICE;
   5.427 +    ScsiPortNotification(RequestComplete, DeviceExtension, Srb);
   5.428 +    ScsiPortNotification(NextRequest, DeviceExtension, NULL);
   5.429 +    KdPrint((__DRIVER_NAME " --- HwScsiStartIo (Out of bounds)\n"));
   5.430 +    return TRUE;
   5.431 +  }
   5.432 +
   5.433 +  switch (Srb->Function)
   5.434 +  {
   5.435 +  case SRB_FUNCTION_EXECUTE_SCSI:
   5.436 +    XenScsi_PutSrbOnRing(xsdd, Srb);
   5.437 +    RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&xsdd->ring, notify);
   5.438 +    if (notify)
   5.439 +      xsdd->vectors.EvtChn_Notify(xsdd->vectors.context, xsdd->event_channel);
   5.440 +    if (!xsdd->shadow_free)
   5.441 +      ScsiPortNotification(NextRequest, DeviceExtension);
   5.442 +    break;
   5.443 +  case SRB_FUNCTION_IO_CONTROL:
   5.444 +    KdPrint((__DRIVER_NAME "     SRB_FUNCTION_IO_CONTROL\n"));
   5.445 +    Srb->SrbStatus = SRB_STATUS_INVALID_REQUEST;
   5.446 +    ScsiPortNotification(RequestComplete, DeviceExtension, Srb);
   5.447 +    ScsiPortNotification(NextRequest, DeviceExtension, NULL);
   5.448 +    break;
   5.449 +  case SRB_FUNCTION_FLUSH:
   5.450 +    KdPrint((__DRIVER_NAME "     SRB_FUNCTION_FLUSH\n"));
   5.451 +    Srb->SrbStatus = SRB_STATUS_INVALID_REQUEST;
   5.452 +    ScsiPortNotification(RequestComplete, DeviceExtension, Srb);
   5.453 +    ScsiPortNotification(NextRequest, DeviceExtension, NULL);
   5.454 +    break;
   5.455 +  default:
   5.456 +    KdPrint((__DRIVER_NAME "     Unhandled Srb->Function = %08X\n", Srb->Function));
   5.457 +    Srb->SrbStatus = SRB_STATUS_INVALID_REQUEST;
   5.458 +    ScsiPortNotification(RequestComplete, DeviceExtension, Srb);
   5.459 +    ScsiPortNotification(NextRequest, DeviceExtension, NULL);
   5.460 +    break;
   5.461 +  }
   5.462 +
   5.463 +  //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.464 +  return TRUE;
   5.465 +}
   5.466 +
   5.467 +static BOOLEAN
   5.468 +XenScsi_HwScsiResetBus(PVOID DeviceExtension, ULONG PathId)
   5.469 +{
   5.470 +  UNREFERENCED_PARAMETER(DeviceExtension);
   5.471 +  UNREFERENCED_PARAMETER(PathId);
   5.472 +
   5.473 +
   5.474 +  KdPrint((__DRIVER_NAME " --> HwScsiResetBus\n"));
   5.475 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.476 +
   5.477 +  KdPrint((__DRIVER_NAME " <-- HwScsiResetBus\n"));
   5.478 +
   5.479 +  return TRUE;
   5.480 +}
   5.481 +
   5.482 +static BOOLEAN
   5.483 +XenScsi_HwScsiAdapterState(PVOID DeviceExtension, PVOID Context, BOOLEAN SaveState)
   5.484 +{
   5.485 +  UNREFERENCED_PARAMETER(DeviceExtension);
   5.486 +  UNREFERENCED_PARAMETER(Context);
   5.487 +  UNREFERENCED_PARAMETER(SaveState);
   5.488 +
   5.489 +  KdPrint((__DRIVER_NAME " --> HwScsiAdapterState\n"));
   5.490 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.491 +
   5.492 +  KdPrint((__DRIVER_NAME " <-- HwScsiAdapterState\n"));
   5.493 +
   5.494 +  return TRUE;
   5.495 +}
   5.496 +
   5.497 +static SCSI_ADAPTER_CONTROL_STATUS
   5.498 +XenScsi_HwScsiAdapterControl(PVOID DeviceExtension, SCSI_ADAPTER_CONTROL_TYPE ControlType, PVOID Parameters)
   5.499 +{
   5.500 +  SCSI_ADAPTER_CONTROL_STATUS Status = ScsiAdapterControlSuccess;
   5.501 +  PSCSI_SUPPORTED_CONTROL_TYPE_LIST SupportedControlTypeList;
   5.502 +  //KIRQL OldIrql;
   5.503 +
   5.504 +  UNREFERENCED_PARAMETER(DeviceExtension);
   5.505 +
   5.506 +  KdPrint((__DRIVER_NAME " --> HwScsiAdapterControl\n"));
   5.507 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.508 +
   5.509 +  switch (ControlType)
   5.510 +  {
   5.511 +  case ScsiQuerySupportedControlTypes:
   5.512 +    SupportedControlTypeList = (PSCSI_SUPPORTED_CONTROL_TYPE_LIST)Parameters;
   5.513 +    KdPrint((__DRIVER_NAME "     ScsiQuerySupportedControlTypes (Max = %d)\n", SupportedControlTypeList->MaxControlType));
   5.514 +    SupportedControlTypeList->SupportedTypeList[ScsiQuerySupportedControlTypes] = TRUE;
   5.515 +    SupportedControlTypeList->SupportedTypeList[ScsiStopAdapter] = TRUE;
   5.516 +    break;
   5.517 +  case ScsiStopAdapter:
   5.518 +    KdPrint((__DRIVER_NAME "     ScsiStopAdapter\n"));
   5.519 +    break;
   5.520 +  case ScsiRestartAdapter:
   5.521 +    KdPrint((__DRIVER_NAME "     ScsiRestartAdapter\n"));
   5.522 +    break;
   5.523 +  case ScsiSetBootConfig:
   5.524 +    KdPrint((__DRIVER_NAME "     ScsiSetBootConfig\n"));
   5.525 +    break;
   5.526 +  case ScsiSetRunningConfig:
   5.527 +    KdPrint((__DRIVER_NAME "     ScsiSetRunningConfig\n"));
   5.528 +    break;
   5.529 +  default:
   5.530 +    KdPrint((__DRIVER_NAME "     UNKNOWN\n"));
   5.531 +    break;
   5.532 +  }
   5.533 +
   5.534 +  KdPrint((__DRIVER_NAME " <-- HwScsiAdapterControl\n"));
   5.535 +
   5.536 +  return Status;
   5.537 +}
   5.538 +
   5.539 +VOID
   5.540 +XenScsi_FillInitCallbacks(PHW_INITIALIZATION_DATA HwInitializationData)
   5.541 +{
   5.542 +  KdPrint((__DRIVER_NAME " --> "__FUNCTION__ "\n"));
   5.543 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   5.544 +
   5.545 +  HwInitializationData->HwInitialize = XenScsi_HwScsiInitialize;
   5.546 +  HwInitializationData->HwStartIo = XenScsi_HwScsiStartIo;
   5.547 +  HwInitializationData->HwInterrupt = XenScsi_HwScsiInterrupt;
   5.548 +  HwInitializationData->HwFindAdapter = XenScsi_HwScsiFindAdapter;
   5.549 +  HwInitializationData->HwResetBus = XenScsi_HwScsiResetBus;
   5.550 +  HwInitializationData->HwAdapterState = XenScsi_HwScsiAdapterState;
   5.551 +  HwInitializationData->HwAdapterControl = XenScsi_HwScsiAdapterControl;
   5.552 +
   5.553 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   5.554 +}
     6.1 --- a/xenscsi/xenscsi.c	Mon May 26 11:56:06 2008 +1000
     6.2 +++ b/xenscsi/xenscsi.c	Tue May 27 22:46:06 2008 +1000
     6.3 @@ -192,7 +192,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
     6.4    HwInitializationData.MapBuffers = TRUE;
     6.5    HwInitializationData.NeedPhysicalAddresses = FALSE;
     6.6    HwInitializationData.TaggedQueuing = TRUE;
     6.7 -  HwInitializationData.AutoRequestSense = FALSE;
     6.8 +  HwInitializationData.AutoRequestSense = TRUE;
     6.9    HwInitializationData.MultipleRequestPerLu = TRUE;
    6.10    HwInitializationData.ReceiveEvent = FALSE;
    6.11    HwInitializationData.VendorIdLength = 0;
     7.1 --- a/xenvbd/scsiport.c	Mon May 26 11:56:06 2008 +1000
     7.2 +++ b/xenvbd/scsiport.c	Tue May 27 22:46:06 2008 +1000
     7.3 @@ -144,6 +144,7 @@ XenVbd_HwScsiFindAdapter(PVOID DeviceExt
     7.4        KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_RING - %s = %p\n", setting, value));
     7.5        if (strcmp(setting, "ring-ref") == 0)
     7.6        {
     7.7 +        
     7.8          sring = (blkif_sring_t *)value;
     7.9          FRONT_RING_INIT(&xvdd->ring, sring, PAGE_SIZE);
    7.10        }
     8.1 --- a/xenvbd/xenvbd.c	Mon May 26 11:56:06 2008 +1000
     8.2 +++ b/xenvbd/xenvbd.c	Tue May 27 22:46:06 2008 +1000
     8.3 @@ -31,21 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fi
     8.4  
     8.5  DRIVER_INITIALIZE DriverEntry;
     8.6  
     8.7 -static ULONG
     8.8 -XenVbd_HwScsiFindAdapter(PVOID DeviceExtension, PVOID HwContext, PVOID BusInformation, PCHAR ArgumentString, PPORT_CONFIGURATION_INFORMATION ConfigInfo, PBOOLEAN Again);
     8.9 -static BOOLEAN
    8.10 -XenVbd_HwScsiInitialize(PVOID DeviceExtension);
    8.11 -static BOOLEAN
    8.12 -XenVbd_HwScsiStartIo(PVOID DeviceExtension, PSCSI_REQUEST_BLOCK Srb);
    8.13 -static BOOLEAN
    8.14 -XenVbd_HwScsiInterrupt(PVOID DeviceExtension);
    8.15 -static BOOLEAN
    8.16 -XenVbd_HwScsiResetBus(PVOID DeviceExtension, ULONG PathId);
    8.17 -static BOOLEAN
    8.18 -XenVbd_HwScsiAdapterState(PVOID DeviceExtension, PVOID Context, BOOLEAN SaveState);
    8.19 -static SCSI_ADAPTER_CONTROL_STATUS
    8.20 -XenVbd_HwScsiAdapterControl(PVOID DeviceExtension, SCSI_ADAPTER_CONTROL_TYPE ControlType, PVOID Parameters);
    8.21 -
    8.22  #ifdef ALLOC_PRAGMA
    8.23  #pragma alloc_text (INIT, DriverEntry)
    8.24  #endif