|
#define | SIO_SERIAL_PORT_NAME L"SIO Serial Port #%d" |
|
#define | PCI_SERIAL_PORT_NAME L"PCI Serial Port #%d" |
|
#define | SERIAL_PORT_NAME_LEN (sizeof (SIO_SERIAL_PORT_NAME) / sizeof (CHAR16) + MAXIMUM_VALUE_CHARACTERS) |
|
#define | TIMEOUT_STALL_INTERVAL 10 |
|
#define | SERIAL_MAX_FIFO_SIZE 17 |
| Actual FIFO size is 16. FIFO based on circular wastes one unit.
|
|
#define | SERIAL_DEV_SIGNATURE SIGNATURE_32 ('s', 'e', 'r', 'd') |
|
#define | SERIAL_DEV_FROM_THIS(a) CR (a, SERIAL_DEV, SerialIo, SERIAL_DEV_SIGNATURE) |
|
#define | SERIAL_PORT_DEFAULT_TIMEOUT 1000000 |
|
#define | SERIAL_PORT_SUPPORT_CONTROL_MASK |
|
#define | SERIAL_PORT_MIN_TIMEOUT 1 |
|
#define | SERIAL_PORT_MAX_TIMEOUT 100000000 |
|
#define | SERIAL_REGISTER_THR 0 |
| WO Transmit Holding Register.
|
|
#define | SERIAL_REGISTER_RBR 0 |
| RO Receive Buffer Register.
|
|
#define | SERIAL_REGISTER_DLL 0 |
| R/W Divisor Latch LSB.
|
|
#define | SERIAL_REGISTER_DLM 1 |
| R/W Divisor Latch MSB.
|
|
#define | SERIAL_REGISTER_IER 1 |
| R/W Interrupt Enable Register.
|
|
#define | SERIAL_REGISTER_IIR 2 |
| RO Interrupt Identification Register.
|
|
#define | SERIAL_REGISTER_FCR 2 |
| WO FIFO Cotrol Register.
|
|
#define | SERIAL_REGISTER_LCR 3 |
| R/W Line Control Register.
|
|
#define | SERIAL_REGISTER_MCR 4 |
| R/W Modem Control Register.
|
|
#define | SERIAL_REGISTER_LSR 5 |
| R/W Line Status Register.
|
|
#define | SERIAL_REGISTER_MSR 6 |
| R/W Modem Status Register.
|
|
#define | SERIAL_REGISTER_SCR 7 |
| R/W Scratch Pad Register.
|
|
#define | READ_RBR(S) SerialReadRegister (S, SERIAL_REGISTER_RBR) |
|
#define | READ_DLL(S) SerialReadRegister (S, SERIAL_REGISTER_DLL) |
|
#define | READ_DLM(S) SerialReadRegister (S, SERIAL_REGISTER_DLM) |
|
#define | READ_IER(S) SerialReadRegister (S, SERIAL_REGISTER_IER) |
|
#define | READ_IIR(S) SerialReadRegister (S, SERIAL_REGISTER_IIR) |
|
#define | READ_LCR(S) SerialReadRegister (S, SERIAL_REGISTER_LCR) |
|
#define | READ_MCR(S) SerialReadRegister (S, SERIAL_REGISTER_MCR) |
|
#define | READ_LSR(S) SerialReadRegister (S, SERIAL_REGISTER_LSR) |
|
#define | READ_MSR(S) SerialReadRegister (S, SERIAL_REGISTER_MSR) |
|
#define | READ_SCR(S) SerialReadRegister (S, SERIAL_REGISTER_SCR) |
|
#define | WRITE_THR(S, D) SerialWriteRegister (S, SERIAL_REGISTER_THR, D) |
|
#define | WRITE_DLL(S, D) SerialWriteRegister (S, SERIAL_REGISTER_DLL, D) |
|
#define | WRITE_DLM(S, D) SerialWriteRegister (S, SERIAL_REGISTER_DLM, D) |
|
#define | WRITE_IER(S, D) SerialWriteRegister (S, SERIAL_REGISTER_IER, D) |
|
#define | WRITE_FCR(S, D) SerialWriteRegister (S, SERIAL_REGISTER_FCR, D) |
|
#define | WRITE_LCR(S, D) SerialWriteRegister (S, SERIAL_REGISTER_LCR, D) |
|
#define | WRITE_MCR(S, D) SerialWriteRegister (S, SERIAL_REGISTER_MCR, D) |
|
#define | WRITE_LSR(S, D) SerialWriteRegister (S, SERIAL_REGISTER_LSR, D) |
|
#define | WRITE_MSR(S, D) SerialWriteRegister (S, SERIAL_REGISTER_MSR, D) |
|
#define | WRITE_SCR(S, D) SerialWriteRegister (S, SERIAL_REGISTER_SCR, D) |
|
|
EFI_STATUS EFIAPI | SerialControllerDriverSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath) |
|
EFI_STATUS EFIAPI | SerialControllerDriverStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath) |
|
EFI_STATUS EFIAPI | SerialControllerDriverStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer) |
|
EFI_STATUS EFIAPI | SerialReset (IN EFI_SERIAL_IO_PROTOCOL *This) |
|
EFI_STATUS EFIAPI | SerialSetAttributes (IN EFI_SERIAL_IO_PROTOCOL *This, IN UINT64 BaudRate, IN UINT32 ReceiveFifoDepth, IN UINT32 Timeout, IN EFI_PARITY_TYPE Parity, IN UINT8 DataBits, IN EFI_STOP_BITS_TYPE StopBits) |
|
EFI_STATUS EFIAPI | SerialSetControl (IN EFI_SERIAL_IO_PROTOCOL *This, IN UINT32 Control) |
|
EFI_STATUS EFIAPI | SerialGetControl (IN EFI_SERIAL_IO_PROTOCOL *This, OUT UINT32 *Control) |
|
EFI_STATUS EFIAPI | SerialWrite (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer) |
|
EFI_STATUS EFIAPI | SerialRead (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer) |
|
BOOLEAN | SerialPresent (IN SERIAL_DEV *SerialDevice) |
|
BOOLEAN | SerialFifoFull (IN SERIAL_DEV_FIFO *Fifo) |
|
BOOLEAN | SerialFifoEmpty (IN SERIAL_DEV_FIFO *Fifo) |
|
EFI_STATUS | SerialFifoAdd (IN SERIAL_DEV_FIFO *Fifo, IN UINT8 Data) |
|
EFI_STATUS | SerialFifoRemove (IN SERIAL_DEV_FIFO *Fifo, OUT UINT8 *Data) |
|
EFI_STATUS | SerialReceiveTransmit (IN SERIAL_DEV *SerialDevice) |
|
UINT8 | SerialReadRegister (IN SERIAL_DEV *SerialDev, IN UINT32 Offset) |
|
VOID | SerialWriteRegister (IN SERIAL_DEV *SerialDev, IN UINT32 Offset, IN UINT8 Data) |
|
EFI_STATUS EFIAPI | SerialComponentNameGetDriverName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName) |
|
EFI_STATUS EFIAPI | SerialComponentNameGetControllerName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName) |
|
VOID | AddName (IN SERIAL_DEV *SerialDevice, IN UINT32 Uid) |
|
BOOLEAN | VerifyUartParameters (IN UINT32 ClockRate, IN UINT64 BaudRate, IN UINT8 DataBits, IN EFI_PARITY_TYPE Parity, IN EFI_STOP_BITS_TYPE StopBits, OUT UINT64 *Divisor, OUT UINT64 *ActualBaudRate) |
|
UART_DEVICE_PATH * | SkipControllerDevicePathNode (EFI_DEVICE_PATH_PROTOCOL *DevicePath, BOOLEAN *ContainsControllerNode, UINT32 *ControllerNumber) |
|
BOOLEAN | IsUartFlowControlDevicePathNode (IN UART_FLOW_CONTROL_DEVICE_PATH *FlowControl) |
|
Header file for PciSioSerial Driver
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Serial.h.
Retrieves a Unicode string that is the user readable name of the controller that is being managed by a driver.
This function retrieves the user readable name of the controller specified by ControllerHandle and ChildHandle in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the controller name is returned in ControllerName, and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.
- Parameters
-
This[in] | A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. |
ControllerHandle[in] | The handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned. |
ChildHandle[in] | The handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to retrieve the name of the bus controller. It will not be NULL for a bus driver that wishes to retrieve the name of a child controller. |
Language[in] | A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format. |
ControllerName[out] | A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by Language from the point of view of the driver specified by This. |
- Return values
-
EFI_SUCCESS | The Unicode string for the user readable name in the language specified by Language for the driver specified by This was returned in DriverName. |
EFI_INVALID_PARAMETER | ControllerHandle is NULL. |
EFI_INVALID_PARAMETER | ChildHandle is not NULL and it is not a valid EFI_HANDLE. |
EFI_INVALID_PARAMETER | Language is NULL. |
EFI_INVALID_PARAMETER | ControllerName is NULL. |
EFI_UNSUPPORTED | The driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle. |
EFI_UNSUPPORTED | The driver specified by This does not support the language specified by Language. |
Definition at line 166 of file ComponentName.c.
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.
- Parameters
-
This[in] | A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance. |
Language[in] | A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format. |
DriverName[out] | A pointer to the Unicode string to return. This Unicode string is the name of the driver specified by This in the language specified by Language. |
- Return values
-
EFI_SUCCESS | The Unicode string for the Driver specified by This and the language specified by Language was returned in DriverName. |
EFI_INVALID_PARAMETER | Language is NULL. |
EFI_INVALID_PARAMETER | DriverName is NULL. |
EFI_UNSUPPORTED | The driver specified by This does not support the language specified by Language. |
Definition at line 81 of file ComponentName.c.
Set new attributes to a serial device.
- Parameters
-
This | Pointer to EFI_SERIAL_IO_PROTOCOL |
BaudRate | The baudrate of the serial device |
ReceiveFifoDepth | The depth of receive FIFO buffer |
Timeout | The request timeout for a single char |
Parity | The type of parity used in serial device |
DataBits | Number of databits used in serial device |
StopBits | Number of stopbits used in serial device |
- Return values
-
EFI_SUCCESS | The new attributes were set |
EFI_INVALID_PARAMETERS | One or more attributes have an unsupported value |
EFI_UNSUPPORTED | Data Bits can not set to 5 or 6 |
EFI_DEVICE_ERROR | The serial device is not functioning correctly (no return) |
Sets the baud rate, receive FIFO depth, transmit/receive time out, parity, data bits, and stop bits on a serial device.
- Parameters
-
This | Protocol instance pointer. |
BaudRate | The requested baud rate. A BaudRate value of 0 will use the the device's default interface speed. |
ReceiveFifoDepth | The requested depth of the FIFO on the receive side of the serial interface. A ReceiveFifoDepth value of 0 will use the device's default FIFO depth. |
Timeout | The requested time out for a single character in microseconds. This timeout applies to both the transmit and receive side of the interface. A Timeout value of 0 will use the device's default time out value. |
Parity | The type of parity to use on this serial device. A Parity value of DefaultParity will use the device's default parity value. |
DataBits | The number of data bits to use on the serial device. A DataBits value of 0 will use the device's default data bit setting. |
StopBits | The number of stop bits to use on this serial device. A StopBits value of DefaultStopBits will use the device's default number of stop bits. |
- Return values
-
EFI_SUCCESS | The device was reset. |
EFI_INVALID_PARAMETER | One or more attributes has an unsupported value. |
EFI_DEVICE_ERROR | The serial device is not functioning correctly. |
Set new attributes to a serial device.
- Parameters
-
[in] | This | Pointer to EFI_SERIAL_IO_PROTOCOL. |
[in] | BaudRate | The baudrate of the serial device. |
[in] | ReceiveFifoDepth | The depth of receive FIFO buffer. |
[in] | Timeout | The request timeout for a single char. |
[in] | Parity | The type of parity used in serial device. |
[in] | DataBits | Number of databits used in serial device. |
[in] | StopBits | Number of stopbits used in serial device. |
- Return values
-
EFI_SUCCESS | The new attributes were set. |
EFI_INVALID_PARAMETER | One or more attributes have an unsupported value. |
EFI_DEVICE_ERROR | The serial device is not functioning correctly (no return). |
Definition at line 282 of file SerialIo.c.