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

Go to the source code of this file.

Functions

VOID EFIAPI LogDevicePath (UINT32 Level, const CHAR8 *Func, CHAR16 *Note, EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
EFI_STATUS EFIAPI VirtioSerialTxControl (IN OUT VIRTIO_SERIAL_DEV *Dev, IN UINT32 Id, IN UINT16 Event, IN UINT16 Value)
 
STATIC VOID EFIAPI VirtioSerialRxControl (IN OUT VIRTIO_SERIAL_DEV *Dev)
 
STATIC VOID EFIAPI VirtioSerialTimer (IN EFI_EVENT Event, IN VOID *Context)
 
STATIC VOID EFIAPI VirtioSerialUninitAllRings (IN OUT VIRTIO_SERIAL_DEV *Dev)
 
STATIC EFI_STATUS EFIAPI VirtioSerialInit (IN OUT VIRTIO_SERIAL_DEV *Dev)
 
STATIC VOID EFIAPI VirtioSerialUninit (IN OUT VIRTIO_SERIAL_DEV *Dev)
 
STATIC VOID EFIAPI VirtioSerialExitBoot (IN EFI_EVENT Event, IN VOID *Context)
 
STATIC VIRTIO_SERIAL_DEVVirtioSerialFind (EFI_HANDLE DeviceHandle)
 
STATIC EFI_STATUS EFIAPI VirtioSerialDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
STATIC EFI_STATUS EFIAPI VirtioSerialDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
STATIC EFI_STATUS EFIAPI VirtioSerialDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
STATIC EFI_STATUS EFIAPI VirtioSerialGetDriverName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
 
STATIC EFI_STATUS EFIAPI VirtioSerialGetDeviceName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_HANDLE ChildHandle, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
 
EFI_STATUS EFIAPI VirtioSerialEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC LIST_ENTRY mVirtioSerialList
 
STATIC CONST CHAR8 * EventNames []
 
STATIC EFI_DRIVER_BINDING_PROTOCOL gDriverBinding
 
STATIC EFI_UNICODE_STRING_TABLE mDriverNameTable []
 
STATIC EFI_UNICODE_STRING_TABLE mDeviceNameTable []
 
STATIC EFI_UNICODE_STRING_TABLE mPortNameTable []
 
STATIC EFI_COMPONENT_NAME_PROTOCOL gComponentName
 
STATIC EFI_COMPONENT_NAME2_PROTOCOL gComponentName2
 

Detailed Description

Driver for virtio-serial devices.

The virtio serial device also known as virtio console device because initially it had only support for a single tty, intended to be used as console. Support for multiple streams and named data ports has been added later on.

https://docs.oasis-open.org/virtio/virtio/v1.2/cs01/virtio-v1.2-cs01.html#x1-2900003

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

Definition in file VirtioSerial.c.

Function Documentation

◆ LogDevicePath()

VOID EFIAPI LogDevicePath ( UINT32  Level,
const CHAR8 *  Func,
CHAR16 *  Note,
EFI_DEVICE_PATH_PROTOCOL DevicePath 
)

Definition at line 41 of file VirtioSerial.c.

◆ VirtioSerialDriverBindingStart()

STATIC EFI_STATUS EFIAPI VirtioSerialDriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  DeviceHandle,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Definition at line 529 of file VirtioSerial.c.

◆ VirtioSerialDriverBindingStop()

STATIC EFI_STATUS EFIAPI VirtioSerialDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  DeviceHandle,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Definition at line 614 of file VirtioSerial.c.

◆ VirtioSerialDriverBindingSupported()

STATIC EFI_STATUS EFIAPI VirtioSerialDriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  DeviceHandle,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Definition at line 481 of file VirtioSerial.c.

◆ VirtioSerialEntryPoint()

EFI_STATUS EFIAPI VirtioSerialEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Definition at line 792 of file VirtioSerial.c.

◆ VirtioSerialExitBoot()

STATIC VOID EFIAPI VirtioSerialExitBoot ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Definition at line 426 of file VirtioSerial.c.

◆ VirtioSerialFind()

STATIC VIRTIO_SERIAL_DEV * VirtioSerialFind ( EFI_HANDLE  DeviceHandle)

Definition at line 447 of file VirtioSerial.c.

◆ VirtioSerialGetDeviceName()

STATIC EFI_STATUS EFIAPI VirtioSerialGetDeviceName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN EFI_HANDLE  DeviceHandle,
IN EFI_HANDLE  ChildHandle,
IN CHAR8 *  Language,
OUT CHAR16 **  ControllerName 
)

Definition at line 731 of file VirtioSerial.c.

◆ VirtioSerialGetDriverName()

STATIC EFI_STATUS EFIAPI VirtioSerialGetDriverName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN CHAR8 *  Language,
OUT CHAR16 **  DriverName 
)

Definition at line 713 of file VirtioSerial.c.

◆ VirtioSerialInit()

STATIC EFI_STATUS EFIAPI VirtioSerialInit ( IN OUT VIRTIO_SERIAL_DEV Dev)

Definition at line 221 of file VirtioSerial.c.

◆ VirtioSerialRxControl()

STATIC VOID EFIAPI VirtioSerialRxControl ( IN OUT VIRTIO_SERIAL_DEV Dev)

Definition at line 92 of file VirtioSerial.c.

◆ VirtioSerialTimer()

STATIC VOID EFIAPI VirtioSerialTimer ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Definition at line 194 of file VirtioSerial.c.

◆ VirtioSerialTxControl()

EFI_STATUS EFIAPI VirtioSerialTxControl ( IN OUT VIRTIO_SERIAL_DEV Dev,
IN UINT32  Id,
IN UINT16  Event,
IN UINT16  Value 
)

Definition at line 62 of file VirtioSerial.c.

◆ VirtioSerialUninit()

STATIC VOID EFIAPI VirtioSerialUninit ( IN OUT VIRTIO_SERIAL_DEV Dev)

Definition at line 397 of file VirtioSerial.c.

◆ VirtioSerialUninitAllRings()

STATIC VOID EFIAPI VirtioSerialUninitAllRings ( IN OUT VIRTIO_SERIAL_DEV Dev)

Definition at line 207 of file VirtioSerial.c.

Variable Documentation

◆ EventNames

STATIC CONST CHAR8* EventNames[]
Initial value:
= {
[VIRTIO_SERIAL_DEVICE_READY] = "device-ready",
[VIRTIO_SERIAL_DEVICE_ADD] = "device-add",
[VIRTIO_SERIAL_DEVICE_REMOVE] = "device-remove",
[VIRTIO_SERIAL_PORT_READY] = "port-ready",
[VIRTIO_SERIAL_CONSOLE_PORT] = "console-port",
[VIRTIO_SERIAL_RESIZE] = "resize",
[VIRTIO_SERIAL_PORT_OPEN] = "port-open",
[VIRTIO_SERIAL_PORT_NAME] = "port-name",
}

Definition at line 28 of file VirtioSerial.c.

◆ gComponentName

Initial value:
= {
&VirtioSerialGetDriverName,
&VirtioSerialGetDeviceName,
"eng"
}

Definition at line 708 of file VirtioSerial.c.

◆ gComponentName2

Initial value:
= {
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME)&VirtioSerialGetDriverName,
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)&VirtioSerialGetDeviceName,
"en"
}
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_DRIVER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)

Definition at line 781 of file VirtioSerial.c.

◆ gDriverBinding

Initial value:
= {
&VirtioSerialDriverBindingSupported,
&VirtioSerialDriverBindingStart,
&VirtioSerialDriverBindingStop,
0x10,
NULL,
}
#define NULL
Definition: Base.h:319

Definition at line 671 of file VirtioSerial.c.

◆ mDeviceNameTable

STATIC EFI_UNICODE_STRING_TABLE mDeviceNameTable[]
Initial value:
= {
{ "eng;en", L"Virtio Serial Device" },
{ NULL, NULL }
}

Definition at line 696 of file VirtioSerial.c.

◆ mDriverNameTable

STATIC EFI_UNICODE_STRING_TABLE mDriverNameTable[]
Initial value:
= {
{ "eng;en", L"Virtio Serial Driver" },
{ NULL, NULL }
}

Definition at line 690 of file VirtioSerial.c.

◆ mPortNameTable

STATIC EFI_UNICODE_STRING_TABLE mPortNameTable[]
Initial value:
= {
{ "eng;en", L"Virtio Serial Port" },
{ NULL, NULL }
}

Definition at line 702 of file VirtioSerial.c.

◆ mVirtioSerialList

STATIC LIST_ENTRY mVirtioSerialList

Definition at line 26 of file VirtioSerial.c.