summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@linaro.org>2017-11-30 01:28:22 +0800
committerStar Zeng <star.zeng@intel.com>2017-11-30 09:11:49 +0800
commit13d378fc82d4c10eff48bec383cd679cec6c4fdb (patch)
tree9b97903988751b73daa75b0b7471346ad77d6e4c /MdePkg
parentb462f25a21e17e3daf3cec880d3de2a6193af8a2 (diff)
downloadedk2-13d378fc82d4c10eff48bec383cd679cec6c4fdb.zip
edk2-13d378fc82d4c10eff48bec383cd679cec6c4fdb.tar.gz
edk2-13d378fc82d4c10eff48bec383cd679cec6c4fdb.tar.bz2
MdeModulePkg/SerialDxe: Fix return valued in SerialSetAttributes
SerialSetAttributes is meant to match the behavior of the function EFI_SERIAL_IO_PROTOCOL.SetAttributes() in the UEFI spec (v2.7). This means the function can only return: - EFI_SUCCESS - EFI_INVALID_PARAMETER - EFI_DEVICE_ERROR However the function SerialPortSetAttributes may also validly return EFI_UNSUPPORTED. For instance this is the case of the Xen Console driver. EFI_UNSUPPORTED could be also interpreted as "One or more of the attributes has an unsupported value". So return EFI_INVALID_PARAMETER in that case. Lastly, to prevent another return slipping in the future, all the errors but EFI_INVALID_PARAMETER and EFI_UNSUPPORTED will return EFI_DEVICE_ERROR. Contributed-under: Tianocore Contribution Agreement 1.1 Signed-off-by: Julien Grall <julien.grall@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Protocol/SerialIo.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/MdePkg/Include/Protocol/SerialIo.h b/MdePkg/Include/Protocol/SerialIo.h
index 84cb343..1263dc4 100644
--- a/MdePkg/Include/Protocol/SerialIo.h
+++ b/MdePkg/Include/Protocol/SerialIo.h
@@ -125,8 +125,9 @@ EFI_STATUS
value of DefaultStopBits will use the device's default number of
stop bits.
- @retval EFI_SUCCESS The device was reset.
- @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
+ @retval EFI_SUCCESS The device was reset.
+ @retval EFI_INVALID_PARAMETER One or more attributes has an unsupported value.
+ @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
**/
typedef