win-pvdrivers

changeset 1026:d9a2a6de2ab4

More debugprint updates
author James Harper <james.harper@bendigoit.com.au>
date Tue Feb 19 20:54:48 2013 +1100 (2013-02-19)
parents aa2e51f67f7c
children 0f40ce5cb467
files xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/xenpci_pdo.c	Tue Feb 19 15:14:53 2013 +1100
     1.2 +++ b/xenpci/xenpci_pdo.c	Tue Feb 19 20:54:48 2013 +1100
     1.3 @@ -75,7 +75,7 @@ XenPci_GetBackendDetails(WDFDEVICE devic
     1.4    res = XenBus_Read(xpdd, XBT_NIL, path, &value);
     1.5    if (res)
     1.6    {
     1.7 -    KdPrint((__DRIVER_NAME "    Failed to read backend path\n"));
     1.8 +    FUNCTION_MSG("Failed to read backend path\n");
     1.9      XenPci_FreeMem(res);
    1.10      return STATUS_UNSUCCESSFUL;
    1.11    }
    1.12 @@ -87,7 +87,7 @@ XenPci_GetBackendDetails(WDFDEVICE devic
    1.13      "%s/backend-id", xppdd->path);
    1.14    res = XenBus_Read(xpdd, XBT_NIL, path, &value);
    1.15    if (res) {
    1.16 -    KdPrint((__DRIVER_NAME "    Failed to read backend id\n"));
    1.17 +    FUNCTION_MSG("Failed to read backend id\n");
    1.18      XenPci_FreeMem(res);
    1.19      return STATUS_UNSUCCESSFUL;
    1.20    }
    1.21 @@ -150,33 +150,33 @@ XenPciPdo_EvtDeviceD0Entry(WDFDEVICE dev
    1.22    CHAR path[128];
    1.23    
    1.24    FUNCTION_ENTER();
    1.25 -  KdPrint((__DRIVER_NAME "     path = %s\n", xppdd->path));
    1.26 +  FUNCTION_MSG("path = %s\n", xppdd->path);
    1.27  
    1.28    switch (previous_state) {
    1.29    case WdfPowerDeviceD0:
    1.30 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD1\n"));
    1.31 +    FUNCTION_MSG("WdfPowerDeviceD1\n");
    1.32      break;
    1.33    case WdfPowerDeviceD1:
    1.34 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD1\n"));
    1.35 +    FUNCTION_MSG("WdfPowerDeviceD1\n");
    1.36      break;
    1.37    case WdfPowerDeviceD2:
    1.38 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD2\n"));
    1.39 +    FUNCTION_MSG("WdfPowerDeviceD2\n");
    1.40      break;
    1.41    case WdfPowerDeviceD3:
    1.42 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD3\n"));
    1.43 +    FUNCTION_MSG("WdfPowerDeviceD3\n");
    1.44      if (xppdd->hiber_usage_kludge) {
    1.45 -      KdPrint((__DRIVER_NAME "     (but really WdfPowerDevicePrepareForHibernation)\n"));
    1.46 +      FUNCTION_MSG("(but really WdfPowerDevicePrepareForHibernation)\n");
    1.47        previous_state = WdfPowerDevicePrepareForHibernation;
    1.48      }
    1.49      break;
    1.50    case WdfPowerDeviceD3Final:
    1.51 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD3Final\n"));
    1.52 +    FUNCTION_MSG("WdfPowerDeviceD3Final\n");
    1.53      break;
    1.54    case WdfPowerDevicePrepareForHibernation:
    1.55 -    KdPrint((__DRIVER_NAME "     WdfPowerDevicePrepareForHibernation\n"));
    1.56 +    FUNCTION_MSG("WdfPowerDevicePrepareForHibernation\n");
    1.57      break;  
    1.58    default:
    1.59 -    KdPrint((__DRIVER_NAME "     Unknown WdfPowerDevice state %d\n", previous_state));
    1.60 +    FUNCTION_MSG("Unknown WdfPowerDevice state %d\n", previous_state);
    1.61      break;  
    1.62    }
    1.63  
    1.64 @@ -217,39 +217,39 @@ XenPciPdo_EvtDeviceD0Exit(WDFDEVICE devi
    1.65    UNREFERENCED_PARAMETER(target_state);
    1.66    
    1.67    FUNCTION_ENTER();
    1.68 -  KdPrint((__DRIVER_NAME "     path = %s\n", xppdd->path));
    1.69 +  FUNCTION_MSG("path = %s\n", xppdd->path);
    1.70    
    1.71    switch (target_state) {
    1.72    case WdfPowerDeviceD0:
    1.73 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD1\n"));
    1.74 +    FUNCTION_MSG("WdfPowerDeviceD1\n");
    1.75      break;
    1.76    case WdfPowerDeviceD1:
    1.77 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD1\n"));
    1.78 +    FUNCTION_MSG("WdfPowerDeviceD1\n");
    1.79      break;
    1.80    case WdfPowerDeviceD2:
    1.81 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD2\n"));
    1.82 +    FUNCTION_MSG("WdfPowerDeviceD2\n");
    1.83      break;
    1.84    case WdfPowerDeviceD3:
    1.85 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD3\n"));
    1.86 +    FUNCTION_MSG("WdfPowerDeviceD3\n");
    1.87      if (xppdd->hiber_usage_kludge) {
    1.88 -      KdPrint((__DRIVER_NAME "     (but really WdfPowerDevicePrepareForHibernation)\n"));
    1.89 +      FUNCTION_MSG("(but really WdfPowerDevicePrepareForHibernation)\n");
    1.90        target_state = WdfPowerDevicePrepareForHibernation;
    1.91      }
    1.92      break;
    1.93    case WdfPowerDeviceD3Final:
    1.94 -    KdPrint((__DRIVER_NAME "     WdfPowerDeviceD3Final\n"));
    1.95 +    FUNCTION_MSG("WdfPowerDeviceD3Final\n");
    1.96      break;
    1.97    case WdfPowerDevicePrepareForHibernation:
    1.98 -    KdPrint((__DRIVER_NAME "     WdfPowerDevicePrepareForHibernation\n"));
    1.99 +    FUNCTION_MSG("WdfPowerDevicePrepareForHibernation\n");
   1.100      break;  
   1.101    default:
   1.102 -    KdPrint((__DRIVER_NAME "     Unknown WdfPowerDevice state %d\n", target_state));
   1.103 +    FUNCTION_MSG("Unknown WdfPowerDevice state %d\n", target_state);
   1.104      break;  
   1.105    }
   1.106    
   1.107    if (target_state == WdfPowerDevicePrepareForHibernation)
   1.108    {
   1.109 -    KdPrint((__DRIVER_NAME "     not powering down as we are hibernating\n"));
   1.110 +    FUNCTION_MSG("not powering down as we are hibernating\n");
   1.111      // should we set the backend state here so it's correct on resume???
   1.112    }
   1.113    
   1.114 @@ -272,21 +272,21 @@ XenPciPdo_EvtDeviceUsageNotification(WDF
   1.115  
   1.116    FUNCTION_ENTER();
   1.117    
   1.118 -  KdPrint((__DRIVER_NAME "     path = %s\n", xppdd->path));
   1.119 +  FUNCTION_MSG("path = %s\n", xppdd->path);
   1.120    switch (notification_type)
   1.121    {
   1.122    case WdfSpecialFilePaging:
   1.123 -    KdPrint((__DRIVER_NAME "     notification_type = Paging, flag = %d\n", is_in_notification_path));
   1.124 +    FUNCTION_MSG("notification_type = Paging, flag = %d\n", is_in_notification_path);
   1.125      break;
   1.126    case WdfSpecialFileHibernation:
   1.127      xppdd->hiber_usage_kludge = is_in_notification_path;
   1.128 -    KdPrint((__DRIVER_NAME "     notification_type = Hibernation, flag = %d\n", is_in_notification_path));
   1.129 +    FUNCTION_MSG("notification_type = Hibernation, flag = %d\n", is_in_notification_path);
   1.130      break;
   1.131    case WdfSpecialFileDump:
   1.132 -    KdPrint((__DRIVER_NAME "     notification_type = Dump, flag = %d\n", is_in_notification_path));
   1.133 +    FUNCTION_MSG("notification_type = Dump, flag = %d\n", is_in_notification_path);
   1.134      break;
   1.135    default:
   1.136 -    KdPrint((__DRIVER_NAME "     notification_type = %d, flag = %d\n", notification_type, is_in_notification_path));
   1.137 +    FUNCTION_MSG("notification_type = %d, flag = %d\n", notification_type, is_in_notification_path);
   1.138      break;
   1.139    }
   1.140  
   1.141 @@ -307,7 +307,7 @@ XenPci_EvtDevicePnpStateChange(WDFDEVICE
   1.142    {
   1.143      PXENPCI_DEVICE_DATA xpdd = GetXpdd(xppdd->wdf_device_bus_fdo);
   1.144      
   1.145 -    KdPrint((__DRIVER_NAME "     Eject failed, doing surprise removal\n"));
   1.146 +    FUNCTION_MSG("Eject failed, doing surprise removal\n");
   1.147      xppdd->do_not_enumerate = TRUE;
   1.148      XenPci_EvtChildListScanForChildren(xpdd->child_list);
   1.149    }
   1.150 @@ -345,8 +345,8 @@ XenPci_EvtChildListCreateDevice(WDFCHILD
   1.151    child_pnp_power_callbacks.EvtDeviceUsageNotification = XenPciPdo_EvtDeviceUsageNotification;
   1.152    WdfDeviceInitSetPnpPowerEventCallbacks(child_init, &child_pnp_power_callbacks);
   1.153  
   1.154 -  KdPrint((__DRIVER_NAME "     device = '%s', index = '%d', path = '%s'\n",
   1.155 -    identification->device, identification->index, identification->path));
   1.156 +  FUNCTION_MSG("device = '%s', index = '%d', path = '%s'\n",
   1.157 +    identification->device, identification->index, identification->path);
   1.158    
   1.159    //status = WdfDeviceInitAssignWdmIrpPreprocessCallback(child_init, XenPciPdo_EvtDeviceWdmIrpPreprocess_START_DEVICE,
   1.160    //  IRP_MJ_PNP, pnp_minor_functions, ARRAY_SIZE(pnp_minor_functions));