From 3bda39fcb84c7bd731b12937695a658849490559 Mon Sep 17 00:00:00 2001 From: Vadim Galyant Date: Fri, 8 Dec 2017 18:16:49 +0900 Subject: [PATCH] [USBPORT] Add USBPORT_DumpingEndpointProperties() and USBPORT_DumpingTtEndpoint(). --- drivers/usb/usbport/debug.c | 37 ++++++++++++++++++++++++++++++++++ drivers/usb/usbport/usbdebug.h | 19 +++++++++++++++++ drivers/usb/usbport/usbport.h | 10 +++++++++ 3 files changed, 66 insertions(+) diff --git a/drivers/usb/usbport/debug.c b/drivers/usb/usbport/debug.c index 67ca9f6f989..1d2662d5e33 100644 --- a/drivers/usb/usbport/debug.c +++ b/drivers/usb/usbport/debug.c @@ -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); +} + diff --git a/drivers/usb/usbport/usbdebug.h b/drivers/usb/usbport/usbdebug.h index 98484f64f3c..53e65b25db1 100644 --- a/drivers/usb/usbport/usbdebug.h +++ b/drivers/usb/usbport/usbdebug.h @@ -112,6 +112,23 @@ #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) @@ -121,6 +138,7 @@ #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) @@ -128,6 +146,7 @@ #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 */ diff --git a/drivers/usb/usbport/usbport.h b/drivers/usb/usbport/usbport.h index 88277167c47..8df658b12d1 100644 --- a/drivers/usb/usbport/usbport.h +++ b/drivers/usb/usbport/usbport.h @@ -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__ */ -- 2.17.1