win-pvdrivers

diff xenusb/xenusb_huburb.c @ 1031:329b9b9d47ec

re-enable xenusb. compiles but untested.
author James Harper <james.harper@bendigoit.com.au>
date Thu Feb 21 20:37:38 2013 +1100 (2013-02-21)
parents ea3c61839ff5
children
line diff
     1.1 --- a/xenusb/xenusb_huburb.c	Wed Feb 20 20:49:26 2013 +1100
     1.2 +++ b/xenusb/xenusb_huburb.c	Thu Feb 21 20:37:38 2013 +1100
     1.3 @@ -53,12 +53,12 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
     1.4    urb = (PURB)wrp.Parameters.Others.Arg1;
     1.5    ASSERT(urb);
     1.6  #if 0
     1.7 -  KdPrint((__DRIVER_NAME "     urb = %p\n", urb));
     1.8 -  KdPrint((__DRIVER_NAME "      Length = %d\n", urb->UrbHeader.Length));
     1.9 -  KdPrint((__DRIVER_NAME "      Function = %d\n", urb->UrbHeader.Function));
    1.10 -  KdPrint((__DRIVER_NAME "      Status = %d\n", urb->UrbHeader.Status));
    1.11 -  KdPrint((__DRIVER_NAME "      UsbdDeviceHandle = %p\n", urb->UrbHeader.UsbdDeviceHandle));
    1.12 -  KdPrint((__DRIVER_NAME "      UsbdFlags = %08x\n", urb->UrbHeader.UsbdFlags));
    1.13 +  FUNCTION_MSG("urb = %p\n", urb);
    1.14 +  FUNCTION_MSG(" Length = %d\n", urb->UrbHeader.Length);
    1.15 +  FUNCTION_MSG(" Function = %d\n", urb->UrbHeader.Function);
    1.16 +  FUNCTION_MSG(" Status = %d\n", urb->UrbHeader.Status);
    1.17 +  FUNCTION_MSG(" UsbdDeviceHandle = %p\n", urb->UrbHeader.UsbdDeviceHandle);
    1.18 +  FUNCTION_MSG(" UsbdFlags = %08x\n", urb->UrbHeader.UsbdFlags);
    1.19  #endif
    1.20    usb_device = urb->UrbHeader.UsbdDeviceHandle;
    1.21  
    1.22 @@ -68,7 +68,7 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
    1.23    decode_retval = XenUsb_DecodeControlUrb(urb, &decode_data);
    1.24    if (decode_retval == URB_DECODE_UNKNOWN)
    1.25    {
    1.26 -    FUNCTION_MSG("Unknown URB - Calling WdfRequestCompletestatus with status = %08x\n", STATUS_UNSUCCESSFUL); //STATUS_UNSUCCESSFUL));
    1.27 +    FUNCTION_MSG("Unknown URB - Calling WdfRequestCompletestatus with status = %08x\n", STATUS_UNSUCCESSFUL); //STATUS_UNSUCCESSFUL);
    1.28      urb->UrbHeader.Status = USBD_STATUS_INVALID_URB_FUNCTION;
    1.29      WdfRequestComplete(request, STATUS_UNSUCCESSFUL);
    1.30      return;
    1.31 @@ -95,50 +95,50 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
    1.32    switch(urb->UrbHeader.Function)
    1.33    {
    1.34    case URB_FUNCTION_SELECT_CONFIGURATION:
    1.35 -    KdPrint((__DRIVER_NAME "     URB_FUNCTION_SELECT_CONFIGURATION\n"));
    1.36 -    KdPrint((__DRIVER_NAME "      ConfigurationDescriptor = %p\n", urb->UrbSelectConfiguration.ConfigurationDescriptor));
    1.37 +    FUNCTION_MSG("URB_FUNCTION_SELECT_CONFIGURATION\n");
    1.38 +    FUNCTION_MSG(" ConfigurationDescriptor = %p\n", urb->UrbSelectConfiguration.ConfigurationDescriptor);
    1.39      if (urb->UrbSelectConfiguration.ConfigurationDescriptor)
    1.40      {
    1.41 -      KdPrint((__DRIVER_NAME "       bLength = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bLength));
    1.42 -      KdPrint((__DRIVER_NAME "       bDescriptorType = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bDescriptorType));
    1.43 -      KdPrint((__DRIVER_NAME "       wTotalLength = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->wTotalLength));
    1.44 -      KdPrint((__DRIVER_NAME "       bNumInterfaces = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bNumInterfaces));
    1.45 -      KdPrint((__DRIVER_NAME "       bConfigurationValue = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bConfigurationValue));
    1.46 -      KdPrint((__DRIVER_NAME "       iConfiguration = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->iConfiguration));
    1.47 -      KdPrint((__DRIVER_NAME "       bmAttributes = %04x\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bmAttributes));
    1.48 -      KdPrint((__DRIVER_NAME "       MaxPower = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->MaxPower));
    1.49 +      FUNCTION_MSG("  bLength = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bLength);
    1.50 +      FUNCTION_MSG("  bDescriptorType = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bDescriptorType);
    1.51 +      FUNCTION_MSG("  wTotalLength = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->wTotalLength);
    1.52 +      FUNCTION_MSG("  bNumInterfaces = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bNumInterfaces);
    1.53 +      FUNCTION_MSG("  bConfigurationValue = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bConfigurationValue);
    1.54 +      FUNCTION_MSG("  iConfiguration = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->iConfiguration);
    1.55 +      FUNCTION_MSG("  bmAttributes = %04x\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->bmAttributes);
    1.56 +      FUNCTION_MSG("  MaxPower = %d\n", urb->UrbSelectConfiguration.ConfigurationDescriptor->MaxPower);
    1.57      }
    1.58 -    KdPrint((__DRIVER_NAME "      ConfigurationHandle = %p\n", urb->UrbSelectConfiguration.ConfigurationHandle));
    1.59 +    FUNCTION_MSG(" ConfigurationHandle = %p\n", urb->UrbSelectConfiguration.ConfigurationHandle);
    1.60      if (urb->UrbSelectConfiguration.ConfigurationDescriptor)
    1.61      {
    1.62        urb->UrbSelectConfiguration.ConfigurationHandle = xupdd->usb_device->configs[0];
    1.63        interface_information = &urb->UrbSelectConfiguration.Interface;
    1.64        for (i = 0; i < urb->UrbSelectConfiguration.ConfigurationDescriptor->bNumInterfaces; i++)
    1.65        {
    1.66 -        KdPrint((__DRIVER_NAME "     InterfaceInformation[%d]\n", i));
    1.67 -        KdPrint((__DRIVER_NAME "      Length = %d\n", interface_information->Length));
    1.68 -        KdPrint((__DRIVER_NAME "      InterfaceNumber = %d\n", interface_information->InterfaceNumber));
    1.69 -        KdPrint((__DRIVER_NAME "      AlternateSetting = %d\n", interface_information->AlternateSetting));
    1.70 -        KdPrint((__DRIVER_NAME "      Class = %02x\n", (ULONG)interface_information->Class));
    1.71 -        KdPrint((__DRIVER_NAME "      SubClass = %02x\n", (ULONG)interface_information->SubClass));
    1.72 -        KdPrint((__DRIVER_NAME "      Protocol = %02x\n", (ULONG)interface_information->Protocol));
    1.73 -        KdPrint((__DRIVER_NAME "      Reserved = %02x\n", (ULONG)interface_information->Reserved));
    1.74 -        KdPrint((__DRIVER_NAME "      InterfaceHandle = %p\n", interface_information->InterfaceHandle));
    1.75 -        KdPrint((__DRIVER_NAME "      NumberOfPipes = %d\n", interface_information->NumberOfPipes));
    1.76 +        FUNCTION_MSG("InterfaceInformation[%d]\n", i);
    1.77 +        FUNCTION_MSG(" Length = %d\n", interface_information->Length);
    1.78 +        FUNCTION_MSG(" InterfaceNumber = %d\n", interface_information->InterfaceNumber);
    1.79 +        FUNCTION_MSG(" AlternateSetting = %d\n", interface_information->AlternateSetting);
    1.80 +        FUNCTION_MSG(" Class = %02x\n", (ULONG)interface_information->Class);
    1.81 +        FUNCTION_MSG(" SubClass = %02x\n", (ULONG)interface_information->SubClass);
    1.82 +        FUNCTION_MSG(" Protocol = %02x\n", (ULONG)interface_information->Protocol);
    1.83 +        FUNCTION_MSG(" Reserved = %02x\n", (ULONG)interface_information->Reserved);
    1.84 +        FUNCTION_MSG(" InterfaceHandle = %p\n", interface_information->InterfaceHandle);
    1.85 +        FUNCTION_MSG(" NumberOfPipes = %d\n", interface_information->NumberOfPipes);
    1.86          interface_information->InterfaceHandle = xupdd->usb_device->configs[0]->interfaces[0];
    1.87          interface_information->Class = 0x09;
    1.88          interface_information->SubClass = 0x00;
    1.89          interface_information->SubClass = 0x00;
    1.90          for (j = 0; j < interface_information->NumberOfPipes; j++)
    1.91          {
    1.92 -          KdPrint((__DRIVER_NAME "      Pipe[%d]\n", i));
    1.93 -          KdPrint((__DRIVER_NAME "       MaximumPacketSize = %d\n", interface_information->Pipes[j].MaximumPacketSize));
    1.94 -          KdPrint((__DRIVER_NAME "       EndpointAddress = %d\n", interface_information->Pipes[j].EndpointAddress));
    1.95 -          KdPrint((__DRIVER_NAME "       Interval = %d\n", interface_information->Pipes[j].Interval));
    1.96 -          KdPrint((__DRIVER_NAME "       PipeType = %d\n", interface_information->Pipes[j].PipeType));
    1.97 -          KdPrint((__DRIVER_NAME "       PipeHandle = %d\n", interface_information->Pipes[j].PipeHandle));
    1.98 -          KdPrint((__DRIVER_NAME "       MaximumTransferSize = %d\n", interface_information->Pipes[j].MaximumTransferSize));
    1.99 -          KdPrint((__DRIVER_NAME "       PipeFlags = %08x\n", interface_information->Pipes[j].PipeFlags));
   1.100 +          FUNCTION_MSG(" Pipe[%d]\n", i);
   1.101 +          FUNCTION_MSG("  MaximumPacketSize = %d\n", interface_information->Pipes[j].MaximumPacketSize);
   1.102 +          FUNCTION_MSG("  EndpointAddress = %d\n", interface_information->Pipes[j].EndpointAddress);
   1.103 +          FUNCTION_MSG("  Interval = %d\n", interface_information->Pipes[j].Interval);
   1.104 +          FUNCTION_MSG("  PipeType = %d\n", interface_information->Pipes[j].PipeType);
   1.105 +          FUNCTION_MSG("  PipeHandle = %d\n", interface_information->Pipes[j].PipeHandle);
   1.106 +          FUNCTION_MSG("  MaximumTransferSize = %d\n", interface_information->Pipes[j].MaximumTransferSize);
   1.107 +          FUNCTION_MSG("  PipeFlags = %08x\n", interface_information->Pipes[j].PipeFlags);
   1.108            interface_information->Pipes[j].MaximumPacketSize = 2;
   1.109            interface_information->Pipes[j].EndpointAddress = 0x81;
   1.110            interface_information->Pipes[j].Interval = 12;
   1.111 @@ -153,28 +153,28 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
   1.112      urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.113      break;
   1.114    case URB_FUNCTION_SELECT_INTERFACE:
   1.115 -    KdPrint((__DRIVER_NAME "     URB_FUNCTION_SELECT_INTERFACE\n"));
   1.116 +    FUNCTION_MSG("URB_FUNCTION_SELECT_INTERFACE\n");
   1.117      interface_information = &urb->UrbSelectInterface.Interface;
   1.118 -    KdPrint((__DRIVER_NAME "     InterfaceInformation\n"));
   1.119 -    KdPrint((__DRIVER_NAME "      Length = %d\n", interface_information->Length));
   1.120 -    KdPrint((__DRIVER_NAME "      InterfaceNumber = %d\n", interface_information->InterfaceNumber));
   1.121 -    KdPrint((__DRIVER_NAME "      AlternateSetting = %d\n", interface_information->AlternateSetting));
   1.122 -    KdPrint((__DRIVER_NAME "      Class = %02x\n", (ULONG)interface_information->Class));
   1.123 -    KdPrint((__DRIVER_NAME "      SubClass = %02x\n", (ULONG)interface_information->SubClass));
   1.124 -    KdPrint((__DRIVER_NAME "      Protocol = %02x\n", (ULONG)interface_information->Protocol));
   1.125 -    KdPrint((__DRIVER_NAME "      Reserved = %02x\n", (ULONG)interface_information->Reserved));
   1.126 -    KdPrint((__DRIVER_NAME "      InterfaceHandle = %p\n", interface_information->InterfaceHandle));
   1.127 -    KdPrint((__DRIVER_NAME "      NumberOfPipes = %d\n", interface_information->NumberOfPipes));
   1.128 +    FUNCTION_MSG("InterfaceInformation\n");
   1.129 +    FUNCTION_MSG(" Length = %d\n", interface_information->Length);
   1.130 +    FUNCTION_MSG(" InterfaceNumber = %d\n", interface_information->InterfaceNumber);
   1.131 +    FUNCTION_MSG(" AlternateSetting = %d\n", interface_information->AlternateSetting);
   1.132 +    FUNCTION_MSG(" Class = %02x\n", (ULONG)interface_information->Class);
   1.133 +    FUNCTION_MSG(" SubClass = %02x\n", (ULONG)interface_information->SubClass);
   1.134 +    FUNCTION_MSG(" Protocol = %02x\n", (ULONG)interface_information->Protocol);
   1.135 +    FUNCTION_MSG(" Reserved = %02x\n", (ULONG)interface_information->Reserved);
   1.136 +    FUNCTION_MSG(" InterfaceHandle = %p\n", interface_information->InterfaceHandle);
   1.137 +    FUNCTION_MSG(" NumberOfPipes = %d\n", interface_information->NumberOfPipes);
   1.138      for (i = 0; i < interface_information->NumberOfPipes; i++)
   1.139      {
   1.140 -      KdPrint((__DRIVER_NAME "      Pipe[%d]\n", i));
   1.141 -      KdPrint((__DRIVER_NAME "       MaximumPacketSize = %d\n", interface_information->Pipes[i].MaximumPacketSize));
   1.142 -      KdPrint((__DRIVER_NAME "       EndpointAddress = %d\n", interface_information->Pipes[i].EndpointAddress));
   1.143 -      KdPrint((__DRIVER_NAME "       Interval = %d\n", interface_information->Pipes[i].Interval));
   1.144 -      KdPrint((__DRIVER_NAME "       PipeType = %d\n", interface_information->Pipes[i].PipeType));
   1.145 -      KdPrint((__DRIVER_NAME "       PipeHandle = %d\n", interface_information->Pipes[i].PipeHandle));
   1.146 -      KdPrint((__DRIVER_NAME "       MaximumTransferSize = %d\n", interface_information->Pipes[i].MaximumTransferSize));
   1.147 -      KdPrint((__DRIVER_NAME "       PipeFlags = %08x\n", interface_information->Pipes[i].PipeFlags));
   1.148 +      FUNCTION_MSG(" Pipe[%d]\n", i);
   1.149 +      FUNCTION_MSG("  MaximumPacketSize = %d\n", interface_information->Pipes[i].MaximumPacketSize);
   1.150 +      FUNCTION_MSG("  EndpointAddress = %d\n", interface_information->Pipes[i].EndpointAddress);
   1.151 +      FUNCTION_MSG("  Interval = %d\n", interface_information->Pipes[i].Interval);
   1.152 +      FUNCTION_MSG("  PipeType = %d\n", interface_information->Pipes[i].PipeType);
   1.153 +      FUNCTION_MSG("  PipeHandle = %d\n", interface_information->Pipes[i].PipeHandle);
   1.154 +      FUNCTION_MSG("  MaximumTransferSize = %d\n", interface_information->Pipes[i].MaximumTransferSize);
   1.155 +      FUNCTION_MSG("  PipeFlags = %08x\n", interface_information->Pipes[i].PipeFlags);
   1.156      }
   1.157      urb->UrbHeader.Status = USBD_STATUS_INVALID_URB_FUNCTION;
   1.158      break;
   1.159 @@ -200,7 +200,7 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
   1.160          switch (decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Recipient)
   1.161          {
   1.162          case BMREQUEST_TO_DEVICE:
   1.163 -          KdPrint((__DRIVER_NAME "       Recipient=Device\n"));
   1.164 +          FUNCTION_MSG("  Recipient=Device\n");
   1.165            ((PUSHORT)decode_data.buffer)[0] = 0x0001; /* self powered */
   1.166            urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.167            break;
   1.168 @@ -220,7 +220,7 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
   1.169          case BMREQUEST_TO_OTHER:
   1.170            FUNCTION_MSG(" USB_REQUEST_GET_STATUS\n");
   1.171            FUNCTION_MSG(" Type=Class\n");
   1.172 -          KdPrint((__DRIVER_NAME "       Recipient=Other (port = %d)\n", decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte));
   1.173 +          FUNCTION_MSG("  Recipient=Other (port = %d)\n", decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte);
   1.174            ((PUSHORT)decode_data.buffer)[0] = xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_status;
   1.175            ((PUSHORT)decode_data.buffer)[1] = xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_change;
   1.176            urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.177 @@ -335,15 +335,15 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
   1.178        switch (decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Type)
   1.179        {
   1.180        case BMREQUEST_STANDARD: /* Standard */
   1.181 -        KdPrint((__DRIVER_NAME "       Type=Standard\n"));
   1.182 +        FUNCTION_MSG("  Type=Standard\n");
   1.183          switch (decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Recipient)
   1.184          {
   1.185          case BMREQUEST_TO_DEVICE:
   1.186 -          KdPrint((__DRIVER_NAME "       Recipient=Device\n"));
   1.187 +          FUNCTION_MSG("  Recipient=Device\n");
   1.188            switch (decode_data.setup_packet.default_pipe_setup_packet.wValue.W)
   1.189            {
   1.190            case 1: /* DEVICE_REMOTE_WAKEUP */
   1.191 -            KdPrint((__DRIVER_NAME "       Feature=DEVICE_REMOTE_WAKEUP\n"));
   1.192 +            FUNCTION_MSG("  Feature=DEVICE_REMOTE_WAKEUP\n");
   1.193              /* fake this */
   1.194              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.195              break;
   1.196 @@ -359,45 +359,45 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
   1.197          break;
   1.198          break;
   1.199        case BMREQUEST_CLASS: /* Class */
   1.200 -        KdPrint((__DRIVER_NAME "       Type=Class\n"));
   1.201 +        FUNCTION_MSG("  Type=Class\n");
   1.202          switch (decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Recipient)
   1.203          {
   1.204          case BMREQUEST_TO_OTHER:
   1.205 -          KdPrint((__DRIVER_NAME "       Recipient=Other (port = %d)\n", decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte));
   1.206 +          FUNCTION_MSG("  Recipient=Other (port = %d)\n", decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte);
   1.207            switch (urb->UrbControlVendorClassRequest.Value)
   1.208            {
   1.209            case PORT_ENABLE:
   1.210 -            KdPrint((__DRIVER_NAME "        PORT_ENABLE\n"));
   1.211 +            FUNCTION_MSG("   PORT_ENABLE\n");
   1.212              xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_status &= ~(1 << PORT_ENABLE);
   1.213              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.214              break;
   1.215            case PORT_SUSPEND:
   1.216 -            KdPrint((__DRIVER_NAME "        PORT_SUSPEND (NOOP)\n"));
   1.217 +            FUNCTION_MSG("   PORT_SUSPEND (NOOP)\n");
   1.218              /* do something here */
   1.219              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.220              break;
   1.221            case C_PORT_CONNECTION:
   1.222 -            KdPrint((__DRIVER_NAME "        C_PORT_CONNECTION\n"));
   1.223 +            FUNCTION_MSG("   C_PORT_CONNECTION\n");
   1.224              xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_change &= ~(1 << PORT_CONNECTION);
   1.225              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.226              break;
   1.227            case C_PORT_ENABLE:
   1.228 -            KdPrint((__DRIVER_NAME "        C_PORT_ENABLE\n"));
   1.229 +            FUNCTION_MSG("   C_PORT_ENABLE\n");
   1.230              xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_change &= ~(1 << PORT_ENABLE);
   1.231              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.232              break;
   1.233            case C_PORT_RESET:
   1.234 -            KdPrint((__DRIVER_NAME "        C_PORT_RESET\n"));
   1.235 +            FUNCTION_MSG("   C_PORT_RESET\n");
   1.236              xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_change &= ~(1 << PORT_RESET);
   1.237              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.238              break;
   1.239            default:
   1.240 -            KdPrint((__DRIVER_NAME "        Unknown Value %04X\n", urb->UrbControlVendorClassRequest.Value));
   1.241 +            FUNCTION_MSG("   Unknown Value %04X\n", urb->UrbControlVendorClassRequest.Value);
   1.242              break;
   1.243            }
   1.244 -          KdPrint((__DRIVER_NAME "        status = %04x, change = %04x\n",
   1.245 +          FUNCTION_MSG("   status = %04x, change = %04x\n",
   1.246              xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_status,
   1.247 -            xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_change));
   1.248 +            xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_change);
   1.249            break;
   1.250          default:
   1.251            FUNCTION_MSG(" Recipient=%d\n", decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Recipient);
   1.252 @@ -405,25 +405,25 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
   1.253          }
   1.254          break;
   1.255        default:
   1.256 -        KdPrint((__DRIVER_NAME "       Type=%d\n", decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Type));
   1.257 +        FUNCTION_MSG("  Type=%d\n", decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Type);
   1.258          break;
   1.259        }
   1.260        break;
   1.261      case USB_REQUEST_SET_FEATURE:
   1.262 -      KdPrint((__DRIVER_NAME "      USB_REQUEST_SET_FEATURE\n"));
   1.263 -      KdPrint((__DRIVER_NAME "       SetPortFeature\n"));
   1.264 +      FUNCTION_MSG(" USB_REQUEST_SET_FEATURE\n");
   1.265 +      FUNCTION_MSG("  SetPortFeature\n");
   1.266        switch (decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Type)
   1.267        {
   1.268        case 0: /* Standard */
   1.269 -        KdPrint((__DRIVER_NAME "       Type=Standard\n"));
   1.270 +        FUNCTION_MSG("  Type=Standard\n");
   1.271          switch (decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Recipient)
   1.272          {
   1.273          case BMREQUEST_TO_DEVICE:
   1.274 -          KdPrint((__DRIVER_NAME "       Recipient=Device\n"));
   1.275 +          FUNCTION_MSG("  Recipient=Device\n");
   1.276            switch (decode_data.setup_packet.default_pipe_setup_packet.wValue.W)
   1.277            {
   1.278            case 1: /* DEVICE_REMOTE_WAKEUP */
   1.279 -            KdPrint((__DRIVER_NAME "       Feature=DEVICE_REMOTE_WAKEUP\n"));
   1.280 +            FUNCTION_MSG("  Feature=DEVICE_REMOTE_WAKEUP\n");
   1.281              /* fake this */
   1.282              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.283              break;
   1.284 @@ -438,25 +438,25 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
   1.285          }
   1.286          break;
   1.287        case 1: /* Class */
   1.288 -        KdPrint((__DRIVER_NAME "       Type=Class\n"));
   1.289 +        FUNCTION_MSG("  Type=Class\n");
   1.290          switch (decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Recipient)
   1.291          {
   1.292          case BMREQUEST_TO_OTHER:
   1.293 -          KdPrint((__DRIVER_NAME "       Recipient=Other (port = %d)\n", decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte));
   1.294 +          FUNCTION_MSG("  Recipient=Other (port = %d)\n", decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte);
   1.295            switch (decode_data.setup_packet.default_pipe_setup_packet.wValue.W)
   1.296            {
   1.297            case PORT_ENABLE:
   1.298 -            KdPrint((__DRIVER_NAME "        PORT_ENABLE (NOOP)\n"));
   1.299 +            FUNCTION_MSG("   PORT_ENABLE (NOOP)\n");
   1.300              /* do something here */
   1.301              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.302              break;
   1.303            case PORT_SUSPEND:
   1.304 -            KdPrint((__DRIVER_NAME "        PORT_SUSPEND (NOOP)\n"));
   1.305 +            FUNCTION_MSG("   PORT_SUSPEND (NOOP)\n");
   1.306              /* do something here */
   1.307              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.308              break;
   1.309            case PORT_RESET:
   1.310 -            KdPrint((__DRIVER_NAME "        PORT_RESET\n"));
   1.311 +            FUNCTION_MSG("   PORT_RESET\n");
   1.312              /* just fake the reset by setting the status bit to indicate that the reset is complete*/
   1.313              //xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_status |= (1 << PORT_RESET);
   1.314              //xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].reset_counter = 10;
   1.315 @@ -469,17 +469,17 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
   1.316              XenUsbHub_ProcessHubInterruptEvent(endpoint);
   1.317              break;
   1.318            case PORT_POWER:
   1.319 -            KdPrint((__DRIVER_NAME "        PORT_POWER\n"));
   1.320 +            FUNCTION_MSG("   PORT_POWER\n");
   1.321              xudd->ports[decode_data.setup_packet.default_pipe_setup_packet.wIndex.LowByte - 1].port_status |= (1 << PORT_POWER);
   1.322              urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.323              break;
   1.324            default:
   1.325 -            KdPrint((__DRIVER_NAME "        PORT_%04X\n", decode_data.setup_packet.default_pipe_setup_packet.wValue.W));
   1.326 +            FUNCTION_MSG("   PORT_%04X\n", decode_data.setup_packet.default_pipe_setup_packet.wValue.W);
   1.327              break;
   1.328            }
   1.329 -          KdPrint((__DRIVER_NAME "        status = %04x, change = %04x\n",
   1.330 +          FUNCTION_MSG("   status = %04x, change = %04x\n",
   1.331              xudd->ports[urb->UrbControlVendorClassRequest.Index - 1].port_status,
   1.332 -            xudd->ports[urb->UrbControlVendorClassRequest.Index - 1].port_change));
   1.333 +            xudd->ports[urb->UrbControlVendorClassRequest.Index - 1].port_change);
   1.334            break;
   1.335          default:
   1.336            FUNCTION_MSG(__DRIVER_NAME "       Recipient=%d (not valid)\n", decode_data.setup_packet.default_pipe_setup_packet.bmRequestType.Recipient);
   1.337 @@ -490,28 +490,28 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
   1.338        break;
   1.339      default:
   1.340        FUNCTION_MSG(" USB_REQUEST_%02x\n", (ULONG)decode_data.setup_packet.default_pipe_setup_packet.bRequest);
   1.341 -      KdPrint((__DRIVER_NAME "      TransferBufferLength returned = %d\n", urb->UrbControlDescriptorRequest.TransferBufferLength));
   1.342 +      FUNCTION_MSG(" TransferBufferLength returned = %d\n", urb->UrbControlDescriptorRequest.TransferBufferLength);
   1.343        break;
   1.344      }
   1.345      break;
   1.346    case URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL:
   1.347 -    KdPrint((__DRIVER_NAME "     URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL\n"));
   1.348 -    KdPrint((__DRIVER_NAME "      PipeHandle = %p\n", urb->UrbPipeRequest.PipeHandle));
   1.349 +    FUNCTION_MSG("URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL\n");
   1.350 +    FUNCTION_MSG(" PipeHandle = %p\n", urb->UrbPipeRequest.PipeHandle);
   1.351      urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.352      break;
   1.353    case URB_FUNCTION_ABORT_PIPE:
   1.354 -    KdPrint((__DRIVER_NAME "     URB_FUNCTION_ABORT_PIPE\n"));
   1.355 -    KdPrint((__DRIVER_NAME "      PipeHandle = %p\n", urb->UrbPipeRequest.PipeHandle));
   1.356 +    FUNCTION_MSG("URB_FUNCTION_ABORT_PIPE\n");
   1.357 +    FUNCTION_MSG(" PipeHandle = %p\n", urb->UrbPipeRequest.PipeHandle);
   1.358      urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   1.359      break;
   1.360    case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: /* 11.12.4 */
   1.361  #if 0
   1.362 -    KdPrint((__DRIVER_NAME "     URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER\n"));
   1.363 -    KdPrint((__DRIVER_NAME "      PipeHandle = %p\n", urb->UrbBulkOrInterruptTransfer.PipeHandle));
   1.364 -    KdPrint((__DRIVER_NAME "      TransferFlags = %08x\n", urb->UrbBulkOrInterruptTransfer.TransferFlags));
   1.365 -    KdPrint((__DRIVER_NAME "      TransferBufferLength = %d\n", urb->UrbBulkOrInterruptTransfer.TransferBufferLength));
   1.366 -    KdPrint((__DRIVER_NAME "      TransferBuffer = %p\n", urb->UrbBulkOrInterruptTransfer.TransferBuffer));
   1.367 -    KdPrint((__DRIVER_NAME "      TransferBufferMdl = %p\n", urb->UrbBulkOrInterruptTransfer.TransferBufferMDL));
   1.368 +    FUNCTION_MSG("URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER\n");
   1.369 +    FUNCTION_MSG(" PipeHandle = %p\n", urb->UrbBulkOrInterruptTransfer.PipeHandle);
   1.370 +    FUNCTION_MSG(" TransferFlags = %08x\n", urb->UrbBulkOrInterruptTransfer.TransferFlags);
   1.371 +    FUNCTION_MSG(" TransferBufferLength = %d\n", urb->UrbBulkOrInterruptTransfer.TransferBufferLength);
   1.372 +    FUNCTION_MSG(" TransferBuffer = %p\n", urb->UrbBulkOrInterruptTransfer.TransferBuffer);
   1.373 +    FUNCTION_MSG(" TransferBufferMdl = %p\n", urb->UrbBulkOrInterruptTransfer.TransferBufferMDL);
   1.374  #endif
   1.375      endpoint = urb->UrbBulkOrInterruptTransfer.PipeHandle;
   1.376      //WdfSpinLockAcquire(endpoint->lock);