TianoCore EDK2 master
Loading...
Searching...
No Matches
VirtioSerialPort.c File Reference

Go to the source code of this file.

Functions

STATIC UINT16 PortRx (IN UINT32 PortId)
 
STATIC UINT16 PortTx (IN UINT32 PortId)
 
STATIC EFI_STATUS EFIAPI VirtioSerialIoReset (IN EFI_SERIAL_IO_PROTOCOL *This)
 
STATIC EFI_STATUS EFIAPI VirtioSerialIoSetAttributes (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)
 
STATIC EFI_STATUS EFIAPI VirtioSerialIoSetControl (IN EFI_SERIAL_IO_PROTOCOL *This, IN UINT32 Control)
 
STATIC EFI_STATUS EFIAPI VirtioSerialIoGetControl (IN EFI_SERIAL_IO_PROTOCOL *This, OUT UINT32 *Control)
 
STATIC EFI_STATUS EFIAPI VirtioSerialIoWrite (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
STATIC EFI_STATUS EFIAPI VirtioSerialIoRead (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 
STATIC EFI_STATUS EFIAPI VirtioSerialIoInit (IN OUT VIRTIO_SERIAL_DEV *Dev, IN UINT32 PortId)
 
STATIC VOID EFIAPI VirtioSerialIoUninit (VIRTIO_SERIAL_IO_PROTOCOL *SerialIo)
 
EFI_STATUS EFIAPI VirtioSerialPortAdd (IN OUT VIRTIO_SERIAL_DEV *Dev, IN UINT32 PortId)
 
VOID EFIAPI VirtioSerialPortSetConsole (IN OUT VIRTIO_SERIAL_DEV *Dev, IN UINT32 PortId)
 
VOID EFIAPI VirtioSerialPortSetName (IN OUT VIRTIO_SERIAL_DEV *Dev, IN UINT32 PortId, IN UINT8 *Name)
 
VOID EFIAPI VirtioSerialPortSetDeviceOpen (IN OUT VIRTIO_SERIAL_DEV *Dev, IN UINT32 PortId, IN UINT16 Value)
 
VOID EFIAPI VirtioSerialPortRemove (IN OUT VIRTIO_SERIAL_DEV *Dev, IN UINT32 PortId)
 

Variables

ACPI_HID_DEVICE_PATH mAcpiSerialDevNode
 
UART_DEVICE_PATH mUartDevNode
 

Detailed Description

Driver for virtio-serial devices.

Helper functions to manage virtio serial ports. Console ports will be registered as SerialIo UARTs.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file VirtioSerialPort.c.

Function Documentation

◆ PortRx()

STATIC UINT16 PortRx ( IN UINT32  PortId)

Definition at line 52 of file VirtioSerialPort.c.

◆ PortTx()

STATIC UINT16 PortTx ( IN UINT32  PortId)

Definition at line 67 of file VirtioSerialPort.c.

◆ VirtioSerialIoGetControl()

STATIC EFI_STATUS EFIAPI VirtioSerialIoGetControl ( IN EFI_SERIAL_IO_PROTOCOL This,
OUT UINT32 *  Control 
)

Definition at line 131 of file VirtioSerialPort.c.

◆ VirtioSerialIoInit()

STATIC EFI_STATUS EFIAPI VirtioSerialIoInit ( IN OUT VIRTIO_SERIAL_DEV Dev,
IN UINT32  PortId 
)

Definition at line 253 of file VirtioSerialPort.c.

◆ VirtioSerialIoRead()

STATIC EFI_STATUS EFIAPI VirtioSerialIoRead ( IN EFI_SERIAL_IO_PROTOCOL This,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer 
)

Definition at line 188 of file VirtioSerialPort.c.

◆ VirtioSerialIoReset()

STATIC EFI_STATUS EFIAPI VirtioSerialIoReset ( IN EFI_SERIAL_IO_PROTOCOL This)

Definition at line 83 of file VirtioSerialPort.c.

◆ VirtioSerialIoSetAttributes()

STATIC EFI_STATUS EFIAPI VirtioSerialIoSetAttributes ( 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 
)

Definition at line 94 of file VirtioSerialPort.c.

◆ VirtioSerialIoSetControl()

STATIC EFI_STATUS EFIAPI VirtioSerialIoSetControl ( IN EFI_SERIAL_IO_PROTOCOL This,
IN UINT32  Control 
)

Definition at line 119 of file VirtioSerialPort.c.

◆ VirtioSerialIoUninit()

STATIC VOID EFIAPI VirtioSerialIoUninit ( VIRTIO_SERIAL_IO_PROTOCOL SerialIo)

Definition at line 336 of file VirtioSerialPort.c.

◆ VirtioSerialIoWrite()

STATIC EFI_STATUS EFIAPI VirtioSerialIoWrite ( IN EFI_SERIAL_IO_PROTOCOL This,
IN OUT UINTN BufferSize,
IN VOID *  Buffer 
)

Definition at line 143 of file VirtioSerialPort.c.

◆ VirtioSerialPortAdd()

EFI_STATUS EFIAPI VirtioSerialPortAdd ( IN OUT VIRTIO_SERIAL_DEV Dev,
IN UINT32  PortId 
)

Definition at line 367 of file VirtioSerialPort.c.

◆ VirtioSerialPortRemove()

VOID EFIAPI VirtioSerialPortRemove ( IN OUT VIRTIO_SERIAL_DEV Dev,
IN UINT32  PortId 
)

Definition at line 446 of file VirtioSerialPort.c.

◆ VirtioSerialPortSetConsole()

VOID EFIAPI VirtioSerialPortSetConsole ( IN OUT VIRTIO_SERIAL_DEV Dev,
IN UINT32  PortId 
)

Definition at line 402 of file VirtioSerialPort.c.

◆ VirtioSerialPortSetDeviceOpen()

VOID EFIAPI VirtioSerialPortSetDeviceOpen ( IN OUT VIRTIO_SERIAL_DEV Dev,
IN UINT32  PortId,
IN UINT16  Value 
)

Definition at line 430 of file VirtioSerialPort.c.

◆ VirtioSerialPortSetName()

VOID EFIAPI VirtioSerialPortSetName ( IN OUT VIRTIO_SERIAL_DEV Dev,
IN UINT32  PortId,
IN UINT8 *  Name 
)

Definition at line 416 of file VirtioSerialPort.c.

Variable Documentation

◆ mAcpiSerialDevNode

ACPI_HID_DEVICE_PATH mAcpiSerialDevNode
Initial value:
= {
{
{
(UINT8)(sizeof (ACPI_HID_DEVICE_PATH)),
(UINT8)((sizeof (ACPI_HID_DEVICE_PATH)) >> 8)
},
},
EISA_PNP_ID (0x0501),
0
}
#define ACPI_DEVICE_PATH
Definition: DevicePath.h:190
#define ACPI_DP
Definition: DevicePath.h:195

Definition at line 23 of file VirtioSerialPort.c.

◆ mUartDevNode

UART_DEVICE_PATH mUartDevNode
Initial value:
= {
{
{
(UINT8)(sizeof (UART_DEVICE_PATH)),
(UINT8)((sizeof (UART_DEVICE_PATH)) >> 8)
}
},
0,
115200,
8, 1, 1
}
#define MSG_UART_DP
Definition: DevicePath.h:692
#define MESSAGING_DEVICE_PATH
Definition: DevicePath.h:321

Definition at line 36 of file VirtioSerialPort.c.