]> git.proxmox.com Git - mirror_edk2.git/commitdiff
sync the comments of serialportlib library class with Mde Library Spec.
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 7 Oct 2008 09:01:12 +0000 (09:01 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 7 Oct 2008 09:01:12 +0000 (09:01 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6080 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Library/SerialPortLib.h
MdePkg/Library/SerialPortLibNull/SerialPortLibNull.c

index 59c5c27e3f764b813e85ab6cab6605a61acdf59a..d6eb376ff60d7e007978204990b0a8fd298b73f2 100644 (file)
 #define __SERIAL_PORT_LIB__\r
 \r
 /**\r
-\r
-  Programmed hardware of Serial port.\r
-\r
-  @return  Status of Serial Port Device initialization.\r
+  Initialize the serial device hardware.\r
+  \r
+  If no initialization is required, then return RETURN_SUCCESS.\r
+  If the serial device was successfuly initialized, then return RETURN_SUCCESS.\r
+  If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.\r
+  \r
+  @retval RETURN_SUCCESS        The serial device was initialized.\r
+  @retval RETURN_DEVICE_ERROR   The serail device could not be initialized.\r
 \r
 **/\r
 RETURN_STATUS\r
@@ -31,14 +35,20 @@ SerialPortInitialize (
 /**\r
   Write data from buffer to serial device. \r
  \r
-  If the Buffer is NULL, then return 0; \r
-  if NumberOfBytes is zero, then return 0. \r
+  Writes NumberOfBytes data bytes from Buffer to the serial device.  \r
+  The number of bytes actually written to the serial device is returned.\r
+  If the return value is less than NumberOfBytes, then the write operation failed.\r
+\r
+  If Buffer is NULL, then ASSERT(). \r
 \r
-  @param  Buffer           Point of data buffer which need to be writed.\r
-  @param  NumberOfBytes    Number of output bytes which are cached in Buffer.\r
+  If NumberOfBytes is zero, then return 0.\r
 \r
-  @retval 0                Write data failed, or No data is to be written.\r
-  @retval !0               Actual number of bytes writed to serial device.\r
+  @param  Buffer           Pointer to the data buffer to be written.\r
+  @param  NumberOfBytes    Number of bytes to written to the serial device.\r
+\r
+  @retval 0                NumberOfBytes is 0.\r
+  @retval >0               The number of bytes written to the serial device.  \r
+                           If this value is less than NumberOfBytes, then the read operation failed.\r
 \r
 **/\r
 UINTN\r
@@ -52,11 +62,15 @@ SerialPortWrite (
 /**\r
   Read data from serial device and save the datas in buffer.\r
  \r
-  If the Buffer is NULL, then return zero;\r
-  if NumberOfBytes is zero, then return zero.\r
+  Reads NumberOfBytes data bytes from a serial device into the buffer\r
+  specified by Buffer. The number of bytes actually read is returned. \r
+  If the return value is less than NumberOfBytes, then the rest operation failed.\r
+\r
+  If Buffer is NULL, then ASSERT(). \r
+\r
+  If NumberOfBytes is zero, then return 0.\r
 \r
-  @param  Buffer           Point of data buffer, which contains the data \r
-                           returned from the serial device.\r
+  @param  Buffer           Pointer to the data buffer to store the data read from the serial device.\r
   @param  NumberOfBytes    Number of bytes which will be read.\r
 \r
   @retval 0                Read data failed, No data is to be read.\r
index 79b4e925ed2b86a2ce5e9cbffa6d42079cc41b06..e6b3c63365f6128fff92e373b9fc9e5d07c5d4f8 100644 (file)
 #include <Library/SerialPortLib.h>\r
 \r
 /**\r
-  Programmed hardware of Serial port.\r
-\r
-  @return    Always return RETURN_UNSUPPORTED.\r
+  Initialize the serial device hardware.\r
+  \r
+  If no initialization is required, then return RETURN_SUCCESS.\r
+  If the serial device was successfuly initialized, then return RETURN_SUCCESS.\r
+  If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.\r
+  \r
+  @retval RETURN_SUCCESS        The serial device was initialized.\r
+  @retval RETURN_DEVICE_ERROR   The serail device could not be initialized.\r
 \r
 **/\r
 RETURN_STATUS\r
@@ -34,12 +39,22 @@ SerialPortInitialize (
 }\r
 \r
 /**\r
-  Write data to serial device.\r
+  Write data from buffer to serial device. \r
\r
+  Writes NumberOfBytes data bytes from Buffer to the serial device.  \r
+  The number of bytes actually written to the serial device is returned.\r
+  If the return value is less than NumberOfBytes, then the write operation failed.\r
+\r
+  If Buffer is NULL, then ASSERT(). \r
+\r
+  If NumberOfBytes is zero, then return 0.\r
 \r
-  @param  Buffer           Point of data buffer which need to be writed.\r
-  @param  NumberOfBytes    Number of output bytes which are cached in Buffer.\r
+  @param  Buffer           Pointer to the data buffer to be written.\r
+  @param  NumberOfBytes    Number of bytes to written to the serial device.\r
 \r
-  @retval 0                No data is to be written.\r
+  @retval 0                NumberOfBytes is 0.\r
+  @retval >0               The number of bytes written to the serial device.  \r
+                           If this value is less than NumberOfBytes, then the read operation failed.\r
 \r
 **/\r
 UINTN\r
@@ -54,13 +69,14 @@ SerialPortWrite (
 \r
 \r
 /**\r
-  Read data from serial device and save the datas in buffer.\r
+  Reads data from a serial device into a buffer.\r
 \r
-  @param  Buffer           Point of data buffer, which contains the data\r
-                           returned from the serial device.\r
-  @param  NumberOfBytes    Number of bytes which will be read.\r
+  @param  Buffer           Pointer to the data buffer to store the data read from the serial device.\r
+  @param  NumberOfBytes    Number of bytes to read from the serial device.\r
 \r
-  @retval 0                No data is to be read.\r
+  @retval 0                NumberOfBytes is 0.\r
+  @retval >0               The number of bytes read from the serial device.  \r
+                           If this value is less than NumberOfBytes, then the read operation failed.\r
 \r
 **/\r
 UINTN\r