TianoCore EDK2 master
Loading...
Searching...
No Matches
Serial.c File Reference
#include "Serial.h"

Go to the source code of this file.

Functions

BOOLEAN IsUartFlowControlDevicePathNode (IN UART_FLOW_CONTROL_DEVICE_PATH *FlowControl)
 
EFI_STATUS EFIAPI InitializePciSioSerial (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS IsSioSerialController (EFI_HANDLE Controller)
 
EFI_STATUS IsPciSerialController (EFI_HANDLE Controller)
 
EFI_STATUS EFIAPI SerialControllerDriverSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS CreateSerialDevice (IN EFI_HANDLE Controller, IN UART_DEVICE_PATH *Uart, IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, IN BOOLEAN CreateControllerNode, IN UINT32 Instance, IN PARENT_IO_PROTOCOL_PTR ParentIo, IN PCI_SERIAL_PARAMETER *PciSerialParameter OPTIONAL, IN PCI_DEVICE_INFO *PciDeviceInfo OPTIONAL)
 
SERIAL_DEV ** GetChildSerialDevices (IN EFI_HANDLE Controller, IN EFI_GUID *IoProtocolGuid, OUT UINTN *Count)
 
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)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gSerialControllerDriver
 
CONTROLLER_DEVICE_PATH mControllerDevicePathTemplate
 
SERIAL_DEV gSerialDevTemplate
 

Detailed Description

Serial driver for PCI or SIO UARTS.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Serial.c.

Function Documentation

◆ CreateSerialDevice()

EFI_STATUS CreateSerialDevice ( IN EFI_HANDLE  Controller,
IN UART_DEVICE_PATH Uart,
IN EFI_DEVICE_PATH_PROTOCOL ParentDevicePath,
IN BOOLEAN  CreateControllerNode,
IN UINT32  Instance,
IN PARENT_IO_PROTOCOL_PTR  ParentIo,
IN PCI_SERIAL_PARAMETER *PciSerialParameter  OPTIONAL,
IN PCI_DEVICE_INFO *PciDeviceInfo  OPTIONAL 
)

Create the child serial device instance.

Parameters
ControllerThe parent controller handle.
UartPointer to the UART device path node in RemainingDevicePath, or NULL if RemainingDevicePath is NULL.
ParentDevicePathPointer to the parent device path.
CreateControllerNodeTRUE to create the controller node.
InstanceInstance number of the serial device. The value will be set to the controller node if CreateControllerNode is TRUE.
ParentIoA union type pointer to either Sio or PciIo.
PciSerialParameterThe PCI serial parameter to be used by current serial device. NULL for SIO serial device.
PciDeviceInfoThe PCI device info for the current serial device. NULL for SIO serial device.
Return values
EFI_SUCCESSThe serial device was created successfully.
othersThe serial device wasn't created.

Definition at line 425 of file Serial.c.

◆ GetChildSerialDevices()

SERIAL_DEV ** GetChildSerialDevices ( IN EFI_HANDLE  Controller,
IN EFI_GUID IoProtocolGuid,
OUT UINTN Count 
)

Returns an array of pointers containing all the child serial device pointers.

Parameters
ControllerThe parent controller handle.
IoProtocolGuidThe protocol GUID, either equals to gEfiSioProtocolGuid or equals to gEfiPciIoProtocolGuid.
CountCount of the serial devices.
Returns
An array of pointers containing all the child serial device pointers.

Definition at line 731 of file Serial.c.

◆ InitializePciSioSerial()

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

The user Entry Point for module PciSioSerial. The user code starts with this function.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
otherSome error occurs when executing this entry point.

Definition at line 120 of file Serial.c.

◆ IsPciSerialController()

EFI_STATUS IsPciSerialController ( EFI_HANDLE  Controller)

Return whether the controller is a PCI serial controller.

Parameters
ControllerThe controller handle.
Return values
EFI_SUCCESSThe controller is a PCI serial controller.
othersThe controller is not a PCI serial controller.

Definition at line 248 of file Serial.c.

◆ IsSioSerialController()

EFI_STATUS IsSioSerialController ( EFI_HANDLE  Controller)

Return whether the controller is a SIO serial controller.

Parameters
ControllerThe controller handle.
Return values
EFI_SUCCESSThe controller is a SIO serial controller.
othersThe controller is not a SIO serial controller.

Definition at line 165 of file Serial.c.

◆ IsUartFlowControlDevicePathNode()

BOOLEAN IsUartFlowControlDevicePathNode ( IN UART_FLOW_CONTROL_DEVICE_PATH FlowControl)

Check the device path node whether it's the Flow Control node or not.

Parameters
[in]FlowControlThe device path node to be checked.
Return values
TRUEIt's the Flow Control node.
FALSEIt's not.

Definition at line 97 of file Serial.c.

◆ SerialControllerDriverStart()

EFI_STATUS EFIAPI SerialControllerDriverStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Start to management the controller passed in

Parameters
ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
ControllerThe handle of the controller to test.
RemainingDevicePathA pointer to the remaining portion of a device path.
Returns
EFI_SUCCESS Driver is started successfully

Definition at line 806 of file Serial.c.

◆ SerialControllerDriverStop()

EFI_STATUS EFIAPI SerialControllerDriverStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Disconnect this driver with the controller, uninstall related protocol instance

Parameters
ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
ControllerThe handle of the controller to test.
NumberOfChildrenNumber of child device.
ChildHandleBufferA pointer to the remaining portion of a device path.
Return values
EFI_SUCCESSOperation successfully
EFI_DEVICE_ERRORCannot stop the driver successfully

Definition at line 1164 of file Serial.c.

◆ SerialControllerDriverSupported()

EFI_STATUS EFIAPI SerialControllerDriverSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Check to see if this driver supports the given controller

Parameters
ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
ControllerThe handle of the controller to test.
RemainingDevicePathA pointer to the remaining portion of a device path.
Returns
EFI_SUCCESS This driver can support the given controller

Definition at line 351 of file Serial.c.

Variable Documentation

◆ gSerialControllerDriver

EFI_DRIVER_BINDING_PROTOCOL gSerialControllerDriver
Initial value:
= {
0xa,
}
#define NULL
Definition: Base.h:319
EFI_STATUS EFIAPI SerialControllerDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Serial.c:806
EFI_STATUS EFIAPI SerialControllerDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition: Serial.c:1164
EFI_STATUS EFIAPI SerialControllerDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Serial.c:351

Definition at line 15 of file Serial.c.

◆ gSerialDevTemplate

SERIAL_DEV gSerialDevTemplate

Definition at line 36 of file Serial.c.

◆ mControllerDevicePathTemplate

CONTROLLER_DEVICE_PATH mControllerDevicePathTemplate
Initial value:
= {
{
{
(UINT8)(sizeof (CONTROLLER_DEVICE_PATH)),
(UINT8)((sizeof (CONTROLLER_DEVICE_PATH)) >> 8)
}
},
0
}
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_CONTROLLER_DP
Definition: DevicePath.h:154

Definition at line 24 of file Serial.c.