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