win-pvdrivers

changeset 527:55c3a1972b54

changed bus type to PNPBus
author James Harper <james.harper@bendigoit.com.au>
date Fri Jan 16 22:35:43 2009 +1100 (2009-01-16)
parents 08f3662b6807
children 283d39830905
files xenvbd/xenvbd.c xenvbd/xenvbd.inx
line diff
     1.1 --- a/xenvbd/xenvbd.c	Fri Jan 16 22:33:27 2009 +1100
     1.2 +++ b/xenvbd/xenvbd.c	Fri Jan 16 22:35:43 2009 +1100
     1.3 @@ -327,38 +327,6 @@ XenVbd_InitFromConfig(PXENVBD_DEVICE_DAT
     1.4    return SP_RETURN_FOUND;
     1.5  }
     1.6  
     1.7 -ULONG stat_interrupts = 0;
     1.8 -ULONG stat_interrupts_for_me = 0;
     1.9 -ULONG stat_reads = 0;
    1.10 -ULONG stat_writes = 0;
    1.11 -ULONG stat_unaligned_le_4096 = 0;
    1.12 -ULONG stat_unaligned_le_8192 = 0;
    1.13 -ULONG stat_unaligned_le_16384 = 0;
    1.14 -ULONG stat_unaligned_le_32768 = 0;
    1.15 -ULONG stat_unaligned_le_65536 = 0;
    1.16 -ULONG stat_unaligned_gt_65536 = 0;
    1.17 -ULONG stat_no_shadows = 0;
    1.18 -ULONG stat_no_grants = 0;
    1.19 -ULONG stat_outstanding_requests = 0;
    1.20 -
    1.21 -static VOID
    1.22 -XenVbd_DumpStats()
    1.23 -{
    1.24 -  KdPrint((__DRIVER_NAME "     stat_interrupts = %d\n", stat_interrupts));
    1.25 -  KdPrint((__DRIVER_NAME "     stat_interrupts_for_me = %d\n", stat_interrupts_for_me));
    1.26 -  KdPrint((__DRIVER_NAME "     stat_reads = %d\n", stat_reads));
    1.27 -  KdPrint((__DRIVER_NAME "     stat_writes = %d\n", stat_writes));
    1.28 -  KdPrint((__DRIVER_NAME "     stat_unaligned_le_4096 = %d\n", stat_unaligned_le_4096));
    1.29 -  KdPrint((__DRIVER_NAME "     stat_unaligned_le_8192 = %d\n", stat_unaligned_le_8192));
    1.30 -  KdPrint((__DRIVER_NAME "     stat_unaligned_le_16384 = %d\n", stat_unaligned_le_16384));
    1.31 -  KdPrint((__DRIVER_NAME "     stat_unaligned_le_32768 = %d\n", stat_unaligned_le_32768));
    1.32 -  KdPrint((__DRIVER_NAME "     stat_unaligned_le_65536 = %d\n", stat_unaligned_le_65536));
    1.33 -  KdPrint((__DRIVER_NAME "     stat_unaligned_gt_65536 = %d\n", stat_unaligned_gt_65536));
    1.34 -  KdPrint((__DRIVER_NAME "     stat_no_shadows = %d\n", stat_no_shadows));
    1.35 -  KdPrint((__DRIVER_NAME "     stat_no_grants = %d\n", stat_no_grants));
    1.36 -  KdPrint((__DRIVER_NAME "     stat_outstanding_requests = %d\n", stat_outstanding_requests));
    1.37 -}
    1.38 -
    1.39  static __inline ULONG
    1.40  decode_cdb_length(PSCSI_REQUEST_BLOCK srb)
    1.41  {
    1.42 @@ -447,36 +415,11 @@ XenVbd_PutSrbOnRing(PXENVBD_DEVICE_DATA 
    1.43    if (xvdd->grant_free <= ADDRESS_AND_SIZE_TO_SPAN_PAGES(ptr, transfer_length))
    1.44    {
    1.45      ASSERT(!xvdd->pending_srb);
    1.46 -    //KdPrint((__DRIVER_NAME "     No enough grants - deferring\n"));
    1.47 +    KdPrint((__DRIVER_NAME "     No enough grants - deferring\n"));
    1.48      xvdd->pending_srb = srb;
    1.49 -    stat_no_grants++;
    1.50      return;
    1.51    }
    1.52  
    1.53 -  if (!srb_offset)
    1.54 -  {
    1.55 -    if (PtrToUlong(srb->DataBuffer) & 511)
    1.56 -    {
    1.57 -      if (block_count * 512 <= 4096)
    1.58 -        stat_unaligned_le_4096++;
    1.59 -      else if (block_count * 512 <= 8192)
    1.60 -        stat_unaligned_le_8192++;
    1.61 -      else if (block_count * 512 <= 16384)
    1.62 -        stat_unaligned_le_16384++;
    1.63 -      else if (block_count * 512 <= 32768)
    1.64 -        stat_unaligned_le_32768++;
    1.65 -      else if (block_count * 512 <= 65536)
    1.66 -        stat_unaligned_le_65536++;
    1.67 -      else
    1.68 -        stat_unaligned_gt_65536++;
    1.69 -    }
    1.70 -    if (decode_cdb_is_read(srb))
    1.71 -      stat_reads++;
    1.72 -    else
    1.73 -      stat_writes++;
    1.74 -    stat_outstanding_requests++;
    1.75 -  }
    1.76 -  
    1.77    shadow = get_shadow_from_freelist(xvdd);
    1.78    ASSERT(shadow);
    1.79    shadow->req.sector_number = decode_cdb_sector(srb);
    1.80 @@ -540,8 +483,6 @@ XenVbd_PutSrbOnRing(PXENVBD_DEVICE_DATA 
    1.81      xvdd->vectors.EvtChn_Notify(xvdd->vectors.context, xvdd->event_channel);
    1.82    }
    1.83  
    1.84 -  if (!xvdd->shadow_free)
    1.85 -    stat_no_shadows++;
    1.86    if (xvdd->shadow_free && srb_offset == 0)
    1.87      ScsiPortNotification(NextLuRequest, xvdd, 0, 0, 0);
    1.88  
    1.89 @@ -889,11 +830,9 @@ XenVbd_HwScsiInterrupt(PVOID DeviceExten
    1.90  
    1.91    //KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
    1.92  
    1.93 -  stat_interrupts++;
    1.94    /* in dump mode I think we get called on a timer, not by an actual IRQ */
    1.95    if (!dump_mode && !xvdd->vectors.EvtChn_AckEvent(xvdd->vectors.context, xvdd->event_channel))
    1.96      return FALSE; /* interrupt was not for us */
    1.97 -  stat_interrupts_for_me++;
    1.98    if (xvdd->device_state->resume_state != xvdd->device_state->resume_state_ack)
    1.99    {
   1.100      FUNCTION_ENTER();
   1.101 @@ -920,9 +859,6 @@ XenVbd_HwScsiInterrupt(PVOID DeviceExten
   1.102      return FALSE;
   1.103    }
   1.104  
   1.105 -  if (!dump_mode && !(stat_interrupts_for_me & 0xFFFF))
   1.106 -    XenVbd_DumpStats();
   1.107 -    
   1.108    while (more_to_do)
   1.109    {
   1.110      rp = xvdd->ring.sring->rsp_prod;
   1.111 @@ -1005,7 +941,6 @@ XenVbd_HwScsiInterrupt(PVOID DeviceExten
   1.112            if (offset == (ULONG)block_count * 512)
   1.113            {
   1.114              ScsiPortNotification(RequestComplete, xvdd, srb);
   1.115 -            stat_outstanding_requests--;
   1.116              ScsiPortNotification(NextLuRequest, DeviceExtension, 0, 0, 0);
   1.117            }
   1.118            else
   1.119 @@ -1017,7 +952,6 @@ XenVbd_HwScsiInterrupt(PVOID DeviceExten
   1.120          {
   1.121            put_shadow_on_freelist(xvdd, shadow);
   1.122            ScsiPortNotification(RequestComplete, xvdd, srb);
   1.123 -          stat_outstanding_requests--;
   1.124            if (xvdd->pending_srb)
   1.125            {
   1.126              srb = xvdd->pending_srb;
   1.127 @@ -1510,7 +1444,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
   1.128    RtlZeroMemory(&HwInitializationData, sizeof(HW_INITIALIZATION_DATA));
   1.129  
   1.130    HwInitializationData.HwInitializationDataSize = sizeof(HW_INITIALIZATION_DATA);
   1.131 -  HwInitializationData.AdapterInterfaceType = Internal;
   1.132 +  HwInitializationData.AdapterInterfaceType = PNPBus;
   1.133    HwInitializationData.DeviceExtensionSize = sizeof(XENVBD_DEVICE_DATA);
   1.134    HwInitializationData.SpecificLuExtensionSize = 0;
   1.135    /* SrbExtension is not always aligned to a page boundary, so we add PAGE_SIZE-1 to it to make sure we have at least UNALIGNED_DOUBLE_BUFFER_SIZE bytes of page aligned memory */
     2.1 --- a/xenvbd/xenvbd.inx	Fri Jan 16 22:33:27 2009 +1100
     2.2 +++ b/xenvbd/xenvbd.inx	Fri Jan 16 22:35:43 2009 +1100
     2.3 @@ -40,7 +40,7 @@ ServiceBinary  = %12%\xenvbd.sys
     2.4  AddReg = XenVbd_Service_AddReg
     2.5  
     2.6  [XenVbd_Service_AddReg]
     2.7 -HKR,"Parameters\PnpInterface", "0", 0x00010001, 0x00000001
     2.8 +HKR,"Parameters\PnpInterface", "15", 0x00010001, 0x00000001
     2.9  ; Add XenHide as a filter to IDE Controllers
    2.10  HKLM,SYSTEM\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318},UpperFilters,0x00010008,XenHide
    2.11  ; Add XenHide as a filter to SCSI Controllers