win-pvdrivers

changeset 79:17319a4920eb

Removed some debug messages.
Updated xenhide to now hide the pci network device too.
author James Harper <james.harper@bendigoit.com.au>
date Sun Dec 30 21:47:46 2007 +1100 (2007-12-30)
parents 63da9239cfe2
children 43f57f42508c
files xenenum/sources xenenum/xenenum.c xenhide/sources xenhide/xenhide.c xennet/sources xennet/xennet.c xenpci/evtchn.c xenpci/sources
line diff
     1.1 --- a/xenenum/sources	Sun Dec 30 14:33:08 2007 +1100
     1.2 +++ b/xenenum/sources	Sun Dec 30 21:47:46 2007 +1100
     1.3 @@ -1,7 +1,7 @@
     1.4  TARGETNAME=xenenum
     1.5  TARGETTYPE=DRIVER
     1.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     1.7 -VERSION=0.5.0.11
     1.8 +VERSION=0.5.0.12
     1.9  KMDF_VERSION=1
    1.10  MSC_WARNING_LEVEL=/W4
    1.11  INF_NAME=xenenum
     2.1 --- a/xenenum/xenenum.c	Sun Dec 30 14:33:08 2007 +1100
     2.2 +++ b/xenenum/xenenum.c	Sun Dec 30 21:47:46 2007 +1100
     2.3 @@ -433,10 +433,8 @@ XenEnum_WatchHandler(char *Path, PVOID D
     2.4      RtlInitAnsiString(&AnsiBuf, Bits[1]);
     2.5      RtlAnsiStringToUnicodeString(&IdentificationDescription.DeviceType, &AnsiBuf, TRUE);
     2.6      IdentificationDescription.DeviceIndex = atoi(Bits[2]);
     2.7 -    if (IdentificationDescription.DeviceIndex > 0)
     2.8 -    {
     2.9 -      Status = WdfChildListAddOrUpdateChildDescriptionAsPresent(ChildList, &IdentificationDescription.Header, NULL);
    2.10 -    }
    2.11 +//    if (IdentificationDescription.DeviceIndex > 0)
    2.12 +    Status = WdfChildListAddOrUpdateChildDescriptionAsPresent(ChildList, &IdentificationDescription.Header, NULL);
    2.13    }
    2.14    else if (Count > 3)
    2.15    {
    2.16 @@ -565,11 +563,6 @@ XenEnum_ChildListCreateDevice(WDFCHILDLI
    2.17      return status;
    2.18    }
    2.19  
    2.20 -
    2.21 -
    2.22 -
    2.23 -
    2.24 -
    2.25    KdPrint((__DRIVER_NAME " <-- ChildListCreateDevice (status = %08x)\n", status));
    2.26  
    2.27    return status;
     3.1 --- a/xenhide/sources	Sun Dec 30 14:33:08 2007 +1100
     3.2 +++ b/xenhide/sources	Sun Dec 30 21:47:46 2007 +1100
     3.3 @@ -1,7 +1,7 @@
     3.4  TARGETNAME=XENHIDE
     3.5  TARGETTYPE=DRIVER
     3.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     3.7 -VERSION=0.5.0.2
     3.8 +VERSION=0.5.0.4
     3.9  KMDF_VERSION=1
    3.10  MSC_WARNING_LEVEL=/W4
    3.11  INF_NAME=xenhide
     4.1 --- a/xenhide/xenhide.c	Sun Dec 30 14:33:08 2007 +1100
     4.2 +++ b/xenhide/xenhide.c	Sun Dec 30 21:47:46 2007 +1100
     4.3 @@ -213,20 +213,34 @@ XenHide_IoCompletion(PDEVICE_OBJECT Devi
     4.4  
     4.5    for (i = 0; i < Relations->Count; i++)
     4.6    {
     4.7 +    if (Offset != 0)
     4.8 +      Relations->Objects[i - Offset] = Relations->Objects[i];
     4.9 +
    4.10      Length = sizeof(Buffer);
    4.11 -    IoGetDeviceProperty(Relations->Objects[i], DevicePropertyDeviceDescription, Length, Buffer, &Length);
    4.12 +    IoGetDeviceProperty(Relations->Objects[i - Offset], DevicePropertyDeviceDescription, Length, Buffer, &Length);
    4.13      KdPrint((__DRIVER_NAME "     %3d - %ws\n", i, Buffer));
    4.14 +
    4.15      Length = sizeof(Buffer);
    4.16 -    IoGetDeviceProperty(Relations->Objects[i], DevicePropertyHardwareID, Length, Buffer, &Length);
    4.17 +    IoGetDeviceProperty(Relations->Objects[i - Offset], DevicePropertyPhysicalDeviceObjectName, Length, Buffer, &Length);
    4.18 +    KdPrint((__DRIVER_NAME "     %3d - %ws\n", i, Buffer));
    4.19 +
    4.20 +    Length = sizeof(Buffer);
    4.21 +    IoGetDeviceProperty(Relations->Objects[i - Offset], DevicePropertyHardwareID, Length, Buffer, &Length);
    4.22      Match = 0;
    4.23      StrLen = 0;
    4.24      for (Ptr = Buffer; *Ptr != 0; Ptr += StrLen + 1)
    4.25      {
    4.26        KdPrint((__DRIVER_NAME "         - %ws\n", Ptr));
    4.27 +      // Qemu PCI
    4.28        if (XenHide_StringMatches(Ptr, L"PCI\\VEN_8086&DEV_7010&SUBSYS_00015853")) {
    4.29          Match = 1;
    4.30          break;
    4.31        }
    4.32 +      // Qemu Network
    4.33 +      if (XenHide_StringMatches(Ptr, L"PCI\\VEN_10EC&DEV_8139&SUBSYS_00015853")) {
    4.34 +        Match = 1;
    4.35 +        break;
    4.36 +      }
    4.37        RtlStringCchLengthW(Ptr, Length, &StrLen);
    4.38      }
    4.39      if (Match)
    4.40 @@ -234,8 +248,6 @@ XenHide_IoCompletion(PDEVICE_OBJECT Devi
    4.41        KdPrint((__DRIVER_NAME "           (Match)\n"));
    4.42        Offset++;
    4.43      }
    4.44 -    if (Offset != 0)
    4.45 -      Relations->Objects[i] = Relations->Objects[i + Offset];
    4.46    }
    4.47    Relations->Count -= Offset;
    4.48    
    4.49 @@ -244,8 +256,6 @@ XenHide_IoCompletion(PDEVICE_OBJECT Devi
    4.50    return Irp->IoStatus.Status;
    4.51  }
    4.52  
    4.53 -
    4.54 -
    4.55  static NTSTATUS
    4.56  XenHide_PreprocessWdmIrpPNP(WDFDEVICE Device, PIRP Irp)
    4.57  {
     5.1 --- a/xennet/sources	Sun Dec 30 14:33:08 2007 +1100
     5.2 +++ b/xennet/sources	Sun Dec 30 21:47:46 2007 +1100
     5.3 @@ -1,7 +1,7 @@
     5.4  TARGETNAME=XENNET
     5.5  TARGETTYPE=DRIVER
     5.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     5.7 -VERSION=0.5.0.27
     5.8 +VERSION=0.5.0.28
     5.9  KMDF_VERSION=1
    5.10  MSC_WARNING_LEVEL=/W4
    5.11  INF_NAME=xennet
     6.1 --- a/xennet/xennet.c	Sun Dec 30 14:33:08 2007 +1100
     6.2 +++ b/xennet/xennet.c	Sun Dec 30 21:47:46 2007 +1100
     6.3 @@ -167,7 +167,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
     6.4  
     6.5    ASSERT(xi->connected);
     6.6  
     6.7 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     6.8 +//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     6.9  
    6.10    do {
    6.11      prod = xi->tx.sring->rsp_prod;
    6.12 @@ -221,7 +221,7 @@ XenNet_TxBufferGC(struct xennet_info *xi
    6.13    /* if queued packets, send them now?
    6.14    network_maybe_wake_tx(dev); */
    6.15  
    6.16 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    6.17 +//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    6.18  
    6.19    return NDIS_STATUS_SUCCESS;
    6.20  }
    6.21 @@ -239,7 +239,7 @@ XenNet_AllocRXBuffers(struct xennet_info
    6.22    NDIS_STATUS status;
    6.23    PVOID start;
    6.24  
    6.25 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    6.26 +//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    6.27  
    6.28    batch_target = xi->rx_target - (req_prod - xi->rx.rsp_cons);
    6.29    for (i = 0; i < batch_target; i++)
    6.30 @@ -295,7 +295,7 @@ XenNet_AllocRXBuffers(struct xennet_info
    6.31        xi->event_channel);
    6.32    }
    6.33  
    6.34 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    6.35 +//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    6.36  
    6.37    return NDIS_STATUS_SUCCESS;
    6.38  }
    6.39 @@ -313,7 +313,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    6.40    UINT tot_buff_len;
    6.41    int moretodo;
    6.42  
    6.43 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    6.44 +//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    6.45  
    6.46    ASSERT(xi->connected);
    6.47  
    6.48 @@ -328,7 +328,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    6.49        if (rxrsp->status == NETIF_RSP_NULL)
    6.50          continue;
    6.51  
    6.52 -      KdPrint((__DRIVER_NAME "     Got a packet\n"));
    6.53 +//      KdPrint((__DRIVER_NAME "     Got a packet\n"));
    6.54  
    6.55        pkt = xi->rx_pkts[rxrsp->id];
    6.56        xi->rx_pkts[rxrsp->id] = NULL;
    6.57 @@ -346,9 +346,9 @@ XenNet_RxBufferCheck(struct xennet_info 
    6.58        NDIS_SET_PACKET_STATUS(pkt, NDIS_STATUS_SUCCESS);
    6.59  
    6.60        /* just indicate 1 packet for now */
    6.61 -      KdPrint((__DRIVER_NAME "     Indicating Received\n"));
    6.62 +//      KdPrint((__DRIVER_NAME "     Indicating Received\n"));
    6.63        NdisMIndicateReceivePacket(xi->adapter_handle, &pkt, 1);
    6.64 -      KdPrint((__DRIVER_NAME "     Done Indicating Received\n"));
    6.65 +//      KdPrint((__DRIVER_NAME "     Done Indicating Received\n"));
    6.66      }
    6.67  
    6.68      xi->rx.rsp_cons = prod;
    6.69 @@ -375,7 +375,7 @@ XenNet_RxBufferCheck(struct xennet_info 
    6.70  
    6.71    //xi->rx.sring->rsp_event = xi->rx.rsp_cons + 1;
    6.72  
    6.73 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    6.74 +//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    6.75  
    6.76    return NDIS_STATUS_SUCCESS;
    6.77  }
    6.78 @@ -392,7 +392,7 @@ XenNet_Interrupt(
    6.79  
    6.80    UNREFERENCED_PARAMETER(Interrupt);
    6.81  
    6.82 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    6.83 +//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    6.84  
    6.85    //KdPrint((__DRIVER_NAME "     ***XenNet Interrupt***\n"));  
    6.86  
    6.87 @@ -402,7 +402,7 @@ XenNet_Interrupt(
    6.88      XenNet_RxBufferCheck(xi);
    6.89    }
    6.90  
    6.91 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    6.92 +//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    6.93  
    6.94    return TRUE;
    6.95  }
    6.96 @@ -949,7 +949,7 @@ XenNet_SetInformation(
    6.97    struct xennet_info *xi = MiniportAdapterContext;
    6.98    PULONG64 data = InformationBuffer;
    6.99  
   6.100 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   6.101 +//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   6.102  
   6.103    UNREFERENCED_PARAMETER(MiniportAdapterContext);
   6.104    UNREFERENCED_PARAMETER(InformationBufferLength);
   6.105 @@ -1086,7 +1086,7 @@ XenNet_SetInformation(
   6.106        status = NDIS_STATUS_NOT_SUPPORTED;
   6.107        break;
   6.108    }
   6.109 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   6.110 +//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   6.111    return status;
   6.112  }
   6.113  
   6.114 @@ -1101,7 +1101,7 @@ XenNet_ReturnPacket(
   6.115    UINT buff_len;
   6.116    UINT tot_buff_len;
   6.117  
   6.118 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   6.119 +//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   6.120  
   6.121    UNREFERENCED_PARAMETER(MiniportAdapterContext);
   6.122  
   6.123 @@ -1114,7 +1114,7 @@ XenNet_ReturnPacket(
   6.124    NdisFreePacket(Packet);
   6.125  
   6.126    //KdPrint((__FUNCTION__ " called\n"));
   6.127 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   6.128 +//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   6.129  }
   6.130  
   6.131  PMDL
   6.132 @@ -1128,7 +1128,7 @@ XenNet_Linearize(PNDIS_PACKET Packet)
   6.133    UINT buff_len;
   6.134    UINT tot_buff_len;
   6.135  
   6.136 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   6.137 +//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   6.138  
   6.139    NdisGetFirstBufferFromPacketSafe(Packet, &buffer, &buff_va, &buff_len,
   6.140      &tot_buff_len, NormalPagePriority);
   6.141 @@ -1157,7 +1157,7 @@ XenNet_Linearize(PNDIS_PACKET Packet)
   6.142      NdisGetNextBuffer(buffer, &buffer);
   6.143    }
   6.144  
   6.145 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   6.146 +//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   6.147    return pmdl;
   6.148  }
   6.149  
   6.150 @@ -1177,7 +1177,7 @@ XenNet_SendPackets(
   6.151    PMDL pmdl;
   6.152    UINT pkt_size;
   6.153  
   6.154 -  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   6.155 +//  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
   6.156  
   6.157    for (i = 0; i < NumberOfPackets; i++)
   6.158    {
   6.159 @@ -1226,7 +1226,7 @@ XenNet_SendPackets(
   6.160        xi->event_channel);
   6.161    }
   6.162  
   6.163 -  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   6.164 +//  KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
   6.165  }
   6.166  
   6.167  VOID
     7.1 --- a/xenpci/evtchn.c	Sun Dec 30 14:33:08 2007 +1100
     7.2 +++ b/xenpci/evtchn.c	Sun Dec 30 21:47:46 2007 +1100
     7.3 @@ -65,7 +65,7 @@ EvtChn_Interrupt(WDFINTERRUPT Interrupt,
     7.4        {
     7.5          if (ev_action->DpcFlag)
     7.6          {
     7.7 -          KdPrint((__DRIVER_NAME " --- Scheduling Dpc\n"));
     7.8 +//          KdPrint((__DRIVER_NAME " --- Scheduling Dpc\n"));
     7.9            WdfDpcEnqueue(ev_action->Dpc);
    7.10          }
    7.11          else
     8.1 --- a/xenpci/sources	Sun Dec 30 14:33:08 2007 +1100
     8.2 +++ b/xenpci/sources	Sun Dec 30 21:47:46 2007 +1100
     8.3 @@ -1,7 +1,7 @@
     8.4  TARGETNAME=XENPCI
     8.5  TARGETTYPE=DRIVER
     8.6  TARGETPATH=..\Target\$(DDK_TARGET_OS)
     8.7 -VERSION=0.5.0.10
     8.8 +VERSION=0.5.0.11
     8.9  KMDF_VERSION=1
    8.10  MSC_WARNING_LEVEL=/W4
    8.11  INF_NAME=xenpci