Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
4.2 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. debugn.c
  5. Author:
  6. ervinp
  7. Environment:
  8. Kernel mode
  9. Revision History:
  10. --*/
  11. #include <ndis.h>
  12. #include <ntddndis.h> // defines OID's
  13. #include "..\inc\rndis.h"
  14. #include "..\inc\rndisapi.h"
  15. #include "usb8023.h"
  16. #include "debug.h"
  17. #if DBG
  18. PUCHAR DbgGetOidName(ULONG oid)
  19. {
  20. PCHAR oidName;
  21. switch (oid){
  22. #undef MAKECASE
  23. #define MAKECASE(oidx) case oidx: oidName = #oidx; break;
  24. MAKECASE(OID_GEN_SUPPORTED_LIST)
  25. MAKECASE(OID_GEN_HARDWARE_STATUS)
  26. MAKECASE(OID_GEN_MEDIA_SUPPORTED)
  27. MAKECASE(OID_GEN_MEDIA_IN_USE)
  28. MAKECASE(OID_GEN_MAXIMUM_LOOKAHEAD)
  29. MAKECASE(OID_GEN_MAXIMUM_FRAME_SIZE)
  30. MAKECASE(OID_GEN_LINK_SPEED)
  31. MAKECASE(OID_GEN_TRANSMIT_BUFFER_SPACE)
  32. MAKECASE(OID_GEN_RECEIVE_BUFFER_SPACE)
  33. MAKECASE(OID_GEN_TRANSMIT_BLOCK_SIZE)
  34. MAKECASE(OID_GEN_RECEIVE_BLOCK_SIZE)
  35. MAKECASE(OID_GEN_VENDOR_ID)
  36. MAKECASE(OID_GEN_VENDOR_DESCRIPTION)
  37. MAKECASE(OID_GEN_CURRENT_PACKET_FILTER)
  38. MAKECASE(OID_GEN_CURRENT_LOOKAHEAD)
  39. MAKECASE(OID_GEN_DRIVER_VERSION)
  40. MAKECASE(OID_GEN_MAXIMUM_TOTAL_SIZE)
  41. MAKECASE(OID_GEN_PROTOCOL_OPTIONS)
  42. MAKECASE(OID_GEN_MAC_OPTIONS)
  43. MAKECASE(OID_GEN_MEDIA_CONNECT_STATUS)
  44. MAKECASE(OID_GEN_MAXIMUM_SEND_PACKETS)
  45. MAKECASE(OID_GEN_VENDOR_DRIVER_VERSION)
  46. MAKECASE(OID_GEN_SUPPORTED_GUIDS)
  47. MAKECASE(OID_GEN_NETWORK_LAYER_ADDRESSES)
  48. MAKECASE(OID_GEN_TRANSPORT_HEADER_OFFSET)
  49. MAKECASE(OID_GEN_MEDIA_CAPABILITIES)
  50. MAKECASE(OID_GEN_PHYSICAL_MEDIUM)
  51. MAKECASE(OID_GEN_XMIT_OK)
  52. MAKECASE(OID_GEN_RCV_OK)
  53. MAKECASE(OID_GEN_XMIT_ERROR)
  54. MAKECASE(OID_GEN_RCV_ERROR)
  55. MAKECASE(OID_GEN_RCV_NO_BUFFER)
  56. MAKECASE(OID_GEN_DIRECTED_BYTES_XMIT)
  57. MAKECASE(OID_GEN_DIRECTED_FRAMES_XMIT)
  58. MAKECASE(OID_GEN_MULTICAST_BYTES_XMIT)
  59. MAKECASE(OID_GEN_MULTICAST_FRAMES_XMIT)
  60. MAKECASE(OID_GEN_BROADCAST_BYTES_XMIT)
  61. MAKECASE(OID_GEN_BROADCAST_FRAMES_XMIT)
  62. MAKECASE(OID_GEN_DIRECTED_BYTES_RCV)
  63. MAKECASE(OID_GEN_DIRECTED_FRAMES_RCV)
  64. MAKECASE(OID_GEN_MULTICAST_BYTES_RCV)
  65. MAKECASE(OID_GEN_MULTICAST_FRAMES_RCV)
  66. MAKECASE(OID_GEN_BROADCAST_BYTES_RCV)
  67. MAKECASE(OID_GEN_BROADCAST_FRAMES_RCV)
  68. MAKECASE(OID_GEN_RCV_CRC_ERROR)
  69. MAKECASE(OID_GEN_TRANSMIT_QUEUE_LENGTH)
  70. MAKECASE(OID_GEN_GET_TIME_CAPS)
  71. MAKECASE(OID_GEN_GET_NETCARD_TIME)
  72. MAKECASE(OID_GEN_NETCARD_LOAD)
  73. MAKECASE(OID_GEN_DEVICE_PROFILE)
  74. MAKECASE(OID_GEN_INIT_TIME_MS)
  75. MAKECASE(OID_GEN_RESET_COUNTS)
  76. MAKECASE(OID_GEN_MEDIA_SENSE_COUNTS)
  77. MAKECASE(OID_802_3_PERMANENT_ADDRESS)
  78. MAKECASE(OID_802_3_CURRENT_ADDRESS)
  79. MAKECASE(OID_802_3_MULTICAST_LIST)
  80. MAKECASE(OID_802_3_MAXIMUM_LIST_SIZE)
  81. MAKECASE(OID_802_3_MAC_OPTIONS)
  82. MAKECASE(OID_802_3_RCV_ERROR_ALIGNMENT)
  83. MAKECASE(OID_802_3_XMIT_ONE_COLLISION)
  84. MAKECASE(OID_802_3_XMIT_MORE_COLLISIONS)
  85. MAKECASE(OID_802_3_XMIT_DEFERRED)
  86. MAKECASE(OID_802_3_XMIT_MAX_COLLISIONS)
  87. MAKECASE(OID_802_3_RCV_OVERRUN)
  88. MAKECASE(OID_802_3_XMIT_UNDERRUN)
  89. MAKECASE(OID_802_3_XMIT_HEARTBEAT_FAILURE)
  90. MAKECASE(OID_802_3_XMIT_TIMES_CRS_LOST)
  91. MAKECASE(OID_802_3_XMIT_LATE_COLLISIONS)
  92. default:
  93. oidName = "<** UNKNOWN OID **>";
  94. break;
  95. }
  96. return oidName;
  97. }
  98. void DbgStallExecution(ULONG usec)
  99. {
  100. NdisStallExecution(usec);
  101. }
  102. ULONG DbgGetSystemTime_msec()
  103. {
  104. LONGLONG systime_usec;
  105. NdisGetCurrentSystemTime((PVOID)&systime_usec);
  106. return (ULONG)((*(PULONG)&systime_usec)/1000);
  107. }
  108. #endif