win-pvdrivers

changeset 656:43a106f19847

Fix build warnings
author James Harper <james.harper@bendigoit.com.au>
date Sat Sep 12 13:44:42 2009 +1000 (2009-09-12)
parents cfaec940d3bb
children a8c1256971e4
files xenusb/xenusb.h xenusb/xenusb_devurb.c xenusb/xenusb_fdo.c xenusb/xenusb_hub.c xenusb/xenusb_huburb.c
line diff
     1.1 --- a/xenusb/xenusb.h	Fri Sep 11 22:44:11 2009 +1000
     1.2 +++ b/xenusb/xenusb.h	Sat Sep 12 13:44:42 2009 +1000
     1.3 @@ -119,7 +119,6 @@ struct _usbif_shadow {
     1.4    usbif_request_t req;
     1.5    usbif_response_t rsp;
     1.6    usbif_shadow_t *next; /* for gathering shadows from the ring for callback */
     1.7 -  ULONGLONG submit_time;
     1.8  };
     1.9  
    1.10  #define MAX_SHADOW_ENTRIES 64
     2.1 --- a/xenusb/xenusb_devurb.c	Fri Sep 11 22:44:11 2009 +1000
     2.2 +++ b/xenusb/xenusb_devurb.c	Sat Sep 12 13:44:42 2009 +1000
     2.3 @@ -21,29 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fi
     2.4  
     2.5  #define EPROTO          71      /* Protocol error */
     2.6  
     2.7 -typedef struct {
     2.8 -  ULONG elapsed_ms;
     2.9 -  PVOID PipeHandle;
    2.10 -  ULONG TransferFlags;
    2.11 -  ULONG TransferBufferLength;
    2.12 -  PVOID TransferBuffer;
    2.13 -  PMDL TransferBufferMdl;
    2.14 -  ULONG pipe_value;
    2.15 -  ULONG id;
    2.16 -  ULONG start_frame;
    2.17 -  ULONG status;
    2.18 -  ULONG actual_length;
    2.19 -  ULONG error_count;
    2.20 -  ULONG total_length;
    2.21 -} w00t_t;
    2.22 -
    2.23 -w00t_t w00t;
    2.24 -
    2.25  static VOID
    2.26  XenUsb_UrbCallback(usbif_shadow_t *shadow)
    2.27  {
    2.28 -  NTSTATUS status;
    2.29 -  BOOLEAN dma_complete;
    2.30    WDFQUEUE queue;
    2.31    WDFDEVICE device;
    2.32    PXENUSB_PDO_DEVICE_DATA xupdd;
    2.33 @@ -115,73 +95,7 @@ XenUsb_UrbCallback(usbif_shadow_t *shado
    2.34      shadow->urb->UrbControlVendorClassRequest.TransferBufferLength = shadow->total_length;
    2.35      break;
    2.36    case URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
    2.37 -  {
    2.38 -    xenusb_endpoint_t *endpoint;
    2.39 -    ULONGLONG current_time;
    2.40 -    ULONG elapsed_ms;
    2.41 -    
    2.42 -    KeQuerySystemTime((PLARGE_INTEGER)&current_time);
    2.43 -    
    2.44 -    elapsed_ms = (ULONG)((current_time - shadow->submit_time) / 10 / 1000);
    2.45 -    endpoint = shadow->urb->UrbBulkOrInterruptTransfer.PipeHandle;    
    2.46 -
    2.47 -    if (shadow->rsp.status || elapsed_ms > 5000)
    2.48 -    {
    2.49 -      KdPrint((__DRIVER_NAME "     URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER\n"));
    2.50 -      KdPrint((__DRIVER_NAME "      elapsed_ms = %d\n", w00t.elapsed_ms));
    2.51 -      KdPrint((__DRIVER_NAME "      PipeHandle = %p\n", w00t.PipeHandle));
    2.52 -      KdPrint((__DRIVER_NAME "      TransferFlags = %08x\n", w00t.TransferFlags));
    2.53 -      KdPrint((__DRIVER_NAME "      TransferBufferLength = %d\n", w00t.TransferBufferLength));
    2.54 -      KdPrint((__DRIVER_NAME "      TransferBuffer = %p\n", w00t.TransferBuffer));
    2.55 -      KdPrint((__DRIVER_NAME "      TransferBufferMdl = %p\n", w00t.TransferBufferMdl));
    2.56 -      KdPrint((__DRIVER_NAME "      pipe_value = %08x\n", w00t.pipe_value));
    2.57 -      KdPrint((__DRIVER_NAME "     rsp id = %d\n", w00t.id));
    2.58 -      KdPrint((__DRIVER_NAME "     rsp start_frame = %d\n", w00t.start_frame));
    2.59 -      KdPrint((__DRIVER_NAME "     rsp status = %d\n", w00t.status));
    2.60 -      KdPrint((__DRIVER_NAME "     rsp actual_length = %d\n", w00t.actual_length));
    2.61 -      KdPrint((__DRIVER_NAME "     rsp error_count = %d\n", w00t.error_count));
    2.62 -      KdPrint((__DRIVER_NAME "     total_length = %d\n", shadow->total_length));
    2.63 -
    2.64 -      KdPrint((__DRIVER_NAME "     URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER\n"));
    2.65 -      KdPrint((__DRIVER_NAME "      elapsed_ms = %d\n", elapsed_ms));
    2.66 -      KdPrint((__DRIVER_NAME "      PipeHandle = %p\n", shadow->urb->UrbBulkOrInterruptTransfer.PipeHandle));
    2.67 -      KdPrint((__DRIVER_NAME "      TransferFlags = %08x\n", shadow->urb->UrbBulkOrInterruptTransfer.TransferFlags));
    2.68 -      KdPrint((__DRIVER_NAME "      TransferBufferLength = %d\n", shadow->urb->UrbBulkOrInterruptTransfer.TransferBufferLength));
    2.69 -      KdPrint((__DRIVER_NAME "      TransferBuffer = %p\n", shadow->urb->UrbBulkOrInterruptTransfer.TransferBuffer));
    2.70 -      KdPrint((__DRIVER_NAME "      TransferBufferMdl = %p\n", shadow->urb->UrbBulkOrInterruptTransfer.TransferBufferMDL));
    2.71 -      KdPrint((__DRIVER_NAME "      UrbLink = %p\n", shadow->urb->UrbBulkOrInterruptTransfer.UrbLink));
    2.72 -      KdPrint((__DRIVER_NAME "      pipe_value = %08x\n", endpoint->pipe_value));
    2.73 -      KdPrint((__DRIVER_NAME "     rsp id = %d\n", shadow->rsp.id));
    2.74 -      KdPrint((__DRIVER_NAME "     rsp start_frame = %d\n", shadow->rsp.start_frame));
    2.75 -      KdPrint((__DRIVER_NAME "     rsp status = %d\n", shadow->rsp.status));
    2.76 -      KdPrint((__DRIVER_NAME "     rsp actual_length = %d\n", shadow->rsp.actual_length));
    2.77 -      KdPrint((__DRIVER_NAME "     rsp error_count = %d\n", shadow->rsp.error_count));
    2.78 -      KdPrint((__DRIVER_NAME "     total_length = %d\n", shadow->total_length));
    2.79 -  }
    2.80 -    w00t.elapsed_ms = elapsed_ms;
    2.81 -    w00t.PipeHandle = shadow->urb->UrbBulkOrInterruptTransfer.PipeHandle;
    2.82 -    w00t.TransferFlags = shadow->urb->UrbBulkOrInterruptTransfer.TransferFlags;
    2.83 -    w00t.TransferBufferLength = shadow->urb->UrbBulkOrInterruptTransfer.TransferBufferLength;
    2.84 -    w00t.TransferBuffer = shadow->urb->UrbBulkOrInterruptTransfer.TransferBuffer;
    2.85 -    w00t.TransferBufferMdl = shadow->urb->UrbBulkOrInterruptTransfer.TransferBufferMDL;
    2.86 -    w00t.pipe_value = endpoint->pipe_value;
    2.87 -    w00t.id = shadow->rsp.id;
    2.88 -    w00t.start_frame = shadow->rsp.start_frame;
    2.89 -    w00t.status = shadow->rsp.status;
    2.90 -    w00t.actual_length = shadow->rsp.actual_length;
    2.91 -    w00t.error_count = shadow->rsp.error_count;
    2.92 -    w00t.total_length = shadow->total_length;
    2.93 -  }
    2.94      shadow->urb->UrbBulkOrInterruptTransfer.TransferBufferLength = shadow->total_length;
    2.95 -#if 0
    2.96 -{
    2.97 -  PUCHAR addr = shadow->urb->UrbBulkOrInterruptTransfer.TransferBuffer;
    2.98 -  if (!addr)
    2.99 -    addr = MmGetSystemAddressForMdlSafe(shadow->urb->UrbBulkOrInterruptTransfer.TransferBufferMDL, HighPagePriority);
   2.100 -  for (i = 0; i < min(shadow->urb->UrbBulkOrInterruptTransfer.TransferBufferLength, 16); i++)
   2.101 -    KdPrint((__DRIVER_NAME "      UrbBulkOrInterruptTransfer[%02x] = %02x\n", i, addr[i]));
   2.102 -}
   2.103 -#endif
   2.104      break;
   2.105    default:
   2.106      KdPrint((__DRIVER_NAME "     rsp id = %d\n", shadow->rsp.id));
   2.107 @@ -198,8 +112,9 @@ XenUsb_UrbCallback(usbif_shadow_t *shado
   2.108    case 0:
   2.109      shadow->urb->UrbHeader.Status = USBD_STATUS_SUCCESS;
   2.110      break;
   2.111 -  case -EPROTO:
   2.112 +  case -EPROTO: /*  ? */
   2.113      shadow->urb->UrbHeader.Status = USBD_STATUS_CRC;
   2.114 +    KdPrint((__DRIVER_NAME "     rsp status = -EPROTO\n"));
   2.115      break;
   2.116  #if 0
   2.117    case -EPIPE:
   2.118 @@ -215,6 +130,7 @@ XenUsb_UrbCallback(usbif_shadow_t *shado
   2.119    default:
   2.120      //shadow->urb->UrbHeader.Status = USBD_STATUS_ENDPOINT_HALTED;
   2.121      shadow->urb->UrbHeader.Status = USBD_STATUS_INTERNAL_HC_ERROR;
   2.122 +    KdPrint((__DRIVER_NAME "     rsp status = %d\n", shadow->rsp.status));
   2.123      break;
   2.124    }
   2.125    WdfRequestComplete(shadow->request, STATUS_SUCCESS);
   2.126 @@ -478,7 +394,7 @@ XenUsb_EvtIoInternalDeviceControl_DEVICE
   2.127        setup_packet->wIndex.W = 0;
   2.128        break;
   2.129      }
   2.130 -    setup_packet->wLength = urb->UrbControlDescriptorRequest.TransferBufferLength;
   2.131 +    setup_packet->wLength = (USHORT)urb->UrbControlDescriptorRequest.TransferBufferLength;
   2.132      status = XenUsb_ExecuteRequest(xudd, shadow, urb->UrbControlDescriptorRequest.TransferBuffer, urb->UrbControlDescriptorRequest.TransferBufferMDL, urb->UrbControlDescriptorRequest.TransferBufferLength);
   2.133      if (!NT_SUCCESS(status))
   2.134      {
   2.135 @@ -833,7 +749,6 @@ XenUsb_EvtIoInternalDeviceControl_DEVICE
   2.136        KdPrint((__DRIVER_NAME "      USB_ENDPOINT_TYPE_%d\n", endpoint->endpoint_descriptor.bmAttributes));
   2.137        break;
   2.138      }
   2.139 -    KeQuerySystemTime((PLARGE_INTEGER)&shadow->submit_time);
   2.140      status = XenUsb_ExecuteRequest(xudd, shadow, urb->UrbBulkOrInterruptTransfer.TransferBuffer, urb->UrbBulkOrInterruptTransfer.TransferBufferMDL, urb->UrbBulkOrInterruptTransfer.TransferBufferLength);
   2.141      if (!NT_SUCCESS(status))
   2.142      {
     3.1 --- a/xenusb/xenusb_fdo.c	Fri Sep 11 22:44:11 2009 +1000
     3.2 +++ b/xenusb/xenusb_fdo.c	Sat Sep 12 13:44:42 2009 +1000
     3.3 @@ -44,7 +44,7 @@ XenUsb_ExecuteRequestCallback(
     3.4      shadow->req.seg[i].gref = (grant_ref_t)(sg_list->Elements->Address.QuadPart >> PAGE_SHIFT);
     3.5      shadow->req.seg[i].offset = (USHORT)sg_list->Elements->Address.LowPart & (PAGE_SIZE - 1);
     3.6      shadow->req.seg[i].length = (USHORT)sg_list->Elements->Length;
     3.7 -    shadow->req.buffer_length += sg_list->Elements->Length;
     3.8 +    shadow->req.buffer_length = shadow->req.buffer_length + (USHORT)sg_list->Elements->Length;
     3.9    }
    3.10    shadow->req.nr_buffer_segs = (USHORT)sg_list->NumberOfElements;
    3.11    //KdPrint((__DRIVER_NAME "     buffer_length = %d\n", shadow->req.buffer_length));
    3.12 @@ -242,7 +242,7 @@ static BOOLEAN
    3.13  XenUsb_HandleEvent(PVOID context)
    3.14  {
    3.15    PXENUSB_DEVICE_DATA xudd = context;
    3.16 -  RING_IDX i, prod, cons;
    3.17 +  RING_IDX prod, cons;
    3.18    usbif_response_t *rsp;
    3.19    int more_to_do = TRUE;
    3.20    usbif_shadow_t *complete_head = NULL, *complete_tail = NULL;
    3.21 @@ -678,9 +678,6 @@ XenUsb_EvtChildListScanForChildren(WDFCH
    3.22    PCHAR err;
    3.23    PCHAR value;
    3.24    ULONG i;
    3.25 -  usbif_shadow_t *shadow;
    3.26 -  PUSB_DEFAULT_PIPE_SETUP_PACKET setup_packet;
    3.27 -  int notify;
    3.28  
    3.29    FUNCTION_ENTER();
    3.30  
     4.1 --- a/xenusb/xenusb_hub.c	Fri Sep 11 22:44:11 2009 +1000
     4.2 +++ b/xenusb/xenusb_hub.c	Sat Sep 12 13:44:42 2009 +1000
     4.3 @@ -100,8 +100,6 @@ XenUsbHub_EvtIoInternalDeviceControl(
     4.4    NTSTATUS status;
     4.5    WDFDEVICE device = WdfIoQueueGetDevice(queue);
     4.6    PXENUSB_PDO_DEVICE_DATA xupdd = GetXupdd(device);
     4.7 -  PDEVICE_OBJECT fdo;
     4.8 -  PIRP irp;
     4.9    WDF_REQUEST_PARAMETERS wrp;
    4.10    PURB urb;
    4.11    xenusb_device_t *usb_device;
    4.12 @@ -386,11 +384,6 @@ XenPciPdo_UBIH_InitializeUsbDevice(
    4.13    PXENUSB_DEVICE_DATA xudd = GetXudd(xupdd->wdf_device_bus_fdo);
    4.14    WDF_IO_QUEUE_CONFIG queue_config;
    4.15    xenusb_device_t *usb_device = DeviceHandle;
    4.16 -  PDEVICE_OBJECT fdo;
    4.17 -  KEVENT irp_complete_event;
    4.18 -  PIRP irp;
    4.19 -  URB urb;
    4.20 -  PIO_STACK_LOCATION stack;
    4.21    PUCHAR ptr;
    4.22    PVOID buf;
    4.23    PMDL mdl;
    4.24 @@ -496,7 +489,7 @@ XenPciPdo_UBIH_InitializeUsbDevice(
    4.25      setup_packet->bmRequestType.Type = BMREQUEST_STANDARD;
    4.26      setup_packet->bmRequestType.Dir = BMREQUEST_DEVICE_TO_HOST;
    4.27      setup_packet->bRequest = USB_REQUEST_GET_DESCRIPTOR;
    4.28 -    setup_packet->wValue.LowByte = i+1;
    4.29 +    setup_packet->wValue.LowByte = (UCHAR)(i + 1);
    4.30      setup_packet->wValue.HiByte = USB_CONFIGURATION_DESCRIPTOR_TYPE; //device descriptor
    4.31      setup_packet->wIndex.W = 0;
    4.32      setup_packet->wLength = shadow->req.buffer_length;
    4.33 @@ -509,7 +502,7 @@ XenPciPdo_UBIH_InitializeUsbDevice(
    4.34      KdPrint((__DRIVER_NAME "     rsp actual_length = %d\n", shadow->rsp.actual_length));
    4.35      KdPrint((__DRIVER_NAME "     rsp error_count = %d\n", shadow->rsp.error_count));
    4.36      ptr = buf;
    4.37 -    config_descriptor = ptr;
    4.38 +    config_descriptor = (PUSB_CONFIGURATION_DESCRIPTOR)ptr;
    4.39      KdPrint((__DRIVER_NAME "     Config %d\n", i));
    4.40      KdPrint((__DRIVER_NAME "      bLength = %d\n", config_descriptor->bLength));
    4.41      KdPrint((__DRIVER_NAME "      bDescriptorType = %d\n", config_descriptor->bDescriptorType));
    4.42 @@ -525,7 +518,7 @@ XenPciPdo_UBIH_InitializeUsbDevice(
    4.43      ptr += config_descriptor->bLength;
    4.44      for (j = 0; j < config_descriptor->bNumInterfaces; j++)
    4.45      {
    4.46 -      interface_descriptor = ptr;
    4.47 +      interface_descriptor = (PUSB_INTERFACE_DESCRIPTOR)ptr;
    4.48        KdPrint((__DRIVER_NAME "       Interface %d\n", j));
    4.49        KdPrint((__DRIVER_NAME "        bLength = %d\n", interface_descriptor->bLength));
    4.50        KdPrint((__DRIVER_NAME "        bDescriptorType = %d\n", interface_descriptor->bDescriptorType));
    4.51 @@ -542,7 +535,7 @@ XenPciPdo_UBIH_InitializeUsbDevice(
    4.52        memcpy(&usb_device->configs[i]->interfaces[j]->interface_descriptor, interface_descriptor, sizeof(USB_INTERFACE_DESCRIPTOR));
    4.53        for (k = 0; k < interface_descriptor->bNumEndpoints; k++)
    4.54        {
    4.55 -        endpoint_descriptor = ptr;
    4.56 +        endpoint_descriptor = (PUSB_ENDPOINT_DESCRIPTOR)ptr;
    4.57          KdPrint((__DRIVER_NAME "        Endpoint %d\n", k));
    4.58          KdPrint((__DRIVER_NAME "         bLength = %d\n", endpoint_descriptor->bLength));
    4.59          KdPrint((__DRIVER_NAME "         bDescriptorType = %d\n", endpoint_descriptor->bDescriptorType));
    4.60 @@ -627,7 +620,6 @@ XenPciPdo_UBIH_GetUsbDescriptors(
    4.61    WDFDEVICE device = BusContext;
    4.62    xenusb_device_t *usb_device = DeviceHandle;
    4.63    xenusb_config_t *usb_config;
    4.64 -  int i, j;
    4.65    PUCHAR ptr;
    4.66  
    4.67    FUNCTION_ENTER();
    4.68 @@ -674,6 +666,10 @@ XenPciPdo_UBIH_RemoveUsbDevice (
    4.69   ULONG Flags)
    4.70  {
    4.71    NTSTATUS status = STATUS_SUCCESS;
    4.72 +
    4.73 +  UNREFERENCED_PARAMETER(BusContext);
    4.74 +  UNREFERENCED_PARAMETER(DeviceHandle);
    4.75 +
    4.76    FUNCTION_ENTER();
    4.77    
    4.78    if (Flags & USBD_KEEP_DEVICE_DATA)
    4.79 @@ -693,6 +689,11 @@ XenPciPdo_UBIH_RestoreUsbDevice(
    4.80    PUSB_DEVICE_HANDLE NewDeviceHandle)
    4.81  {
    4.82    NTSTATUS status = STATUS_UNSUCCESSFUL;
    4.83 +
    4.84 +  UNREFERENCED_PARAMETER(BusContext);
    4.85 +  UNREFERENCED_PARAMETER(OldDeviceHandle);
    4.86 +  UNREFERENCED_PARAMETER(NewDeviceHandle);
    4.87 +  
    4.88    FUNCTION_ENTER();
    4.89  
    4.90    FUNCTION_EXIT();
    4.91 @@ -705,6 +706,10 @@ XenPciPdo_UBIH_GetPortHackFlags(
    4.92   PULONG HackFlags)
    4.93  {
    4.94    NTSTATUS status = STATUS_UNSUCCESSFUL;
    4.95 +
    4.96 +  UNREFERENCED_PARAMETER(BusContext);
    4.97 +  UNREFERENCED_PARAMETER(HackFlags);
    4.98 +
    4.99    FUNCTION_ENTER();
   4.100  
   4.101    FUNCTION_EXIT();
   4.102 @@ -729,7 +734,7 @@ XenPciPdo_UBIH_QueryDeviceInformation(
   4.103    KdPrint((__DRIVER_NAME "     DeviceInformationBuffer = %p\n", DeviceInformationBuffer));
   4.104    KdPrint((__DRIVER_NAME "     DeviceInformationBufferLength = %d\n", DeviceInformationBufferLength));
   4.105    KdPrint((__DRIVER_NAME "     ->InformationLevel = %d\n", udi->InformationLevel));
   4.106 -  if (DeviceInformationBufferLength < FIELD_OFFSET(USB_DEVICE_INFORMATION_0, PipeList[1]))
   4.107 +  if (DeviceInformationBufferLength < (ULONG)FIELD_OFFSET(USB_DEVICE_INFORMATION_0, PipeList[1]))
   4.108    {
   4.109      KdPrint((__DRIVER_NAME "     STATUS_BUFFER_TOO_SMALL\n"));
   4.110      FUNCTION_EXIT();
   4.111 @@ -771,7 +776,7 @@ XenPciPdo_UBIH_GetControllerInformation 
   4.112  {
   4.113    NTSTATUS status = STATUS_UNSUCCESSFUL;
   4.114    PUSB_CONTROLLER_INFORMATION_0 uci = ControllerInformationBuffer;
   4.115 -  WDFDEVICE device = BusContext;
   4.116 +  //WDFDEVICE device = BusContext;
   4.117    //xenusb_device_t *usb_device = DeviceHandle;
   4.118  
   4.119    FUNCTION_ENTER();
   4.120 @@ -806,6 +811,10 @@ XenPciPdo_UBIH_ControllerSelectiveSuspen
   4.121    BOOLEAN Enable)
   4.122  {
   4.123    NTSTATUS status = STATUS_UNSUCCESSFUL;
   4.124 +
   4.125 +  UNREFERENCED_PARAMETER(BusContext);
   4.126 +  UNREFERENCED_PARAMETER(Enable);
   4.127 +  
   4.128    FUNCTION_ENTER();
   4.129  
   4.130    FUNCTION_EXIT();
   4.131 @@ -821,7 +830,7 @@ XenPciPdo_UBIH_GetExtendedHubInformation
   4.132    PULONG LengthOfDataReturned)
   4.133  {
   4.134    PUSB_EXTHUB_INFORMATION_0 hib = HubInformationBuffer;
   4.135 -  int i;
   4.136 +  ULONG i;
   4.137  
   4.138    FUNCTION_ENTER();
   4.139  
   4.140 @@ -830,7 +839,7 @@ XenPciPdo_UBIH_GetExtendedHubInformation
   4.141    KdPrint((__DRIVER_NAME "     HubInformationBuffer = %p\n", HubInformationBuffer));
   4.142    KdPrint((__DRIVER_NAME "     HubInformationBufferLength = %d\n", HubInformationBufferLength));
   4.143    KdPrint((__DRIVER_NAME "     ->InformationLevel = %d\n", hib->InformationLevel));
   4.144 -  if (HubInformationBufferLength < FIELD_OFFSET(USB_EXTHUB_INFORMATION_0, Port[8]))
   4.145 +  if (HubInformationBufferLength < (ULONG)FIELD_OFFSET(USB_EXTHUB_INFORMATION_0, Port[8]))
   4.146    {
   4.147      KdPrint((__DRIVER_NAME "     STATUS_BUFFER_TOO_SMALL\n"));
   4.148      FUNCTION_EXIT();
   4.149 @@ -878,16 +887,18 @@ XenPciPdo_UBIH_GetRootHubSymbolicName(
   4.150    return status;
   4.151  }
   4.152  
   4.153 -static NTSTATUS
   4.154 +static PVOID
   4.155  XenPciPdo_UBIH_GetDeviceBusContext(
   4.156    PVOID BusContext,
   4.157    PVOID DeviceHandle)
   4.158  {
   4.159 -  NTSTATUS status = STATUS_UNSUCCESSFUL;
   4.160 +  UNREFERENCED_PARAMETER(BusContext);
   4.161 +  UNREFERENCED_PARAMETER(DeviceHandle);
   4.162 +  
   4.163    FUNCTION_ENTER();
   4.164  
   4.165    FUNCTION_EXIT();
   4.166 -  return status;
   4.167 +  return NULL;
   4.168  }
   4.169  
   4.170  static NTSTATUS
   4.171 @@ -932,6 +943,10 @@ XenPciPdo_UBIH_FlushTransfers(
   4.172    PUSB_DEVICE_HANDLE DeviceHandle)
   4.173  {
   4.174    NTSTATUS status = STATUS_SUCCESS;
   4.175 +
   4.176 +  UNREFERENCED_PARAMETER(BusContext);
   4.177 +  UNREFERENCED_PARAMETER(DeviceHandle);
   4.178 +  
   4.179    FUNCTION_ENTER();
   4.180  
   4.181    FUNCTION_EXIT();
   4.182 @@ -944,6 +959,10 @@ XenPciPdo_UBIH_SetDeviceHandleData(
   4.183    PUSB_DEVICE_HANDLE DeviceHandle,
   4.184    PDEVICE_OBJECT UsbDevicePdo)
   4.185  {
   4.186 +  UNREFERENCED_PARAMETER(BusContext);
   4.187 +  UNREFERENCED_PARAMETER(DeviceHandle);
   4.188 +  UNREFERENCED_PARAMETER(UsbDevicePdo);
   4.189 +  
   4.190    FUNCTION_ENTER();
   4.191    FUNCTION_EXIT();
   4.192  }
   4.193 @@ -956,6 +975,11 @@ XenPciPdo_UBIU_GetUSBDIVersion(
   4.194    )
   4.195  {
   4.196    NTSTATUS status = STATUS_UNSUCCESSFUL;
   4.197 +
   4.198 +  UNREFERENCED_PARAMETER(BusContext);
   4.199 +  UNREFERENCED_PARAMETER(VersionInformation);
   4.200 +  UNREFERENCED_PARAMETER(HcdCapabilities);
   4.201 +
   4.202    FUNCTION_ENTER();
   4.203  
   4.204    FUNCTION_EXIT();
   4.205 @@ -969,6 +993,10 @@ XenPciPdo_UBIU_QueryBusTime(
   4.206    )
   4.207  {
   4.208    NTSTATUS status = STATUS_UNSUCCESSFUL;
   4.209 +
   4.210 +  UNREFERENCED_PARAMETER(BusContext);
   4.211 +  UNREFERENCED_PARAMETER(CurrentFrame);
   4.212 +  
   4.213    FUNCTION_ENTER();
   4.214  
   4.215    FUNCTION_EXIT();
   4.216 @@ -982,6 +1010,10 @@ XenPciPdo_UBIU_SubmitIsoOutUrb(
   4.217    )
   4.218  {
   4.219    NTSTATUS status = STATUS_UNSUCCESSFUL;
   4.220 +
   4.221 +  UNREFERENCED_PARAMETER(BusContext);
   4.222 +  UNREFERENCED_PARAMETER(Urb);
   4.223 +  
   4.224    FUNCTION_ENTER();
   4.225  
   4.226    FUNCTION_EXIT();
   4.227 @@ -997,6 +1029,13 @@ XenPciPdo_UBIU_QueryBusInformation(
   4.228    PULONG BusInformationActualLength)
   4.229  {
   4.230    NTSTATUS status = STATUS_UNSUCCESSFUL;
   4.231 +
   4.232 +  UNREFERENCED_PARAMETER(BusContext);
   4.233 +  UNREFERENCED_PARAMETER(Level);
   4.234 +  UNREFERENCED_PARAMETER(BusInformationBuffer);
   4.235 +  UNREFERENCED_PARAMETER(BusInformationBufferLength);
   4.236 +  UNREFERENCED_PARAMETER(BusInformationActualLength);
   4.237 +  
   4.238    FUNCTION_ENTER();
   4.239  
   4.240    FUNCTION_EXIT();
   4.241 @@ -1006,6 +1045,8 @@ XenPciPdo_UBIU_QueryBusInformation(
   4.242  static BOOLEAN
   4.243  XenPciPdo_UBIU_IsDeviceHighSpeed(PVOID BusContext)
   4.244  {
   4.245 +  UNREFERENCED_PARAMETER(BusContext);
   4.246 +  
   4.247    FUNCTION_ENTER();
   4.248  
   4.249    FUNCTION_EXIT();
   4.250 @@ -1024,6 +1065,8 @@ XenPciPdo_UBIU_EnumLogEntry(
   4.251    NTSTATUS status = STATUS_SUCCESS;
   4.252    FUNCTION_ENTER();
   4.253    
   4.254 +  UNREFERENCED_PARAMETER(BusContext);
   4.255 +  
   4.256    KdPrint((__DRIVER_NAME "     DriverTag = %08x\n", DriverTag));
   4.257    KdPrint((__DRIVER_NAME "     EnumTag = %08x\n", EnumTag));
   4.258    KdPrint((__DRIVER_NAME "     P1 = %08x\n", P1));
   4.259 @@ -1041,7 +1084,7 @@ XenUsb_EnumeratePorts(WDFDEVICE device)
   4.260    CHAR path[128];
   4.261    PCHAR err;
   4.262    PCHAR value;
   4.263 -  int i;
   4.264 +  ULONG i;
   4.265    
   4.266    for (i = 0; i < xudd->num_ports; i++)
   4.267    {
   4.268 @@ -1093,7 +1136,7 @@ XenUsbHub_HubInterruptTimer(WDFTIMER tim
   4.269    WDF_REQUEST_PARAMETERS wrp;
   4.270    WDFREQUEST request;
   4.271    PURB urb;
   4.272 -  int i;
   4.273 +  ULONG i;
   4.274    
   4.275    //FUNCTION_ENTER();
   4.276    WdfSpinLockAcquire(endpoint->interrupt_lock);
   4.277 @@ -1169,22 +1212,6 @@ XenUsb_EvtChildListCreateDevice(WDFCHILD
   4.278    WDF_PNPPOWER_EVENT_CALLBACKS child_pnp_power_callbacks;
   4.279    WDF_DEVICE_POWER_CAPABILITIES child_power_capabilities;
   4.280    WDF_IO_QUEUE_CONFIG queue_config;
   4.281 -  WDFIOTARGET bus_target;
   4.282 -  PDEVICE_OBJECT fdo;
   4.283 -  PIRP irp;
   4.284 -  PIO_STACK_LOCATION stack;
   4.285 -  KEVENT irp_complete_event;
   4.286 -  usbif_request_t *req;
   4.287 -  usbif_response_t *rsp;
   4.288 -  URB urb;
   4.289 -  PVOID buf;
   4.290 -  PUSB_DEVICE_DESCRIPTOR device_descriptor;
   4.291 -  PUSB_CONFIGURATION_DESCRIPTOR config_descriptor;  
   4.292 -  PUSB_INTERFACE_DESCRIPTOR interface_descriptor;
   4.293 -  PUCHAR ptr;
   4.294 -  int num_configs;
   4.295 -  int i, j, k;
   4.296 -  xenusb_device_t *usb_device;
   4.297    WDF_QUERY_INTERFACE_CONFIG interface_config;
   4.298    USB_BUS_INTERFACE_HUB_V5 ubih;
   4.299    USB_BUS_INTERFACE_USBDI_V2 ubiu;
     5.1 --- a/xenusb/xenusb_huburb.c	Fri Sep 11 22:44:11 2009 +1000
     5.2 +++ b/xenusb/xenusb_huburb.c	Sat Sep 12 13:44:42 2009 +1000
     5.3 @@ -33,14 +33,10 @@ XenUsb_EvtIoInternalDeviceControl_ROOTHU
     5.4    PXENUSB_DEVICE_DATA xudd = GetXudd(xupdd->wdf_device_bus_fdo);
     5.5    WDF_REQUEST_PARAMETERS wrp;
     5.6    PURB urb;
     5.7 -  PUSB_DEFAULT_PIPE_SETUP_PACKET setup_packet;
     5.8 -  PMDL mdl;
     5.9    PUSBD_INTERFACE_INFORMATION interface_information;
    5.10    ULONG i, j;
    5.11 -  int notify;
    5.12    xenusb_device_t *usb_device;
    5.13    PUSB_HUB_DESCRIPTOR uhd;
    5.14 -  KIRQL old_irql;
    5.15    xenusb_endpoint_t *endpoint;
    5.16  
    5.17    UNREFERENCED_PARAMETER(input_buffer_length);