]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/SerialPortLibNull/SerialPortLibNull.c
Refine code for ECC check.
[mirror_edk2.git] / MdePkg / Library / SerialPortLibNull / SerialPortLibNull.c
CommitLineData
316172ba 1/** @file\r
eceb3a4c 2 Null Serial Port library instance with empty functions.\r
316172ba 3\r
eceb3a4c 4 Copyright (c) 2006 - 2008, Intel Corporation\r
316172ba 5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
316172ba 13**/\r
14\r
c892d846 15\r
7f1c3191 16#include <Base.h>\r
c892d846 17\r
18\r
316172ba 19#include <Library/SerialPortLib.h>\r
20\r
eceb3a4c 21/**\r
d69107aa 22 Initialize the serial device hardware.\r
23 \r
24 If no initialization is required, then return RETURN_SUCCESS.\r
25 If the serial device was successfuly initialized, then return RETURN_SUCCESS.\r
26 If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.\r
27 \r
28 @retval RETURN_SUCCESS The serial device was initialized.\r
29 @retval RETURN_DEVICE_ERROR The serail device could not be initialized.\r
316172ba 30\r
31**/\r
7f1c3191 32RETURN_STATUS\r
316172ba 33EFIAPI\r
34SerialPortInitialize (\r
35 VOID\r
36 )\r
37{\r
7f1c3191 38 return RETURN_UNSUPPORTED;\r
316172ba 39}\r
40\r
41/**\r
d69107aa 42 Write data from buffer to serial device. \r
43 \r
44 Writes NumberOfBytes data bytes from Buffer to the serial device. \r
45 The number of bytes actually written to the serial device is returned.\r
46 If the return value is less than NumberOfBytes, then the write operation failed.\r
47\r
48 If Buffer is NULL, then ASSERT(). \r
49\r
50 If NumberOfBytes is zero, then return 0.\r
316172ba 51\r
d69107aa 52 @param Buffer Pointer to the data buffer to be written.\r
53 @param NumberOfBytes Number of bytes to written to the serial device.\r
316172ba 54\r
d69107aa 55 @retval 0 NumberOfBytes is 0.\r
56 @retval >0 The number of bytes written to the serial device. \r
57 If this value is less than NumberOfBytes, then the read operation failed.\r
316172ba 58\r
59**/\r
60UINTN\r
61EFIAPI\r
62SerialPortWrite (\r
63 IN UINT8 *Buffer,\r
64 IN UINTN NumberOfBytes\r
65)\r
66{\r
67 return 0;\r
68}\r
69\r
70\r
71/**\r
d69107aa 72 Reads data from a serial device into a buffer.\r
316172ba 73\r
d69107aa 74 @param Buffer Pointer to the data buffer to store the data read from the serial device.\r
75 @param NumberOfBytes Number of bytes to read from the serial device.\r
316172ba 76\r
d69107aa 77 @retval 0 NumberOfBytes is 0.\r
78 @retval >0 The number of bytes read from the serial device. \r
79 If this value is less than NumberOfBytes, then the read operation failed.\r
316172ba 80\r
81**/\r
82UINTN\r
83EFIAPI\r
84SerialPortRead (\r
85 OUT UINT8 *Buffer,\r
86 IN UINTN NumberOfBytes\r
87)\r
88{\r
89 return 0;\r
90}\r
91\r
a2ddd00b 92/**\r
07974e78 93 Polls a serial device to see if there is any data waiting to be read.\r
a2ddd00b 94\r
07974e78 95 Polls aserial device to see if there is any data waiting to be read.\r
96 If there is data waiting to be read from the serial device, then TRUE is returned.\r
97 If there is no data waiting to be read from the serial device, then FALSE is returned.\r
a2ddd00b 98\r
07974e78 99 @retval TRUE Data is waiting to be read from the serial device.\r
100 @retval FALSE There is no data waiting to be read from the serial device.\r
a2ddd00b
LG
101\r
102**/\r
103BOOLEAN\r
104EFIAPI\r
105SerialPortPoll (\r
106 VOID\r
107 )\r
108{\r
6f5cf759 109 return FALSE;\r
110}\r
a2ddd00b 111\r