win-pvdrivers

changeset 76:dfa772949c6e

Working on xennet
author James Harper <james.harper@bendigoit.com.au>
date Thu Dec 27 22:23:33 2007 +1100 (2007-12-27)
parents b7863ede7a37
children b9b4b731f890
files common/include/xen_public.h xenenum/sources xenenum/xenenum.c xenhide/sources xennet/sources xennet/xennet.c xennet/xennet.h xennet/xennet.inx xenpci/sources xenpci/xenpci.c xenvbd/sources
line diff
     1.1 --- a/common/include/xen_public.h	Thu Dec 27 20:49:42 2007 +1100
     1.2 +++ b/common/include/xen_public.h	Thu Dec 27 22:23:33 2007 +1100
     1.3 @@ -113,19 +113,17 @@ typedef struct _XENPCI_IDENTIFICATION_DE
     1.4  {
     1.5    WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER Header;
     1.6    UNICODE_STRING DeviceType;
     1.7 +  char Path[128];
     1.8    ULONG DeviceIndex;
     1.9 -  char Path[128];
    1.10  } XENPCI_IDENTIFICATION_DESCRIPTION, *PXENPCI_IDENTIFICATION_DESCRIPTION;
    1.11  
    1.12  typedef struct {
    1.13    ULONG Magic;
    1.14 -  char BasePath[128];
    1.15 +  char Path[128];
    1.16 +  ULONG DeviceIndex;
    1.17    PXENBUS_WATCH_CALLBACK WatchHandler;
    1.18    PVOID WatchContext;
    1.19 -  //XEN_IFACE_EVTCHN EvtChnInterface;
    1.20 -//  XEN_IFACE_XENBUS XenBusInterface;
    1.21    XEN_IFACE XenInterface;
    1.22 -//  XEN_IFACE_GNTTBL GntTblInterface;
    1.23    BOOLEAN AutoEnumerate;
    1.24    CM_PARTIAL_RESOURCE_DESCRIPTOR InterruptRaw;
    1.25    CM_PARTIAL_RESOURCE_DESCRIPTOR InterruptTranslated;
     2.1 --- a/xenenum/sources	Thu Dec 27 20:49:42 2007 +1100
     2.2 +++ b/xenenum/sources	Thu Dec 27 22:23:33 2007 +1100
     2.3 @@ -1,7 +1,7 @@
     2.4  TARGETNAME=xenenum
     2.5  TARGETTYPE=DRIVER
     2.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     2.7 -VERSION=0.5.0.10
     2.8 +VERSION=0.5.0.12
     2.9  KMDF_VERSION=1
    2.10  MSC_WARNING_LEVEL=/W4
    2.11  INF_NAME=xenenum
     3.1 --- a/xenenum/xenenum.c	Thu Dec 27 20:49:42 2007 +1100
     3.2 +++ b/xenenum/xenenum.c	Thu Dec 27 22:23:33 2007 +1100
     3.3 @@ -297,7 +297,7 @@ XenEnum_D0EntryPostInterruptsEnabled(WDF
     3.4  
     3.5    PdoDeviceData = (PXENPCI_XEN_DEVICE_DATA)Pdo->DeviceExtension; //GetXenDeviceData(Device);
     3.6  
     3.7 -  //KdPrint((__DRIVER_NAME "     BasePath = %s\n", PdoDeviceData->BasePath));
     3.8 +  //KdPrint((__DRIVER_NAME "     Path = %s\n", PdoDeviceData->Path));
     3.9    PdoDeviceData->WatchHandler = XenEnum_WatchHandler;
    3.10    PdoDeviceData->WatchContext = Device;
    3.11  
    3.12 @@ -308,14 +308,14 @@ XenEnum_D0EntryPostInterruptsEnabled(WDF
    3.13    if (AutoEnumerate)
    3.14    {
    3.15      // TODO: Get the correct path from parent here...
    3.16 -    msg = XenInterface.XenBus_List(XenInterface.InterfaceHeader.Context, XBT_NIL, PdoDeviceData->BasePath, &Devices);
    3.17 +    msg = XenInterface.XenBus_List(XenInterface.InterfaceHeader.Context, XBT_NIL, PdoDeviceData->Path, &Devices);
    3.18      if (!msg)
    3.19      {
    3.20        for (i = 0; Devices[i]; i++)
    3.21        {
    3.22          KdPrint((__DRIVER_NAME "     found existing device %s\n", Devices[i]));
    3.23 -        KdPrint((__DRIVER_NAME "     faking watch event for %s/%s", PdoDeviceData->BasePath, Devices[i]));
    3.24 -        RtlStringCbPrintfA(buffer, ARRAY_SIZE(buffer), "%s/%s", PdoDeviceData->BasePath, Devices[i]);
    3.25 +        KdPrint((__DRIVER_NAME "     faking watch event for %s/%s", PdoDeviceData->Path, Devices[i]));
    3.26 +        RtlStringCbPrintfA(buffer, ARRAY_SIZE(buffer), "%s/%s", PdoDeviceData->Path, Devices[i]);
    3.27          XenEnum_WatchHandler(buffer, Device);
    3.28          //ExFreePoolWithTag(Devices[i], XENPCI_POOL_TAG);
    3.29        }
    3.30 @@ -448,15 +448,15 @@ XenEnum_WatchHandler(char *Path, PVOID D
    3.31          KdPrint((__FUNCTION__ " No child device data, should never happen\n"));
    3.32          continue;
    3.33        }
    3.34 -      if (strncmp(ChildDeviceData->BasePath, Path, strlen(ChildDeviceData->BasePath)) == 0 && Path[strlen(ChildDeviceData->BasePath)] == '/')
    3.35 +      if (strncmp(ChildDeviceData->Path, Path, strlen(ChildDeviceData->Path)) == 0 && Path[strlen(ChildDeviceData->Path)] == '/')
    3.36        {
    3.37 -        KdPrint((__DRIVER_NAME "     Child Path = %s (Match - WatchHandler = %08x)\n", ChildDeviceData->BasePath, ChildDeviceData->WatchHandler));
    3.38 +        KdPrint((__DRIVER_NAME "     Child Path = %s (Match - WatchHandler = %08x)\n", ChildDeviceData->Path, ChildDeviceData->WatchHandler));
    3.39          if (ChildDeviceData->WatchHandler != NULL)
    3.40            ChildDeviceData->WatchHandler(Path, ChildDeviceData->WatchContext);
    3.41        }
    3.42        else
    3.43        {
    3.44 -        //KdPrint((__DRIVER_NAME "     Child Path = %s (No Match)\n", ChildDeviceData->BasePath));
    3.45 +        //KdPrint((__DRIVER_NAME "     Child Path = %s (No Match)\n", ChildDeviceData->Path));
    3.46        }
    3.47      }
    3.48      WdfChildListEndIteration(ChildList, &ChildIterator);
    3.49 @@ -523,7 +523,7 @@ XenEnum_ChildListCreateDevice(WDFCHILDLI
    3.50    ChildDeviceData->Magic = XEN_DATA_MAGIC;
    3.51    ChildDeviceData->AutoEnumerate = AutoEnumerate;
    3.52    ChildDeviceData->WatchHandler = NULL;
    3.53 -  strncpy(ChildDeviceData->BasePath, XenIdentificationDesc->Path, 128);
    3.54 +  strncpy(ChildDeviceData->Path, XenIdentificationDesc->Path, 128);
    3.55  //  memcpy(&ChildDeviceData->InterruptRaw, &InterruptRaw, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
    3.56  //  memcpy(&ChildDeviceData->InterruptTranslated, &InterruptTranslated, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
    3.57    
     4.1 --- a/xenhide/sources	Thu Dec 27 20:49:42 2007 +1100
     4.2 +++ b/xenhide/sources	Thu Dec 27 22:23:33 2007 +1100
     4.3 @@ -1,7 +1,7 @@
     4.4  TARGETNAME=XENHIDE
     4.5  TARGETTYPE=DRIVER
     4.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     4.7 -VERSION=0.5.0.1
     4.8 +VERSION=0.5.0.2
     4.9  KMDF_VERSION=1
    4.10  MSC_WARNING_LEVEL=/W4
    4.11  INF_NAME=xenhide
     5.1 --- a/xennet/sources	Thu Dec 27 20:49:42 2007 +1100
     5.2 +++ b/xennet/sources	Thu Dec 27 22:23:33 2007 +1100
     5.3 @@ -1,17 +1,13 @@
     5.4  TARGETNAME=XENNET
     5.5  TARGETTYPE=DRIVER
     5.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     5.7 -
     5.8 +VERSION=0.5.0.0
     5.9 +KMDF_VERSION=1
    5.10  MSC_WARNING_LEVEL=/W4
    5.11 -
    5.12 +INF_NAME=xennet
    5.13  INCLUDES = ..\common\include;..\common\include\public
    5.14 -
    5.15 -NO_BINPLACE=1
    5.16 -KMDF_VERSION=1
    5.17  TARGETLIBS=$(DDK_LIB_PATH)\ntstrsafe.lib \
    5.18    $(DDK_LIB_PATH)\ndis.lib
    5.19 -INF_NAME=xennet
    5.20  MISCFILES=$(TARGETPATH)\$(INF_NAME).inf
    5.21  NTTARGETFILES=
    5.22 -
    5.23  SOURCES=xennet.c
     6.1 --- a/xennet/xennet.c	Thu Dec 27 20:49:42 2007 +1100
     6.2 +++ b/xennet/xennet.c	Thu Dec 27 22:23:33 2007 +1100
     6.3 @@ -49,6 +49,7 @@ struct xennet_info
     6.4    PDEVICE_OBJECT fdo;
     6.5    PDEVICE_OBJECT lower_do;
     6.6    WDFDEVICE wdf_device;
     6.7 +  PXENPCI_XEN_DEVICE_DATA pdoData;
     6.8  
     6.9    WCHAR name[NAME_SIZE];
    6.10    NDIS_HANDLE adapter_handle;
    6.11 @@ -59,10 +60,7 @@ struct xennet_info
    6.12  
    6.13    char Path[128];
    6.14    char BackendPath[128];
    6.15 -  XEN_IFACE_EVTCHN EvtChnInterface;
    6.16 -  XEN_IFACE_XENBUS XenBusInterface;
    6.17 -  XEN_IFACE_XEN XenInterface;
    6.18 -  XEN_IFACE_GNTTBL GntTblInterface;
    6.19 +  XEN_IFACE XenInterface;
    6.20  
    6.21    /* ring control structures */
    6.22    struct netif_tx_front_ring tx;
    6.23 @@ -92,7 +90,7 @@ struct xennet_info
    6.24    grant_ref_t tx_ring_ref;
    6.25    grant_ref_t rx_ring_ref;
    6.26  
    6.27 -	/* Receive-ring batched refills. */
    6.28 +  /* Receive-ring batched refills. */
    6.29  #define RX_MIN_TARGET 8
    6.30  #define RX_DFL_MIN_TARGET 64
    6.31  #define RX_MAX_TARGET min(NET_RX_RING_SIZE, 256)
    6.32 @@ -179,7 +177,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
    6.33  
    6.34        id  = txrsp->id;
    6.35        pkt = xi->tx_pkts[id];
    6.36 -      xi->GntTblInterface.EndAccess(xi->GntTblInterface.InterfaceHeader.Context,
    6.37 +      xi->XenInterface.GntTbl_EndAccess(xi->XenInterface.InterfaceHeader.Context,
    6.38          xi->grant_tx_ref[id]);
    6.39        xi->grant_tx_ref[id] = GRANT_INVALID_REF;
    6.40        add_id_to_freelist(xi->tx_pkts, id);
    6.41 @@ -263,8 +261,8 @@ XenNet_AllocRXBuffers(struct xennet_info
    6.42      xi->rx_pkts[id] = packet;
    6.43      req = RING_GET_REQUEST(&xi->rx, req_prod + i);
    6.44      /* an NDIS_BUFFER is just a MDL, so we can get its pfn array */
    6.45 -    ref = xi->GntTblInterface.GrantAccess(
    6.46 -      xi->GntTblInterface.InterfaceHeader.Context, 0,
    6.47 +    ref = xi->XenInterface.GntTbl_GrantAccess(
    6.48 +      xi->XenInterface.InterfaceHeader.Context, 0,
    6.49        *MmGetMdlPfnArray(buffer), FALSE);
    6.50      ASSERT((signed short)ref >= 0);
    6.51      xi->grant_rx_ref[id] = ref;
    6.52 @@ -277,7 +275,7 @@ XenNet_AllocRXBuffers(struct xennet_info
    6.53    RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&xi->rx, notify);
    6.54    if (notify)
    6.55    {
    6.56 -    xi->EvtChnInterface.Notify(xi->EvtChnInterface.InterfaceHeader.Context,
    6.57 +    xi->XenInterface.EvtChn_Notify(xi->XenInterface.InterfaceHeader.Context,
    6.58        xi->event_channel);
    6.59    }
    6.60  
    6.61 @@ -310,7 +308,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    6.62  
    6.63        pkt = xi->rx_pkts[rxrsp->id];
    6.64        xi->rx_pkts[rxrsp->id] = NULL;
    6.65 -      xi->GntTblInterface.EndAccess(xi->GntTblInterface.InterfaceHeader.Context,
    6.66 +      xi->XenInterface.GntTbl_EndAccess(xi->XenInterface.InterfaceHeader.Context,
    6.67          xi->grant_rx_ref[rxrsp->id]);
    6.68        xi->grant_rx_ref[rxrsp->id] = GRANT_INVALID_REF;
    6.69  
    6.70 @@ -402,7 +400,7 @@ XenNet_BackEndStateHandler(char *Path, P
    6.71      {NULL, 0},
    6.72    };
    6.73  
    6.74 -  xi->XenBusInterface.Read(xi->XenBusInterface.InterfaceHeader.Context,
    6.75 +  xi->XenInterface.XenBus_Read(xi->XenInterface.InterfaceHeader.Context,
    6.76      XBT_NIL, Path, &Value);
    6.77    be_state = atoi(Value);
    6.78    ExFreePool(Value);
    6.79 @@ -420,9 +418,9 @@ XenNet_BackEndStateHandler(char *Path, P
    6.80    case XenbusStateInitWait:
    6.81      KdPrint((__DRIVER_NAME "     Backend State Changed to InitWait\n"));  
    6.82  
    6.83 -    xi->event_channel = xi->EvtChnInterface.AllocUnbound(
    6.84 -      xi->EvtChnInterface.InterfaceHeader.Context, 0);  
    6.85 -    xi->EvtChnInterface.Bind(xi->EvtChnInterface.InterfaceHeader.Context,
    6.86 +    xi->event_channel = xi->XenInterface.EvtChn_AllocUnbound(
    6.87 +      xi->XenInterface.InterfaceHeader.Context, 0);  
    6.88 +    xi->XenInterface.EvtChn_Bind(xi->XenInterface.InterfaceHeader.Context,
    6.89        xi->event_channel, XenNet_Interrupt, xi);
    6.90  
    6.91      /* TODO: must free pages in MDL as well as MDL using MmFreePagesFromMdl and ExFreePool */
    6.92 @@ -431,16 +429,16 @@ XenNet_BackEndStateHandler(char *Path, P
    6.93      xi->tx_pgs = MmGetMdlVirtualAddress(xi->tx_mdl); //MmMapLockedPagesSpecifyCache(xi->tx_mdl, KernelMode, MmNonCached, NULL, FALSE, NormalPagePriority);
    6.94      SHARED_RING_INIT(xi->tx_pgs);
    6.95      FRONT_RING_INIT(&xi->tx, xi->tx_pgs, PAGE_SIZE);
    6.96 -    xi->tx_ring_ref = xi->GntTblInterface.GrantAccess(
    6.97 -      xi->GntTblInterface.InterfaceHeader.Context, 0,
    6.98 +    xi->tx_ring_ref = xi->XenInterface.GntTbl_GrantAccess(
    6.99 +      xi->XenInterface.InterfaceHeader.Context, 0,
   6.100        *MmGetMdlPfnArray(xi->tx_mdl), FALSE);
   6.101  
   6.102      xi->rx_mdl = AllocatePage();
   6.103      xi->rx_pgs = MmGetMdlVirtualAddress(xi->rx_mdl); //MmMapLockedPagesSpecifyCache(xi->rx_mdl, KernelMode, MmNonCached, NULL, FALSE, NormalPagePriority);
   6.104      SHARED_RING_INIT(xi->rx_pgs);
   6.105      FRONT_RING_INIT(&xi->rx, xi->rx_pgs, PAGE_SIZE);
   6.106 -    xi->rx_ring_ref = xi->GntTblInterface.GrantAccess(
   6.107 -      xi->GntTblInterface.InterfaceHeader.Context, 0,
   6.108 +    xi->rx_ring_ref = xi->XenInterface.GntTbl_GrantAccess(
   6.109 +      xi->XenInterface.InterfaceHeader.Context, 0,
   6.110        *MmGetMdlPfnArray(xi->rx_mdl), FALSE);
   6.111  
   6.112      /* fixup array for dynamic values */
   6.113 @@ -448,14 +446,14 @@ XenNet_BackEndStateHandler(char *Path, P
   6.114      params[1].value = xi->rx_ring_ref;
   6.115      params[2].value = xi->event_channel;
   6.116  
   6.117 -    xi->XenBusInterface.StartTransaction(
   6.118 -      xi->XenBusInterface.InterfaceHeader.Context, &xbt);
   6.119 +    xi->XenInterface.XenBus_StartTransaction(
   6.120 +      xi->XenInterface.InterfaceHeader.Context, &xbt);
   6.121  
   6.122      for (i = 0; params[i].name; i++)
   6.123      {
   6.124        RtlStringCbPrintfA(TmpPath, ARRAY_SIZE(TmpPath), "%s/%s",
   6.125          xi->Path, params[i].name);
   6.126 -      err = xi->XenBusInterface.Printf(xi->XenBusInterface.InterfaceHeader.Context,
   6.127 +      err = xi->XenInterface.XenBus_Printf(xi->XenInterface.InterfaceHeader.Context,
   6.128          XBT_NIL, TmpPath, "%d", params[i].value);
   6.129        if (err)
   6.130        {
   6.131 @@ -465,14 +463,14 @@ XenNet_BackEndStateHandler(char *Path, P
   6.132      }
   6.133  
   6.134      /* commit transaction */
   6.135 -    xi->XenBusInterface.EndTransaction(xi->XenBusInterface.InterfaceHeader.Context,
   6.136 +    xi->XenInterface.XenBus_EndTransaction(xi->XenInterface.InterfaceHeader.Context,
   6.137        xbt, 0, &retry);
   6.138  
   6.139      XenNet_AllocRXBuffers(xi);
   6.140  
   6.141      KdPrint((__DRIVER_NAME "     Set Frontend state to Connected\n"));
   6.142      RtlStringCbPrintfA(TmpPath, ARRAY_SIZE(TmpPath), "%s/state", xi->Path);
   6.143 -    xi->XenBusInterface.Printf(xi->XenBusInterface.InterfaceHeader.Context,
   6.144 +    xi->XenInterface.XenBus_Printf(xi->XenInterface.InterfaceHeader.Context,
   6.145        XBT_NIL, TmpPath, "%d", XenbusStateConnected);
   6.146  
   6.147      /* send fake arp? */
   6.148 @@ -506,7 +504,7 @@ XenNet_BackEndStateHandler(char *Path, P
   6.149  
   6.150  trouble:
   6.151    KdPrint((__DRIVER_NAME __FUNCTION__ ": Should never happen!\n"));
   6.152 -  xi->XenBusInterface.EndTransaction(xi->XenBusInterface.InterfaceHeader.Context,
   6.153 +  xi->XenInterface.XenBus_EndTransaction(xi->XenInterface.InterfaceHeader.Context,
   6.154      xbt, 1, &retry);
   6.155  
   6.156  }
   6.157 @@ -594,6 +592,7 @@ XenNet_Init(
   6.158  
   6.159    NdisMGetDeviceProperty(MiniportAdapterHandle, &xi->pdo, &xi->fdo,
   6.160      &xi->lower_do, NULL, NULL);
   6.161 +  xi->pdoData = (PXENPCI_XEN_DEVICE_DATA)xi->pdo->DeviceExtension;
   6.162  
   6.163    /* Initialize tx_pkts as a free chain containing every entry. */
   6.164    for (i = 0; i <= NET_TX_RING_SIZE; i++) {
   6.165 @@ -632,45 +631,20 @@ XenNet_Init(
   6.166  
   6.167    /* get lower (Xen) interfaces */
   6.168  
   6.169 -  status = WdfFdoQueryForInterface(xi->wdf_device, &GUID_XEN_IFACE_EVTCHN,
   6.170 -    (PINTERFACE) &xi->EvtChnInterface, sizeof(XEN_IFACE_EVTCHN), 1, NULL);
   6.171 +  status = WdfFdoQueryForInterface(xi->wdf_device, &GUID_XEN_IFACE,
   6.172 +    (PINTERFACE) &xi->XenInterface, sizeof(XEN_IFACE), 1, NULL);
   6.173    if(!NT_SUCCESS(status))
   6.174    {
   6.175 -    KdPrint(("WdfFdoQueryForInterface (EvtChn) failed with status 0x%08x\n", status));
   6.176 -    status = NDIS_STATUS_FAILURE;
   6.177 -    goto err;
   6.178 -  }
   6.179 -
   6.180 -  status = WdfFdoQueryForInterface(xi->wdf_device, &GUID_XEN_IFACE_XENBUS,
   6.181 -    (PINTERFACE) &xi->XenBusInterface, sizeof(XEN_IFACE_XENBUS), 1, NULL);
   6.182 -  if(!NT_SUCCESS(status))
   6.183 -  {
   6.184 -    KdPrint(("WdfFdoQueryForInterface (XenBus) failed with status 0x%08x\n", status));
   6.185 +    KdPrint(("WdfFdoQueryForInterface failed with status 0x%08x\n", status));
   6.186      status = NDIS_STATUS_FAILURE;
   6.187      goto err;
   6.188    }
   6.189  
   6.190 -#if 0
   6.191 -  status = WdfFdoQueryForInterface(xi->wdf_device, &GUID_XEN_IFACE_XEN,
   6.192 -    (PINTERFACE) &xi->XenInterface, sizeof(XEN_IFACE_XEN), 1, NULL);
   6.193 -  if(!NT_SUCCESS(status))
   6.194 -  {
   6.195 -    KdPrint(("WdfFdoQueryForInterface (Xen) failed with status 0x%08x\n", status));
   6.196 -    status = NDIS_STATUS_FAILURE;
   6.197 -    goto err;
   6.198 -  }
   6.199 -#endif
   6.200  
   6.201 -  status = WdfFdoQueryForInterface(xi->wdf_device, &GUID_XEN_IFACE_GNTTBL,
   6.202 -    (PINTERFACE) &xi->GntTblInterface, sizeof(XEN_IFACE_GNTTBL), 1, NULL);
   6.203 -  if(!NT_SUCCESS(status))
   6.204 -  {
   6.205 -    KdPrint(("WdfFdoQueryForInterface (GntTbl) failed with status 0x%08x\n", status));
   6.206 -    status = NDIS_STATUS_FAILURE;
   6.207 -    goto err;
   6.208 -  }
   6.209 +  RtlStringCbPrintfA(TmpPath, ARRAY_SIZE(TmpPath),
   6.210 +      "%s/%d/state", xi->pdoData->Path, xi->pdoData->DeviceIndex);
   6.211  
   6.212 -  msg = xi->XenBusInterface.List(xi->EvtChnInterface.InterfaceHeader.Context,
   6.213 +  msg = xi->XenInterface.XenBus_List(xi->XenInterface.InterfaceHeader.Context,
   6.214      XBT_NIL, "device/vif", &vif_devs);
   6.215    if (msg)
   6.216    {
   6.217 @@ -693,7 +667,7 @@ XenNet_Init(
   6.218      KdPrint(("%s\n", TmpPath));
   6.219  
   6.220      RtlStringCbPrintfA(TmpPath, ARRAY_SIZE(TmpPath), "%s/backend", xi->Path);
   6.221 -    xi->XenBusInterface.Read(xi->XenBusInterface.InterfaceHeader.Context,
   6.222 +    xi->XenInterface.XenBus_Read(xi->XenInterface.InterfaceHeader.Context,
   6.223        XBT_NIL, TmpPath, &Value);
   6.224      if (!Value)
   6.225      {
   6.226 @@ -708,12 +682,12 @@ XenNet_Init(
   6.227  
   6.228      /* Add watch on backend state */
   6.229      RtlStringCbPrintfA(TmpPath, ARRAY_SIZE(TmpPath), "%s/state", xi->BackendPath);
   6.230 -    xi->XenBusInterface.AddWatch(xi->XenBusInterface.InterfaceHeader.Context,
   6.231 +    xi->XenInterface.XenBus_AddWatch(xi->XenInterface.InterfaceHeader.Context,
   6.232        XBT_NIL, TmpPath, XenNet_BackEndStateHandler, xi);
   6.233  
   6.234      /* get mac address */
   6.235      RtlStringCbPrintfA(TmpPath, ARRAY_SIZE(TmpPath), "%s/mac", xi->Path);
   6.236 -    xi->XenBusInterface.Read(xi->XenBusInterface.InterfaceHeader.Context,
   6.237 +    xi->XenInterface.XenBus_Read(xi->XenInterface.InterfaceHeader.Context,
   6.238        XBT_NIL, TmpPath, &Value);
   6.239      if (!Value)
   6.240      {
   6.241 @@ -1066,8 +1040,8 @@ XenNet_SendPackets(
   6.242  
   6.243      tx = RING_GET_REQUEST(&xi->tx, xi->tx.req_prod_pvt);
   6.244      tx->id = id;
   6.245 -    tx->gref = xi->GntTblInterface.GrantAccess(
   6.246 -      xi->GntTblInterface.InterfaceHeader.Context,
   6.247 +    tx->gref = xi->XenInterface.GntTbl_GrantAccess(
   6.248 +      xi->XenInterface.InterfaceHeader.Context,
   6.249        0,
   6.250        *MmGetMdlPfnArray(pmdl),
   6.251        TRUE);
   6.252 @@ -1085,7 +1059,7 @@ XenNet_SendPackets(
   6.253    RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&xi->tx, notify);
   6.254    if (notify)
   6.255    {
   6.256 -    xi->EvtChnInterface.Notify(xi->EvtChnInterface.InterfaceHeader.Context,
   6.257 +    xi->XenInterface.EvtChn_Notify(xi->XenInterface.InterfaceHeader.Context,
   6.258        xi->event_channel);
   6.259    }
   6.260  }
     7.1 --- a/xennet/xennet.h	Thu Dec 27 20:49:42 2007 +1100
     7.2 +++ b/xennet/xennet.h	Thu Dec 27 22:23:33 2007 +1100
     7.3 @@ -42,10 +42,7 @@ Foundation, Inc., 51 Franklin Street, Fi
     7.4  #include <event_channel.h>
     7.5  #include <hvm/params.h>
     7.6  #include <hvm/hvm_op.h>
     7.7 -#include <evtchn_public.h>
     7.8 -#include <xenbus_public.h>
     7.9  #include <xen_public.h>
    7.10 -#include <gnttbl_public.h>
    7.11  #include <io/ring.h>
    7.12  #include <io/netif.h>
    7.13  #define XENNET_POOL_TAG (ULONG) 'XenN'
     8.1 --- a/xennet/xennet.inx	Thu Dec 27 20:49:42 2007 +1100
     8.2 +++ b/xennet/xennet.inx	Thu Dec 27 22:23:33 2007 +1100
     8.3 @@ -3,7 +3,7 @@ Signature="$WINDOWS NT$"
     8.4  Class=Net
     8.5  ClassGuid={4D36E972-E325-11CE-BFC1-08002BE10318}
     8.6  Provider=%JAMESHARPER%
     8.7 -DriverVer=11/11/2007,1.0.1.290
     8.8 +;DriverVer=11/11/2007,1.0.1.290
     8.9  
    8.10  [DestinationDirs]
    8.11  DefaultDestDir = 12
    8.12 @@ -29,12 +29,9 @@ ExcludeFromSelect=*
    8.13  
    8.14  
    8.15  [Manufacturer]
    8.16 -%JAMESHARPER%=JAMESHARPER,NTx86
    8.17 +%JAMESHARPER%=JAMESHARPER,NT$ARCH$
    8.18  
    8.19 -[JAMESHARPER]
    8.20 -%XenNet.DRVDESC%=XenNet_Inst, XEN\VIFDEV
    8.21 -
    8.22 -[JAMESHARPER.NTx86]
    8.23 +[JAMESHARPER.NT$ARCH$]
    8.24  %XenNet.DRVDESC%=XenNet_Inst, XEN\VIFDEV
    8.25  
    8.26  [XenNet_Inst.NT]
    8.27 @@ -54,7 +51,7 @@ xennet.sys
    8.28  xennet.sys=1
    8.29  WdfCoinstaller01005.dll=1,,
    8.30  
    8.31 -[SourceDisksNames.x86]
    8.32 +[SourceDisksNames]
    8.33  1 = %DISK_NAME%,,,\i386
    8.34  
    8.35  [XenNet_Inst.Services]
     9.1 --- a/xenpci/sources	Thu Dec 27 20:49:42 2007 +1100
     9.2 +++ b/xenpci/sources	Thu Dec 27 22:23:33 2007 +1100
     9.3 @@ -1,7 +1,7 @@
     9.4  TARGETNAME=XENPCI
     9.5  TARGETTYPE=DRIVER
     9.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     9.7 -VERSION=0.5.0.3
     9.8 +VERSION=0.5.0.5
     9.9  KMDF_VERSION=1
    9.10  MSC_WARNING_LEVEL=/W4
    9.11  INF_NAME=xenpci
    10.1 --- a/xenpci/xenpci.c	Thu Dec 27 20:49:42 2007 +1100
    10.2 +++ b/xenpci/xenpci.c	Thu Dec 27 22:23:33 2007 +1100
    10.3 @@ -791,7 +791,8 @@ XenPCI_ChildListCreateDevice(
    10.4    ChildDeviceData->Magic = XEN_DATA_MAGIC;
    10.5    ChildDeviceData->AutoEnumerate = AutoEnumerate;
    10.6    ChildDeviceData->WatchHandler = NULL;
    10.7 -  strncpy(ChildDeviceData->BasePath, XenIdentificationDesc->Path, 128);
    10.8 +  strncpy(ChildDeviceData->Path, XenIdentificationDesc->Path, 128);
    10.9 +  ChildDeviceData->DeviceIndex = XenIdentificationDesc->DeviceIndex;
   10.10    memcpy(&ChildDeviceData->InterruptRaw, &InterruptRaw, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
   10.11    memcpy(&ChildDeviceData->InterruptTranslated, &InterruptTranslated, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
   10.12    
   10.13 @@ -883,15 +884,15 @@ XenPCI_XenBusWatchHandler(char *Path, PV
   10.14            KdPrint((__FUNCTION__ " No child device data, should never happen\n"));
   10.15            continue;
   10.16          }
   10.17 -        if (strncmp(ChildDeviceData->BasePath, Path, strlen(ChildDeviceData->BasePath)) == 0 && Path[strlen(ChildDeviceData->BasePath)] == '/')
   10.18 +        if (strncmp(ChildDeviceData->Path, Path, strlen(ChildDeviceData->Path)) == 0 && Path[strlen(ChildDeviceData->Path)] == '/')
   10.19          {
   10.20 -          //KdPrint((__DRIVER_NAME "     Child Path = %s (Match - WatchHandler = %08x)\n", ChildDeviceData->BasePath, ChildDeviceData->WatchHandler));
   10.21 +          //KdPrint((__DRIVER_NAME "     Child Path = %s (Match - WatchHandler = %08x)\n", ChildDeviceData->Path, ChildDeviceData->WatchHandler));
   10.22            if (ChildDeviceData->WatchHandler != NULL)
   10.23              ChildDeviceData->WatchHandler(Path, ChildDeviceData->WatchContext);
   10.24          }
   10.25          else
   10.26          {
   10.27 -          //KdPrint((__DRIVER_NAME "     Child Path = %s (No Match)\n", ChildDeviceData->BasePath));
   10.28 +          //KdPrint((__DRIVER_NAME "     Child Path = %s (No Match)\n", ChildDeviceData->Path));
   10.29          }
   10.30        }
   10.31        WdfChildListEndIteration(ChildList, &ChildIterator);
    11.1 --- a/xenvbd/sources	Thu Dec 27 20:49:42 2007 +1100
    11.2 +++ b/xenvbd/sources	Thu Dec 27 22:23:33 2007 +1100
    11.3 @@ -1,7 +1,7 @@
    11.4  TARGETNAME=XENVBD
    11.5  TARGETTYPE=DRIVER
    11.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
    11.7 -VERSION=0.5.0.3
    11.8 +VERSION=0.5.0.5
    11.9  KMDF_VERSION=1
   11.10  MSC_WARNING_LEVEL=/W4
   11.11  INF_NAME=xenvbd