]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Common.c
SourceLevelDebugPkg DebugCommUsb3: Refine some formats/comments
[mirror_edk2.git] / SourceLevelDebugPkg / Library / DebugCommunicationLibUsb3 / DebugCommunicationLibUsb3Common.c
index 7c62bdadfbf255dca50f313f6da623de8355ca4d..37f49ad822f56fb6668bb17d4794db0481e9568d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Debug Port Library implementation based on usb3 debug port.\r
 \r
-  Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -85,15 +85,15 @@ XhcClearR32Bit(
   Write the data to the XHCI debug register.\r
 \r
   @param  Handle       Debug port handle.\r
-  @param  Offset       The offset of the runtime register.\r
+  @param  Offset       The offset of the debug register.\r
   @param  Data         The data to write.\r
 \r
 **/\r
 VOID\r
 XhcWriteDebugReg (\r
   IN USB3_DEBUG_PORT_HANDLE  *Handle,\r
-  IN UINT32                   Offset,\r
-  IN UINT32                   Data\r
+  IN UINT32                  Offset,\r
+  IN UINT32                  Data\r
   )\r
 {\r
   EFI_PHYSICAL_ADDRESS  DebugCapabilityBase;\r
@@ -116,7 +116,7 @@ XhcWriteDebugReg (
 UINT32\r
 XhcReadDebugReg (\r
   IN  USB3_DEBUG_PORT_HANDLE *Handle,\r
-  IN  UINT32                   Offset\r
+  IN  UINT32                 Offset\r
   )\r
 {\r
   UINT32                  Data;\r
@@ -129,16 +129,16 @@ XhcReadDebugReg (
 }\r
 \r
 /**\r
-  Set one bit of the runtime register while keeping other bits.\r
+  Set one bit of the debug register while keeping other bits.\r
 \r
   @param  Handle       Debug port handle.\r
-  @param  Offset       The offset of the runtime register.\r
+  @param  Offset       The offset of the debug register.\r
   @param  Bit          The bit mask of the register to set.\r
 \r
 **/\r
 VOID\r
 XhcSetDebugRegBit (\r
-  IN USB3_DEBUG_PORT_HANDLE *Handle,\r
+  IN USB3_DEBUG_PORT_HANDLE   *Handle,\r
   IN UINT32                   Offset,\r
   IN UINT32                   Bit\r
   )\r
@@ -216,7 +216,7 @@ UpdateXhcResource (
 \r
   @param  Handle             Debug port handle.\r
 \r
-  @retval RETURN_UNSUPPORTED The usb host controller does not supported usb debug port capability.\r
+  @retval RETURN_UNSUPPORTED The usb host controller does not support usb debug port capability.\r
   @retval RETURN_SUCCESS     Get bar and offset successfully.\r
 \r
 **/\r
@@ -300,7 +300,7 @@ Done:
   Check if it needs to re-initialize usb debug port hardware.\r
 \r
   During different phases switch, such as SEC to PEI or PEI to DXE or DXE to SMM, we should check\r
-  whether the usb debug port hardware configuration is changed. Such case can be triggerred by\r
+  whether the usb debug port hardware configuration is changed. Such case can be triggered by\r
   Pci bus resource allocation and so on.\r
 \r
   @param  Handle           Debug port handle.\r
@@ -756,7 +756,7 @@ Enable:
   @param  Handle           Debug port handle.\r
   @param  Buffer           Pointer to the data buffer to store the data read from the debug device.\r
   @param  NumberOfBytes    Number of bytes which will be read.\r
-  @param  Timeout          Timeout value for reading from debug device. It unit is Microsecond.\r
+  @param  Timeout          Timeout value for reading from debug device. Its unit is Microsecond.\r
 \r
   @retval 0                Read data failed, no data is to be read.\r
   @retval >0               Actual number of bytes read from debug device.\r
@@ -836,7 +836,7 @@ DebugPortReadBuffer (
 \r
   @retval 0                NumberOfBytes is 0.\r
   @retval >0               The number of bytes written to the debug device.\r
-                           If this value is less than NumberOfBytes, then the read operation failed.\r
+                           If this value is less than NumberOfBytes, then the write operation failed.\r
 \r
 **/\r
 UINTN\r
@@ -852,7 +852,6 @@ DebugPortWriteBuffer (
   UINTN                     Sent;\r
   UINTN                     Total;\r
   EFI_PHYSICAL_ADDRESS      XhciMmioBase;\r
-  UINTN                     Index;\r
 \r
   if (NumberOfBytes == 0 || Buffer == NULL) {\r
     return 0;\r
@@ -895,7 +894,6 @@ DebugPortWriteBuffer (
   //\r
   DebugPortPollBuffer (Handle);\r
 \r
-  Index = 0;\r
   while ((Total < NumberOfBytes)) {\r
     if (NumberOfBytes - Total > USB3_DEBUG_PORT_WRITE_MAX_PACKET_SIZE) {\r
       Sent = USB3_DEBUG_PORT_WRITE_MAX_PACKET_SIZE;\r
@@ -919,7 +917,7 @@ DebugPortWriteBuffer (
   @param  Handle           Debug port handle.\r
 \r
   @retval TRUE             Data is waiting to be read from the debug device.\r
-  @retval FALSE            There is no data waiting to be read from the serial device.\r
+  @retval FALSE            There is no data waiting to be read from the debug device.\r
 \r
 **/\r
 BOOLEAN\r
@@ -989,7 +987,7 @@ DebugPortPollBuffer (
 /**\r
   Initialize the debug port.\r
 \r
-  If Function is not NULL, Debug Communication Libary will call this function\r
+  If Function is not NULL, Debug Communication Library will call this function\r
   by passing in the Context to be the first parameter. If needed, Debug Communication\r
   Library will create one debug port handle to be the second argument passing in\r
   calling the Function, otherwise it will pass NULL to be the second argument of\r
@@ -997,7 +995,7 @@ DebugPortPollBuffer (
 \r
   If Function is NULL, and Context is not NULL, the Debug Communication Library could\r
     a) Return the same handle as passed in (as Context parameter).\r
-    b) Ignore the input Context parameter and create new hanlde to be returned.\r
+    b) Ignore the input Context parameter and create new handle to be returned.\r
 \r
   If parameter Function is NULL and Context is NULL, Debug Communication Library could\r
   created a new handle if needed and return it, otherwise it will return NULL.\r