win-pvdrivers

changeset 752:2ecb5104c33a

usb changes to support device hiding changes
author James Harper <james.harper@bendigoit.com.au>
date Sun Jan 10 10:14:07 2010 +1100 (2010-01-10)
parents 036172f7e1b2
children 83dd32e63133
files xenusb/xenusb.h xenusb/xenusb_fdo.c
line diff
     1.1 --- a/xenusb/xenusb.h	Sun Jan 10 10:13:47 2010 +1100
     1.2 +++ b/xenusb/xenusb.h	Sun Jan 10 10:14:07 2010 +1100
     1.3 @@ -211,7 +211,6 @@ typedef struct {
     1.4  
     1.5    evtchn_port_t event_channel;
     1.6  
     1.7 -  BOOLEAN inactive;
     1.8    XENPCI_VECTORS vectors;
     1.9    PXENPCI_DEVICE_STATE device_state;
    1.10  
     2.1 --- a/xenusb/xenusb_fdo.c	Sun Jan 10 10:13:47 2010 +1100
     2.2 +++ b/xenusb/xenusb_fdo.c	Sun Jan 10 10:14:07 2010 +1100
     2.3 @@ -414,7 +414,6 @@ XenUsb_StartXenbusInit(PXENUSB_DEVICE_DA
     2.4    xudd->urb_sring = NULL;
     2.5    xudd->event_channel = 0;
     2.6  
     2.7 -  xudd->inactive = TRUE;
     2.8    ptr = xudd->config_page;
     2.9    while((type = GET_XEN_INIT_RSP(&ptr, (PVOID)&setting, (PVOID)&value, (PVOID)&value2)) != XEN_INIT_TYPE_END)
    2.10    {
    2.11 @@ -441,9 +440,6 @@ XenUsb_StartXenbusInit(PXENUSB_DEVICE_DA
    2.12        KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_DEVICE_STATE - %p\n", PtrToUlong(value)));
    2.13        xudd->device_state = (PXENPCI_DEVICE_STATE)value;
    2.14        break;
    2.15 -    case XEN_INIT_TYPE_ACTIVE:
    2.16 -      xudd->inactive = FALSE;
    2.17 -      break;
    2.18  #if 0
    2.19      case XEN_INIT_TYPE_GRANT_ENTRIES:
    2.20        KdPrint((__DRIVER_NAME "     XEN_INIT_TYPE_GRANT_ENTRIES - entries = %d\n", PtrToUlong(setting)));
    2.21 @@ -465,6 +461,7 @@ XenUsb_CompleteXenbusInit(PXENUSB_DEVICE
    2.22    PUCHAR ptr;
    2.23    USHORT type;
    2.24    PCHAR setting, value, value2;
    2.25 +  ULONG i;
    2.26  
    2.27    ptr = xudd->config_page;
    2.28    while((type = GET_XEN_INIT_RSP(&ptr, (PVOID)&setting, (PVOID)&value, (PVOID)&value2)) != XEN_INIT_TYPE_END)
    2.29 @@ -500,27 +497,19 @@ XenUsb_CompleteXenbusInit(PXENUSB_DEVICE
    2.30        break;
    2.31      }
    2.32    }
    2.33 -  if (!xudd->inactive && (xudd->urb_sring == NULL || xudd->conn_sring == NULL || xudd->event_channel == 0))
    2.34 +  if (xudd->urb_sring == NULL || xudd->conn_sring == NULL || xudd->event_channel == 0)
    2.35    {
    2.36      KdPrint((__DRIVER_NAME "     Missing settings\n"));
    2.37      KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    2.38      return STATUS_UNSUCCESSFUL;
    2.39    }
    2.40    
    2.41 -  if (xudd->inactive)
    2.42 -  {
    2.43 -    KdPrint((__DRIVER_NAME "     Device is inactive\n"));
    2.44 -  }
    2.45 -  else
    2.46 +  xudd->shadow_free = 0;
    2.47 +  memset(xudd->shadows, 0, sizeof(usbif_shadow_t) * SHADOW_ENTRIES);
    2.48 +  for (i = 0; i < SHADOW_ENTRIES; i++)
    2.49    {
    2.50 -    ULONG i;
    2.51 -    xudd->shadow_free = 0;
    2.52 -    memset(xudd->shadows, 0, sizeof(usbif_shadow_t) * SHADOW_ENTRIES);
    2.53 -    for (i = 0; i < SHADOW_ENTRIES; i++)
    2.54 -    {
    2.55 -      xudd->shadows[i].id = (uint16_t)i;
    2.56 -      put_shadow_on_freelist(xudd, &xudd->shadows[i]);
    2.57 -    }
    2.58 +    xudd->shadows[i].id = (uint16_t)i;
    2.59 +    put_shadow_on_freelist(xudd, &xudd->shadows[i]);
    2.60    }
    2.61    
    2.62    return STATUS_SUCCESS;