OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
BdsConnect.c File Reference
#include <IndustryStandard/Pci.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/DuetBdsLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DxeServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Protocol/PciIo.h>

Go to the source code of this file.

Functions

VOID EFIAPI BdsLibConnectAll (VOID)
 
VOID BdsLibGenericConnectAll (VOID)
 
EFI_STATUS EFIAPI BdsLibConnectDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect)
 
EFI_STATUS EFIAPI BdsLibConnectAllEfi (VOID)
 
EFI_STATUS EFIAPI BdsLibDisconnectAllEfi (VOID)
 
VOID EFIAPI BdsLibConnectAllDriversToAllControllers (VOID)
 
EFI_STATUS EFIAPI BdsLibConnectUsbDevByShortFormDP (IN UINT8 HostControllerPI, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 

Detailed Description

BDS Lib functions which relate with connect the device

Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file BdsConnect.c.

Function Documentation

◆ BdsLibConnectAll()

VOID EFIAPI BdsLibConnectAll ( VOID )

This function will connect all the system driver to controller first, and then special connect the default console, this make sure all the system controller available and the platform default console connected.

Definition at line 36 of file BdsConnect.c.

◆ BdsLibConnectAllDriversToAllControllers()

VOID EFIAPI BdsLibConnectAllDriversToAllControllers ( VOID )

Connects all drivers to all controllers. This function make sure all the current system driver will manage the corresponding controllers if have. And at the same time, make sure all the system controllers have driver to manage it if have.

Definition at line 315 of file BdsConnect.c.

◆ BdsLibConnectAllEfi()

EFI_STATUS EFIAPI BdsLibConnectAllEfi ( VOID )

This function will connect all current system handles recursively.

gBS->ConnectController() service is invoked for each handle exist in system handler buffer. If the handle is bus type handler, all childrens also will be connected recursively by gBS->ConnectController().

Return values
EFI_SUCCESSAll handles and their child handles have been connected
EFI_STATUSError status returned by of gBS->LocateHandleBuffer().

Definition at line 228 of file BdsConnect.c.

◆ BdsLibConnectDevicePath()

EFI_STATUS EFIAPI BdsLibConnectDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL * DevicePathToConnect)

This function will create all handles associate with every device path node. If the handle associate with one device path node can not be created successfully, then still give chance to do the dispatch, which load the missing drivers if possible.

Parameters
DevicePathToConnectThe device path which will be connected, it can be a multi-instance device path
Return values
EFI_SUCCESSAll handles associate with every device path node have been created
EFI_OUT_OF_RESOURCESThere is no resource to create new handles
EFI_NOT_FOUNDCreate the handle associate with one device path node failed

Definition at line 94 of file BdsConnect.c.

◆ BdsLibConnectUsbDevByShortFormDP()

EFI_STATUS EFIAPI BdsLibConnectUsbDevByShortFormDP ( IN UINT8 HostControllerPI,
IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath )

Connect the specific Usb device which match the short form device path, and whose bus is determined by Host Controller (Uhci or Ehci).

Parameters
HostControllerPIUhci (0x00) or Ehci (0x20) or Both uhci and ehci (0xFF)
RemainingDevicePatha short-form device path that starts with the first element being a USB WWID or a USB Class device path
Returns
EFI_INVALID_PARAMETER RemainingDevicePath is NULL pointer. RemainingDevicePath is not a USB device path. Invalid HostControllerPI type.
EFI_SUCCESS Success to connect USB device
EFI_NOT_FOUND Fail to find handle for USB controller to connect.

Definition at line 355 of file BdsConnect.c.

◆ BdsLibDisconnectAllEfi()

EFI_STATUS EFIAPI BdsLibDisconnectAllEfi ( VOID )

This function will disconnect all current system handles.

gBS->DisconnectController() is invoked for each handle exists in system handle buffer. If handle is a bus type handle, all childrens also are disconnected recursively by gBS->DisconnectController().

Return values
EFI_SUCCESSAll handles have been disconnected
EFI_STATUSError status returned by of gBS->LocateHandleBuffer().

Definition at line 272 of file BdsConnect.c.

◆ BdsLibGenericConnectAll()

VOID BdsLibGenericConnectAll ( VOID )

This function will connect all the system drivers to all controllers first, and then connect all the console devices the system current have. After this we should get all the device work and console available if the system have console device.

Definition at line 65 of file BdsConnect.c.