]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.c
Fix issue when BaseDebugLibSerialPort is combined with BaseSerialPortLibNull. It...
[mirror_edk2.git] / MdePkg / Library / BaseSerialPortLibNull / BaseSerialPortLibNull.c
CommitLineData
316172ba 1/** @file\r
eceb3a4c 2 Null Serial Port library instance with empty functions.\r
316172ba 3\r
2fc59a00 4 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
19388d29 5 This program and the accompanying materials\r
316172ba 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
2fc59a00 8 http://opensource.org/licenses/bsd-license.php.\r
316172ba 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
316172ba 17#include <Library/SerialPortLib.h>\r
18\r
eceb3a4c 19/**\r
d69107aa 20 Initialize the serial device hardware.\r
21 \r
22 If no initialization is required, then return RETURN_SUCCESS.\r
28d3e14f 23 If the serial device was successfully initialized, then return RETURN_SUCCESS.\r
d69107aa 24 If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.\r
25 \r
26 @retval RETURN_SUCCESS The serial device was initialized.\r
28d3e14f 27 @retval RETURN_DEVICE_ERROR The serial device could not be initialized.\r
316172ba 28\r
29**/\r
7f1c3191 30RETURN_STATUS\r
316172ba 31EFIAPI\r
32SerialPortInitialize (\r
33 VOID\r
34 )\r
35{\r
a06638ea 36 return RETURN_SUCCESS;\r
316172ba 37}\r
38\r
39/**\r
d69107aa 40 Write data from buffer to serial device. \r
41 \r
42 Writes NumberOfBytes data bytes from Buffer to the serial device. \r
43 The number of bytes actually written to the serial device is returned.\r
44 If the return value is less than NumberOfBytes, then the write operation failed.\r
d69107aa 45 If Buffer is NULL, then ASSERT(). \r
d69107aa 46 If NumberOfBytes is zero, then return 0.\r
316172ba 47\r
2fc59a00 48 @param Buffer The pointer to the data buffer to be written.\r
49 @param NumberOfBytes The number of bytes to written to the serial device.\r
316172ba 50\r
d69107aa 51 @retval 0 NumberOfBytes is 0.\r
52 @retval >0 The number of bytes written to the serial device. \r
53 If this value is less than NumberOfBytes, then the read operation failed.\r
316172ba 54\r
55**/\r
56UINTN\r
57EFIAPI\r
58SerialPortWrite (\r
59 IN UINT8 *Buffer,\r
60 IN UINTN NumberOfBytes\r
61)\r
62{\r
63 return 0;\r
64}\r
65\r
66\r
67/**\r
71871514 68 Read data from serial device and save the datas in buffer.\r
69 \r
70 Reads NumberOfBytes data bytes from a serial device into the buffer\r
71 specified by Buffer. The number of bytes actually read is returned. \r
72 If the return value is less than NumberOfBytes, then the rest operation failed.\r
73 If Buffer is NULL, then ASSERT(). \r
74 If NumberOfBytes is zero, then return 0.\r
316172ba 75\r
2fc59a00 76 @param Buffer The pointer to the data buffer to store the data read from the serial device.\r
77 @param NumberOfBytes The number of bytes which will be read.\r
316172ba 78\r
2fc59a00 79 @retval 0 Read data failed; No data is to be read.\r
80 @retval >0 The actual number of bytes read from serial device.\r
316172ba 81\r
82**/\r
83UINTN\r
84EFIAPI\r
85SerialPortRead (\r
86 OUT UINT8 *Buffer,\r
87 IN UINTN NumberOfBytes\r
88)\r
89{\r
90 return 0;\r
91}\r
92\r
a2ddd00b 93/**\r
07974e78 94 Polls a serial device to see if there is any data waiting to be read.\r
a2ddd00b 95\r
28d3e14f 96 Polls a serial device to see if there is any data waiting to be read.\r
07974e78 97 If there is data waiting to be read from the serial device, then TRUE is returned.\r
98 If there is no data waiting to be read from the serial device, then FALSE is returned.\r
a2ddd00b 99\r
07974e78 100 @retval TRUE Data is waiting to be read from the serial device.\r
101 @retval FALSE There is no data waiting to be read from the serial device.\r
a2ddd00b
LG
102\r
103**/\r
104BOOLEAN\r
105EFIAPI\r
106SerialPortPoll (\r
107 VOID\r
108 )\r
109{\r
6f5cf759 110 return FALSE;\r
111}\r
a2ddd00b 112\r