[USBPORT] Add USBPORT_DumpingEndpointProperties() and USBPORT_DumpingTtEndpoint().
authorVadim Galyant <vgal@rambler.ru>
Fri, 8 Dec 2017 09:16:49 +0000 (18:16 +0900)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sun, 21 Jan 2018 18:35:47 +0000 (19:35 +0100)
drivers/usb/usbport/debug.c
drivers/usb/usbport/usbdebug.h
drivers/usb/usbport/usbport.h

index 67ca9f6..1d2662d 100644 (file)
@@ -12,6 +12,7 @@
 
 #define NDEBUG_USBPORT_MINIPORT
 #define NDEBUG_USBPORT_URB
+//#define NDEBUG_USBPORT_USB2
 #include "usbdebug.h"
 
 ULONG
@@ -275,3 +276,39 @@ USBPORT_DumpingIDs(IN PVOID Buffer)
     DPRINT("\n");
 }
 
+VOID
+NTAPI
+USBPORT_DumpingEndpointProperties(IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties)
+{
+    DPRINT_USB2("DeviceAddress         - %X\n", EndpointProperties->DeviceAddress);
+    DPRINT_USB2("EndpointAddress       - %X\n", EndpointProperties->EndpointAddress);
+    DPRINT_USB2("TotalMaxPacketSize    - %X\n", EndpointProperties->TotalMaxPacketSize);
+    DPRINT_USB2("Period                - %X\n", EndpointProperties->Period);
+    DPRINT_USB2("DeviceSpeed           - %X\n", EndpointProperties->DeviceSpeed);
+    DPRINT_USB2("UsbBandwidth          - %X\n", EndpointProperties->UsbBandwidth);
+    DPRINT_USB2("ScheduleOffset        - %X\n", EndpointProperties->ScheduleOffset);
+    DPRINT_USB2("TransferType          - %X\n", EndpointProperties->TransferType);
+    DPRINT_USB2("MaxTransferSize       - %X\n", EndpointProperties->MaxTransferSize);
+    DPRINT_USB2("HubAddr               - %X\n", EndpointProperties->HubAddr);
+    DPRINT_USB2("PortNumber            - %X\n", EndpointProperties->PortNumber);
+    DPRINT_USB2("InterruptScheduleMask - %X\n", EndpointProperties->InterruptScheduleMask);
+    DPRINT_USB2("SplitCompletionMask   - %X\n", EndpointProperties->SplitCompletionMask);
+    DPRINT_USB2("MaxPacketSize         - %X\n", EndpointProperties->MaxPacketSize);
+}
+
+VOID
+NTAPI
+USBPORT_DumpingTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint)
+{
+    DPRINT_USB2("MaxPacketSize   - %X\n", TtEndpoint->MaxPacketSize);
+    DPRINT_USB2("Period          - %X\n", TtEndpoint->Period);
+    DPRINT_USB2("TtEndpointParams- %X\n", TtEndpoint->TtEndpointParams.AsULONG);
+    DPRINT_USB2("CalcBusTime     - %X\n", TtEndpoint->CalcBusTime);
+    DPRINT_USB2("StartTime       - %X\n", TtEndpoint->StartTime);
+    DPRINT_USB2("ActualPeriod    - %X\n", TtEndpoint->ActualPeriod);
+    DPRINT_USB2("StartFrame      - %X\n", TtEndpoint->StartFrame);
+    DPRINT_USB2("StartMicroframe - %X\n", TtEndpoint->StartMicroframe);
+    DPRINT_USB2("Nums            - %X\n", TtEndpoint->Nums.AsULONG);
+    DPRINT_USB2("nextTtEndpoint  - %X\n", TtEndpoint->NextTtEndpoint);
+}
+
index 98484f6..53e65b2 100644 (file)
 
     #endif
 
+    #ifndef NDEBUG_USBPORT_USB2
+
+        #define DPRINT_USB2(fmt, ...) do { \
+            if (DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__))  \
+                DbgPrint("(%s:%d) DbgPrint() failed!\n", __RELFILE__, __LINE__); \
+        } while (0)
+
+    #else
+
+#if defined(_MSC_VER)
+        #define DPRINT_USB2   __noop
+#else
+        #define DPRINT_USB2(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
+#endif
+
+    #endif
+
 #else /* not DBG */
 
 #if defined(_MSC_VER)
     #define DPRINT_INT    __noop
     #define DPRINT_TIMER    __noop
     #define DPRINT_QUEUE    __noop
+    #define DPRINT_USB2    __noop
 #else
     #define DPRINT_MINIPORT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
     #define DPRINT_CORE(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
     #define DPRINT_INT(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
     #define DPRINT_TIMER(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
     #define DPRINT_QUEUE(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
+    #define DPRINT_USB2(...) do { if(0) { DbgPrint(__VA_ARGS__); } } while(0)
 #endif /* _MSC_VER */
 
 #endif /* not DBG */
index 8827716..8df658b 100644 (file)
@@ -1335,4 +1335,14 @@ NTAPI
 USB2_InitController(
   IN PUSB2_HC_EXTENSION HcExtension);
 
+VOID
+NTAPI
+USBPORT_DumpingEndpointProperties(
+  IN PUSBPORT_ENDPOINT_PROPERTIES EndpointProperties);
+
+VOID
+NTAPI
+USBPORT_DumpingTtEndpoint(
+  IN PUSB2_TT_ENDPOINT TtEndpoint);
+
 #endif /* USBPORT_H__ */