]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/SerialPortLibNull/SerialPortLibNull.c
sync the comments of serialportlib library class with Mde Library Spec.
[mirror_edk2.git] / MdePkg / Library / SerialPortLibNull / SerialPortLibNull.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
48 If Buffer is NULL, then ASSERT().
49
50 If NumberOfBytes is zero, then return 0.
51
52 @param Buffer Pointer to the data buffer to be written.
53 @param NumberOfBytes Number of bytes to written to the serial device.
54
55 @retval 0 NumberOfBytes is 0.
56 @retval >0 The number of bytes written to the serial device.
57 If this value is less than NumberOfBytes, then the read operation failed.
58
59 **/
60 UINTN
61 EFIAPI
62 SerialPortWrite (
63 IN UINT8 *Buffer,
64 IN UINTN NumberOfBytes
65 )
66 {
67 return 0;
68 }
69
70
71 /**
72 Reads data from a serial device into a buffer.
73
74 @param Buffer Pointer to the data buffer to store the data read from the serial device.
75 @param NumberOfBytes Number of bytes to read from the serial device.
76
77 @retval 0 NumberOfBytes is 0.
78 @retval >0 The number of bytes read from the serial device.
79 If this value is less than NumberOfBytes, then the read operation failed.
80
81 **/
82 UINTN
83 EFIAPI
84 SerialPortRead (
85 OUT UINT8 *Buffer,
86 IN UINTN NumberOfBytes
87 )
88 {
89 return 0;
90 }
91
92 /**
93 Poll the serial device to see if there is any data waiting.
94
95 If there is data waiting to be read from the serial port, then return
96 TRUE. If there is no data waiting to be read from the serial port, then
97 return FALSE.
98
99 @retval FALSE There is no data waiting to be read.
100
101 **/
102 BOOLEAN
103 EFIAPI
104 SerialPortPoll (
105 VOID
106 )
107 {
108 return FALSE;
109 }
110