win-pvdrivers

changeset 95:b55f4ed508b0

Merged and xennet updates
author James Harper <james.harper@bendigoit.com.au>
date Sat Jan 05 14:47:44 2008 +1100 (2008-01-05)
parents ee715addb716
children 652ccd25fc7e
files xenhide/sources xenhide/xenhide.c xennet/sources xennet/xennet.c xenpci/evtchn.c xenpci/sources xenpci/xenbus.c
line diff
     1.1 --- a/xenhide/sources	Thu Jan 03 16:34:04 2008 -0800
     1.2 +++ b/xenhide/sources	Sat Jan 05 14:47:44 2008 +1100
     1.3 @@ -1,7 +1,7 @@
     1.4  TARGETNAME=XENHIDE
     1.5  TARGETTYPE=DRIVER
     1.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     1.7 -VERSION=0.5.0.5
     1.8 +VERSION=0.5.0.7
     1.9  KMDF_VERSION=1
    1.10  MSC_WARNING_LEVEL=/W4
    1.11  INF_NAME=xenhide
     2.1 --- a/xenhide/xenhide.c	Thu Jan 03 16:34:04 2008 -0800
     2.2 +++ b/xenhide/xenhide.c	Sat Jan 05 14:47:44 2008 +1100
     2.3 @@ -54,6 +54,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
     2.4    size_t i;
     2.5  
     2.6    KdPrint((__DRIVER_NAME " --> DriverEntry\n"));
     2.7 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
     2.8  
     2.9    RtlInitUnicodeString(&RegKeyName, L"\\Registry\\Machine\\System\\CurrentControlSet\\Control");
    2.10    InitializeObjectAttributes(&RegObjectAttributes, &RegKeyName, OBJ_CASE_INSENSITIVE, NULL, NULL);
    2.11 @@ -69,6 +70,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
    2.12    {
    2.13      KdPrint((__DRIVER_NAME "     ZwQueryKeyValue returned %08x\n", status));
    2.14    }
    2.15 +  else
    2.16 +    ZwClose(RegHandle);
    2.17    KdPrint((__DRIVER_NAME "     BufLen = %d\n", BufLen));
    2.18    KeyPartialValue = (PKEY_VALUE_PARTIAL_INFORMATION)Buf;
    2.19    KdPrint((__DRIVER_NAME "     Buf = %ws\n", KeyPartialValue->Data));
    2.20 @@ -166,6 +169,7 @@ XenHide_AddDevice(
    2.21    UNREFERENCED_PARAMETER(Driver);
    2.22  
    2.23    KdPrint((__DRIVER_NAME " --> DeviceAdd\n"));
    2.24 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
    2.25  
    2.26    WdfFdoInitSetFilter(DeviceInit);
    2.27  
    2.28 @@ -208,6 +212,7 @@ XenHide_IoCompletion(PDEVICE_OBJECT Devi
    2.29    UNREFERENCED_PARAMETER(Context);
    2.30  
    2.31    KdPrint((__DRIVER_NAME " --> IoCompletion\n"));
    2.32 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
    2.33  
    2.34    Relations = (PDEVICE_RELATIONS)Irp->IoStatus.Information;
    2.35  
    2.36 @@ -265,6 +270,7 @@ XenHide_PreprocessWdmIrpPNP(WDFDEVICE De
    2.37    PIO_STACK_LOCATION Stack;
    2.38  
    2.39    KdPrint((__DRIVER_NAME " --> WdmIrpPreprocessPNP\n"));
    2.40 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
    2.41  
    2.42    Stack = IoGetCurrentIrpStackLocation(Irp);
    2.43  
     3.1 --- a/xennet/sources	Thu Jan 03 16:34:04 2008 -0800
     3.2 +++ b/xennet/sources	Sat Jan 05 14:47:44 2008 +1100
     3.3 @@ -1,7 +1,7 @@
     3.4  TARGETNAME=XENNET
     3.5  TARGETTYPE=DRIVER
     3.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     3.7 -VERSION=0.5.0.39
     3.8 +VERSION=0.5.0.42
     3.9  KMDF_VERSION=1
    3.10  MSC_WARNING_LEVEL=/W4
    3.11  INF_NAME=xennet
     4.1 --- a/xennet/xennet.c	Thu Jan 03 16:34:04 2008 -0800
     4.2 +++ b/xennet/xennet.c	Sat Jan 05 14:47:44 2008 +1100
     4.3 @@ -163,7 +163,7 @@ get_id_from_freelist(NDIS_PACKET **list)
     4.4    return id;
     4.5  }
     4.6  
     4.7 -// Called at DISPATCH_LEVEL with spinlock held
     4.8 +// Called at DISPATCH_LEVEL
     4.9  static NDIS_STATUS
    4.10  XenNet_TxBufferGC(struct xennet_info *xi)
    4.11  {
    4.12 @@ -231,6 +231,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
    4.13    return NDIS_STATUS_SUCCESS;
    4.14  }
    4.15  
    4.16 +// Called at DISPATCH_LEVEL with RxLock held
    4.17  static NDIS_STATUS
    4.18  XenNet_AllocRXBuffers(struct xennet_info *xi)
    4.19  {
    4.20 @@ -305,7 +306,7 @@ XenNet_AllocRXBuffers(struct xennet_info
    4.21    return NDIS_STATUS_SUCCESS;
    4.22  }
    4.23  
    4.24 -// Called at DISPATCH_LEVEL with spinlock held
    4.25 +// Called at DISPATCH_LEVEL
    4.26  static NDIS_STATUS
    4.27  XenNet_RxBufferCheck(struct xennet_info *xi)
    4.28  {
    4.29 @@ -400,6 +401,8 @@ XenNet_Interrupt(
    4.30    return TRUE;
    4.31  }
    4.32  
    4.33 +// Called at <= DISPATCH_LEVEL
    4.34 +
    4.35  static VOID
    4.36  XenNet_BackEndStateHandler(char *Path, PVOID Data)
    4.37  {
    4.38 @@ -410,6 +413,7 @@ XenNet_BackEndStateHandler(char *Path, P
    4.39    int retry = 0;
    4.40    char *err;
    4.41    int i;
    4.42 +  int new_backend_state;
    4.43  
    4.44    struct set_params {
    4.45      char *name;
    4.46 @@ -428,11 +432,23 @@ XenNet_BackEndStateHandler(char *Path, P
    4.47      {NULL, 0},
    4.48    };
    4.49  
    4.50 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    4.51 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
    4.52 +
    4.53    xi->XenInterface.XenBus_Read(xi->XenInterface.InterfaceHeader.Context,
    4.54      XBT_NIL, Path, &Value);
    4.55 -  xi->backend_state = atoi(Value);
    4.56 +  new_backend_state = atoi(Value);
    4.57    xi->XenInterface.FreeMem(Value);
    4.58  
    4.59 +  if (xi->backend_state == new_backend_state)
    4.60 +  {
    4.61 +    KdPrint((__DRIVER_NAME "     state unchanged\n"));
    4.62 +    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    4.63 +    return;
    4.64 +  }    
    4.65 +
    4.66 +  xi->backend_state = new_backend_state;
    4.67 +
    4.68    switch (xi->backend_state)
    4.69    {
    4.70    case XenbusStateUnknown:
    4.71 @@ -531,13 +547,15 @@ XenNet_BackEndStateHandler(char *Path, P
    4.72  
    4.73    KeSetEvent(&xi->backend_state_change_event, 1, FALSE);
    4.74  
    4.75 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    4.76 +
    4.77    return;
    4.78  
    4.79  trouble:
    4.80    KdPrint((__DRIVER_NAME __FUNCTION__ ": Should never happen!\n"));
    4.81    xi->XenInterface.XenBus_EndTransaction(xi->XenInterface.InterfaceHeader.Context,
    4.82      xbt, 1, &retry);
    4.83 -
    4.84 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    4.85  }
    4.86  
    4.87  VOID
    4.88 @@ -558,6 +576,7 @@ XenNet_Halt(
    4.89      XBT_NIL, TmpPath, "%d", xi->state);
    4.90  
    4.91    // wait for backend to set 'Closing' state
    4.92 +
    4.93    while (xi->backend_state != XenbusStateClosing)
    4.94      KeWaitForSingleObject(&xi->backend_state_change_event, Executive, KernelMode, FALSE, NULL);
    4.95  
    4.96 @@ -603,6 +622,9 @@ XenNet_Init(
    4.97    UNREFERENCED_PARAMETER(OpenErrorStatus);
    4.98    UNREFERENCED_PARAMETER(WrapperConfigurationContext);
    4.99  
   4.100 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   4.101 +  KdPrint((__DRIVER_NAME "     IRQL = %d\n", KeGetCurrentIrql()));
   4.102 +
   4.103    /* deal with medium stuff */
   4.104    for (i = 0; i < MediumArraySize; i++)
   4.105    {
   4.106 @@ -725,6 +747,17 @@ XenNet_Init(
   4.107    RtlStringCbCopyA(xi->BackendPath, ARRAY_SIZE(xi->BackendPath), Value);
   4.108    KdPrint((__DRIVER_NAME "backend path = %s\n", xi->BackendPath));
   4.109  
   4.110 +  RtlStringCbPrintfA(TmpPath, ARRAY_SIZE(TmpPath), "%s/type", xi->BackendPath);
   4.111 +  res = xi->XenInterface.XenBus_Read(xi->XenInterface.InterfaceHeader.Context,
   4.112 +      XBT_NIL, TmpPath, &Value);
   4.113 +  if (res || strcmp(Value, "netfront") != 0)
   4.114 +  {
   4.115 +    KdPrint((__DRIVER_NAME "    Backend type is not 'netfront'\n"));
   4.116 +    status = NDIS_STATUS_FAILURE;
   4.117 +    goto err;
   4.118 +  }
   4.119 +
   4.120 +
   4.121    KeInitializeEvent(&xi->backend_state_change_event, SynchronizationEvent, FALSE);  
   4.122  
   4.123    /* Add watch on backend state */
   4.124 @@ -732,10 +765,17 @@ XenNet_Init(
   4.125    xi->XenInterface.XenBus_AddWatch(xi->XenInterface.InterfaceHeader.Context,
   4.126        XBT_NIL, TmpPath, XenNet_BackEndStateHandler, xi);
   4.127  
   4.128 +  // Fire backend state handler here, as we may have missed it
   4.129 +  XenNet_BackEndStateHandler(TmpPath, xi);
   4.130 +
   4.131 +  KdPrint((__DRIVER_NAME "     Waiting for backend to connect\n"));
   4.132 +
   4.133    // wait here for signal that we are all set up
   4.134    while (xi->backend_state != XenbusStateConnected)
   4.135      KeWaitForSingleObject(&xi->backend_state_change_event, Executive, KernelMode, FALSE, NULL);
   4.136  
   4.137 +  KdPrint((__DRIVER_NAME "     Connected\n"));
   4.138 +
   4.139    /* get mac address */
   4.140    RtlStringCbPrintfA(TmpPath, ARRAY_SIZE(TmpPath), "%s/mac", xi->BackendPath);
   4.141    xi->XenInterface.XenBus_Read(xi->XenInterface.InterfaceHeader.Context,
   4.142 @@ -765,10 +805,13 @@ XenNet_Init(
   4.143      xi->XenInterface.FreeMem(Value);
   4.144    }
   4.145  
   4.146 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   4.147 +
   4.148    return NDIS_STATUS_SUCCESS;
   4.149  
   4.150  err:
   4.151    NdisFreeMemory(xi, 0, 0);
   4.152 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   4.153    return status;
   4.154  }
   4.155  
     5.1 --- a/xenpci/evtchn.c	Thu Jan 03 16:34:04 2008 -0800
     5.2 +++ b/xenpci/evtchn.c	Sat Jan 05 14:47:44 2008 +1100
     5.3 @@ -41,6 +41,8 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
     5.4    unsigned long port;
     5.5    ev_action_t *ev_action;
     5.6  
     5.7 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ " (cpu = %d)\n", cpu));
     5.8 +
     5.9    UNREFERENCED_PARAMETER(MessageID);
    5.10  
    5.11    vcpu_info = &shared_info_area->vcpu_info[cpu];
    5.12 @@ -76,6 +78,8 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
    5.13      }
    5.14    }
    5.15  
    5.16 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    5.17 +
    5.18    return FALSE; // This needs to be FALSE so it can fall through to the scsiport ISR.
    5.19  }
    5.20  
     6.1 --- a/xenpci/sources	Thu Jan 03 16:34:04 2008 -0800
     6.2 +++ b/xenpci/sources	Sat Jan 05 14:47:44 2008 +1100
     6.3 @@ -1,7 +1,7 @@
     6.4  TARGETNAME=XENPCI
     6.5  TARGETTYPE=DRIVER
     6.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     6.7 -VERSION=0.5.0.14
     6.8 +VERSION=0.5.0.19
     6.9  KMDF_VERSION=1
    6.10  MSC_WARNING_LEVEL=/W4
    6.11  INF_NAME=xenpci
     7.1 --- a/xenpci/xenbus.c	Thu Jan 03 16:34:04 2008 -0800
     7.2 +++ b/xenpci/xenbus.c	Sat Jan 05 14:47:44 2008 +1100
     7.3 @@ -43,7 +43,7 @@ static int allocate_xenbus_id(WDFDEVICE 
     7.4    static int probe;
     7.5    int o_probe;
     7.6  
     7.7 -  //KdPrint((__DRIVER_NAME " --> allocate_xenbus_id\n"));
     7.8 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     7.9  
    7.10    for (;;)
    7.11    {
    7.12 @@ -70,7 +70,7 @@ static int allocate_xenbus_id(WDFDEVICE 
    7.13    //init_waitqueue_head(&req_info[o_probe].waitq);
    7.14    KeInitializeEvent(&xpdd->req_info[o_probe].WaitEvent, SynchronizationEvent, FALSE);
    7.15  
    7.16 -  //KdPrint((__DRIVER_NAME " <-- allocate_xenbus_id\n"));
    7.17 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    7.18  
    7.19    return o_probe;
    7.20  }
    7.21 @@ -140,7 +140,7 @@ static void xb_write(
    7.22    struct xsd_sockmsg m = {type, req_id, trans_id };
    7.23    struct write_req header_req = { &m, sizeof(m) };
    7.24  
    7.25 -  //KdPrint((__DRIVER_NAME " --> xb_write\n"));
    7.26 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    7.27  
    7.28    for (r = 0; r < nr_reqs; r++)
    7.29      len += req[r].len;
    7.30 @@ -205,7 +205,7 @@ static void xb_write(
    7.31    /* Send evtchn to notify remote */
    7.32    EvtChn_Notify(Device, xpdd->xen_store_evtchn);
    7.33  
    7.34 -  //KdPrint((__DRIVER_NAME " <-- xb_write\n"));
    7.35 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    7.36  }
    7.37  
    7.38  static struct xsd_sockmsg *
    7.39 @@ -219,17 +219,19 @@ xenbus_msg_reply(
    7.40    PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
    7.41    int id;
    7.42  
    7.43 -//  KdPrint((__DRIVER_NAME " --> xenbus_msg_reply\n"));
    7.44 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    7.45  
    7.46    id = allocate_xenbus_id(Device);
    7.47 -  xb_write(Device, type, id, trans, io, nr_reqs);
    7.48 +//  add_waiter(w, req_info[id].waitq);
    7.49  
    7.50  //  KdPrint((__DRIVER_NAME "     starting wait\n"));
    7.51 +
    7.52    KeWaitForSingleObject(&xpdd->req_info[id].WaitEvent, Executive, KernelMode, FALSE, NULL);
    7.53 +
    7.54    //KdPrint((__DRIVER_NAME "     wait complete\n"));
    7.55  
    7.56    release_xenbus_id(Device, id);
    7.57 -//  KdPrint((__DRIVER_NAME " <-- xenbus_msg_reply\n"));
    7.58 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    7.59    return xpdd->req_info[id].Reply;
    7.60  }
    7.61  
    7.62 @@ -246,6 +248,8 @@ XenBus_Read(
    7.63    char *res;
    7.64    char *msg;
    7.65  
    7.66 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    7.67 +
    7.68    rep = xenbus_msg_reply(Device, XS_READ, xbt, req, ARRAY_SIZE(req));
    7.69    msg = errmsg(rep);
    7.70    if (msg) {
    7.71 @@ -257,6 +261,9 @@ XenBus_Read(
    7.72    res[rep->len] = 0;
    7.73    ExFreePoolWithTag(rep, XENPCI_POOL_TAG);
    7.74    *value = res;
    7.75 +
    7.76 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    7.77 +
    7.78    return NULL;
    7.79  }
    7.80  
    7.81 @@ -275,11 +282,16 @@ XenBus_Write(
    7.82    struct xsd_sockmsg *rep;
    7.83    char *msg;
    7.84  
    7.85 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    7.86 +
    7.87    rep = xenbus_msg_reply(Device, XS_WRITE, xbt, req, ARRAY_SIZE(req));
    7.88    msg = errmsg(rep);
    7.89    if (msg)
    7.90      return msg;
    7.91    ExFreePoolWithTag(rep, XENPCI_POOL_TAG);
    7.92 +
    7.93 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    7.94 +
    7.95    return NULL;
    7.96  }
    7.97  
    7.98 @@ -290,7 +302,7 @@ XenBus_Init(WDFDEVICE Device)
    7.99    NTSTATUS Status;
   7.100    int i;
   7.101      
   7.102 -  //KdPrint((__DRIVER_NAME " --> XenBus_Init\n"));
   7.103 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.104  
   7.105    xpdd->xen_store_evtchn = EvtChn_GetXenStorePort(Device);
   7.106    xpdd->xen_store_interface = EvtChn_GetXenStoreRingAddr(Device);
   7.107 @@ -310,7 +322,7 @@ XenBus_Init(WDFDEVICE Device)
   7.108    //Status = PsCreateSystemThread(&XenBus_WatchThreadHandle, THREAD_ALL_ACCESS, &oa, NULL, NULL, XenBus_WatchThreadProc, NULL);
   7.109    Status = PsCreateSystemThread(&xpdd->XenBus_WatchThreadHandle, THREAD_ALL_ACCESS, NULL, NULL, NULL, XenBus_WatchThreadProc, Device);
   7.110  
   7.111 -  KdPrint((__DRIVER_NAME " <-- XenBus_Init\n"));
   7.112 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.113  
   7.114    return STATUS_SUCCESS;
   7.115  }
   7.116 @@ -320,11 +332,11 @@ XenBus_Start(WDFDEVICE Device)
   7.117  {
   7.118    PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
   7.119  
   7.120 -  KdPrint((__DRIVER_NAME " --> XenBus_Start\n"));
   7.121 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.122  
   7.123    EvtChn_BindDpc(Device, xpdd->xen_store_evtchn, XenBus_Interrupt, Device);
   7.124  
   7.125 -  KdPrint((__DRIVER_NAME " <-- XenBus_Start\n"));
   7.126 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.127  
   7.128    return STATUS_SUCCESS;
   7.129  }
   7.130 @@ -335,7 +347,7 @@ XenBus_Stop(WDFDEVICE Device)
   7.131    PXENPCI_DEVICE_DATA xpdd = GetDeviceData(Device);
   7.132    int i;
   7.133  
   7.134 -  KdPrint((__DRIVER_NAME " --> XenBus_Stop\n"));
   7.135 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.136  
   7.137    for (i = 0; i < MAX_WATCH_ENTRIES; i++)
   7.138    {
   7.139 @@ -347,7 +359,7 @@ XenBus_Stop(WDFDEVICE Device)
   7.140  
   7.141    EvtChn_Unbind(Device, xpdd->xen_store_evtchn);
   7.142  
   7.143 -  KdPrint((__DRIVER_NAME " <-- XenBus_Stop\n"));
   7.144 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.145  
   7.146    return STATUS_SUCCESS;
   7.147  }
   7.148 @@ -388,7 +400,7 @@ XenBus_Close(WDFDEVICE Device)
   7.149  
   7.150    ZwClose(xpdd->XenBus_ReadThreadHandle);
   7.151  
   7.152 -  KdPrint((__DRIVER_NAME " <-- XenBus_Close\n"));
   7.153 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.154  
   7.155    return STATUS_SUCCESS;
   7.156  }
   7.157 @@ -407,14 +419,14 @@ XenBus_List(
   7.158    char **res;
   7.159    char *msg;
   7.160  
   7.161 -  //KdPrint((__DRIVER_NAME " --> xenbus_ls\n"));
   7.162 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.163  
   7.164    repmsg = xenbus_msg_reply(Device, XS_DIRECTORY, xbt, req, ARRAY_SIZE(req));
   7.165    msg = errmsg(repmsg);
   7.166    if (msg)
   7.167    {
   7.168      *contents = NULL;
   7.169 -    //KdPrint((__DRIVER_NAME " <-- xenbus_ls (error)\n"));
   7.170 +    KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.171      return msg;
   7.172    }
   7.173    reply = repmsg + 1;
   7.174 @@ -434,7 +446,7 @@ XenBus_List(
   7.175    res[i] = NULL;
   7.176    ExFreePoolWithTag(repmsg, XENPCI_POOL_TAG);
   7.177    *contents = res;
   7.178 -  //KdPrint((__DRIVER_NAME " <-- xenbus_ls\n"));
   7.179 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.180    return NULL;
   7.181  }
   7.182  
   7.183 @@ -579,7 +591,7 @@ XenBus_AddWatch(
   7.184    struct write_req req[2];
   7.185    PXENBUS_WATCH_ENTRY w_entry;
   7.186  
   7.187 -//  KdPrint((__DRIVER_NAME " --> XenBus_AddWatch\n"));
   7.188 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.189  
   7.190    ASSERT(strlen(Path) < ARRAY_SIZE(w_entry->Path));
   7.191  
   7.192 @@ -618,7 +630,7 @@ XenBus_AddWatch(
   7.193      return msg;
   7.194    }
   7.195  
   7.196 -//  KdPrint((__DRIVER_NAME " <-- XenBus_AddWatch\n"));
   7.197 +  KdPrint((__DRIVER_NAME " <-- XenBus_AddWatch\n"));
   7.198  
   7.199    return NULL;
   7.200  }
   7.201 @@ -639,7 +651,7 @@ XenBus_RemWatch(
   7.202    char Token[20];
   7.203    struct write_req req[2];
   7.204  
   7.205 -  //KdPrint((__DRIVER_NAME " --> XenBus_RemWatch\n"));
   7.206 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.207  
   7.208    // check that Path < 128 chars
   7.209  
   7.210 @@ -674,7 +686,7 @@ XenBus_RemWatch(
   7.211  
   7.212    xpdd->XenBus_WatchEntries[i].Active = 0;
   7.213  
   7.214 -  //KdPrint((__DRIVER_NAME " <-- XenBus_RemWatch\n"));
   7.215 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.216  
   7.217    return NULL;
   7.218  }
   7.219 @@ -690,6 +702,8 @@ XenBus_StartTransaction(PVOID Context, x
   7.220    struct xsd_sockmsg *rep;
   7.221    char *err;
   7.222  
   7.223 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.224 +
   7.225    rep = xenbus_msg_reply(Device, XS_TRANSACTION_START, 0, &req, 1);
   7.226    err = errmsg(rep);
   7.227    if (err)
   7.228 @@ -697,6 +711,9 @@ XenBus_StartTransaction(PVOID Context, x
   7.229    *xbt = atoi((char *)(rep + 1));
   7.230    //sscanf((char *)(rep + 1), "%u", xbt);
   7.231    ExFreePoolWithTag(rep, XENPCI_POOL_TAG);
   7.232 +
   7.233 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.234 +
   7.235    return NULL;
   7.236  }
   7.237  
   7.238 @@ -712,6 +729,8 @@ XenBus_EndTransaction(
   7.239    struct write_req req;
   7.240    char *err;
   7.241  
   7.242 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.243 +
   7.244    *retry = 0;
   7.245  
   7.246    req.data = abort ? "F" : "T";
   7.247 @@ -728,6 +747,9 @@ XenBus_EndTransaction(
   7.248      }
   7.249    }
   7.250    ExFreePoolWithTag(rep, XENPCI_POOL_TAG);
   7.251 +
   7.252 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.253 +
   7.254    return NULL;
   7.255  }
   7.256  
   7.257 @@ -739,11 +761,11 @@ XenBus_Interrupt(PKINTERRUPT Interrupt, 
   7.258  
   7.259    UNREFERENCED_PARAMETER(Interrupt);
   7.260  
   7.261 -  //KdPrint((__DRIVER_NAME " --> XenBus_Interrupt (Count = %d)\n", ReadThreadSetCount++));
   7.262 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.263  
   7.264    KeSetEvent(&xpdd->XenBus_ReadThreadEvent, 1, FALSE);
   7.265  
   7.266 -  //KdPrint((__DRIVER_NAME " <-- XenBus_Interrupt\n"));
   7.267 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.268  
   7.269    return TRUE;
   7.270  }
   7.271 @@ -759,9 +781,16 @@ XenBus_Printf(
   7.272    WDFDEVICE Device = Context;
   7.273    va_list ap;
   7.274    char buf[1024];
   7.275 +  char *retval;
   7.276 +
   7.277 +  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   7.278  
   7.279    va_start(ap, fmt);
   7.280    RtlStringCbVPrintfA(buf, ARRAY_SIZE(buf), fmt, ap);
   7.281    va_end(ap);
   7.282 -  return XenBus_Write(Device, xbt, path, buf);
   7.283 +  retval = XenBus_Write(Device, xbt, path, buf);
   7.284 +
   7.285 +  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   7.286 +
   7.287 +  return retval;
   7.288  }