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