]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
SourceLevelDebugPkg/DebugCommunicationLibUsb: Add endpoint config.
[mirror_edk2.git] / SourceLevelDebugPkg / Library / DebugCommunicationLibUsb / DebugCommunicationLibUsb.c
index d996f80f59e31ed087c982bc2cf674b7e9136924..1836c055267b669422dac55edb62b32ed20dad30 100644 (file)
@@ -132,6 +132,14 @@ typedef struct _USB_DEBUG_PORT_HANDLE{
   //\r
   UINT32       EhciMemoryBase;\r
   //\r
+  // The usb debug device In endpoint.\r
+  //\r
+  UINT8        InEndpoint;\r
+  //\r
+  // The usb debug device Out endpoint.\r
+  //\r
+  UINT8        OutEndpoint;\r
+  //\r
   // The Bulk In endpoint toggle bit.\r
   //\r
   UINT8        BulkInToggle;\r
@@ -722,6 +730,12 @@ InitializeUsbDebugHardware (
       return RETURN_DEVICE_ERROR;\r
     }\r
 \r
+    //\r
+    // Determine the usb debug device endpoints.\r
+    //\r
+    Handle->InEndpoint  = UsbDebugPortDescriptor.DebugInEndpoint;\r
+    Handle->OutEndpoint = UsbDebugPortDescriptor.DebugOutEndpoint;\r
+\r
     //\r
     // enable the usb debug feature.\r
     //\r
@@ -879,7 +893,7 @@ DebugPortWriteBuffer (
       Sent = (UINT8)(NumberOfBytes - Total);\r
     }\r
 \r
-    Status = UsbDebugPortOut(UsbDebugPortRegister, Buffer + Total, Sent, OUTPUT_PID, 0x7F, 0x01, UsbDebugPortHandle->BulkOutToggle);\r
+    Status = UsbDebugPortOut(UsbDebugPortRegister, Buffer + Total, Sent, OUTPUT_PID, 0x7F, UsbDebugPortHandle->OutEndpoint, UsbDebugPortHandle->BulkOutToggle);\r
 \r
     if (RETURN_ERROR(Status)) {\r
       return Total;\r
@@ -959,7 +973,7 @@ DebugPortPollBuffer (
     UsbDebugPortRegister->SendPid  = DATA1_PID;\r
   }\r
   UsbDebugPortRegister->UsbAddress  = 0x7F;\r
-  UsbDebugPortRegister->UsbEndPoint = 0x82 & 0x0F;\r
+  UsbDebugPortRegister->UsbEndPoint = UsbDebugPortHandle->InEndpoint & 0x0F;\r
 \r
   //\r
   // Clearing W/R bit to indicate it's a READ operation\r