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

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI Tcp4GetSubnetInfo (IN EFI_HANDLE ImageHandle, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *Instance)
 
EFI_STATUS EFIAPI Tcp6GetSubnetInfo (IN EFI_HANDLE ImageHandle, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *Instance)
 
EFI_STATUS CreateRestExInstance (IN EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE *Instance, IN EFI_REDFISH_DISCOVERED_TOKEN *Token)
 
EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCEGetInstanceByOwner (IN EFI_HANDLE ImageHandle, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *TargetNetworkInterface, IN EFI_REDFISH_DISCOVER_FLAG DiscoverFlags)
 
EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNALGetTargetNetworkInterfaceInternal (IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface)
 
EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNALGetTargetNetworkInterfaceInternalByController (IN EFI_HANDLE ControllerHandle)
 
EFI_STATUS ValidateTargetNetworkInterface (IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface, IN EFI_REDFISH_DISCOVER_FLAG Flags)
 
UINTN NumberOfNetworkInterface (VOID)
 
BOOLEAN CheckIsIpVersion6 (IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *ThisNetworkInterface)
 
STATIC BOOLEAN FilterProtocol (IN UINT32 NetworkProtocolType, IN UINT8 IpType)
 
EFI_STATUS DiscoverRedfishHostInterface (IN EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE *Instance)
 
STATIC VOID FreeInformationData (IN EFI_REDFISH_DISCOVERED_INFORMATION *Information)
 
STATIC VOID InitInformationData (IN EFI_REDFISH_DISCOVERED_INFORMATION *Information, IN BOOLEAN IsIpv6, IN UINTN *RedfishVersion OPTIONAL, IN CONST CHAR8 *RedfishLocation OPTIONAL, IN CONST CHAR8 *Uuid OPTIONAL, IN CONST CHAR8 *Os OPTIONAL, IN CONST CHAR8 *OsVer OPTIONAL, IN CONST CHAR8 *Product OPTIONAL, IN CONST CHAR8 *ProductVer OPTIONAL)
 
EFI_STATUS AddAndSignalNewRedfishService (IN EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE *Instance, IN UINTN *RedfishVersion OPTIONAL, IN CHAR8 *RedfishLocation OPTIONAL, IN CHAR8 *Uuid OPTIONAL, IN CHAR8 *Os OPTIONAL, IN CHAR8 *OsVer OPTIONAL, IN CHAR8 *Product OPTIONAL, IN CHAR8 *ProductVer OPTIONAL, IN BOOLEAN UseHttps)
 
EFI_STATUS NetworkInterfaceGetSubnetInfo (IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *Instance, IN EFI_HANDLE ImageHandle)
 
EFI_STATUS EFIAPI RedfishServiceGetNetworkInterface (IN EFI_REDFISH_DISCOVER_PROTOCOL *This, IN EFI_HANDLE ImageHandle, OUT UINTN *NumberOfNetworkIntfs, OUT EFI_REDFISH_DISCOVER_NETWORK_INTERFACE **NetworkIntfInstances)
 
EFI_STATUS EFIAPI RedfishServiceAcquireService (IN EFI_REDFISH_DISCOVER_PROTOCOL *This, IN EFI_HANDLE ImageHandle, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface, IN EFI_REDFISH_DISCOVER_FLAG Flags, IN EFI_REDFISH_DISCOVERED_TOKEN *Token)
 
EFI_STATUS EFIAPI RedfishServiceAbortAcquire (IN EFI_REDFISH_DISCOVER_PROTOCOL *This, IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface OPTIONAL)
 
EFI_STATUS EFIAPI RedfishServiceReleaseService (IN EFI_REDFISH_DISCOVER_PROTOCOL *This, IN EFI_REDFISH_DISCOVERED_LIST *InstanceList)
 
EFI_STATUS CreateRedfishDiscoverNetworkInterface (IN EFI_HANDLE ControllerHandle, IN UINT32 NetworkProtocolType, OUT BOOLEAN *IsNewInstance, OUT EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL **NetworkInterface)
 
EFI_STATUS DestroyRedfishNetworkInterface (IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *ThisNetworkInterface)
 
EFI_STATUS TestForRequiredProtocols (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle)
 
EFI_STATUS BuildupNetworkInterface (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle)
 
EFI_STATUS CloseProtocolService (IN EFI_DRIVER_BINDING_PROTOCOL *ThisBindingProtocol, IN EFI_HANDLE ControllerHandle, IN REDFISH_DISCOVER_REQUIRED_PROTOCOL *ThisRequiredProtocol, IN EFI_HANDLE DriverAgentHandle, IN EFI_HANDLE DriverControllerHandle)
 
EFI_STATUS StopServiceOnNetworkInterface (IN EFI_DRIVER_BINDING_PROTOCOL *ThisBindingProtocol, IN EFI_HANDLE ControllerHandle)
 
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
 
EFI_STATUS EFIAPI RedfishDiscoverEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI RedfishDiscoverUnload (IN EFI_HANDLE ImageHandle)
 

Variables

LIST_ENTRY mRedfishDiscoverList
 
LIST_ENTRY mRedfishInstanceList
 
EFI_SMBIOS_PROTOCOLmSmbios = NULL
 
UINTN mNumNetworkInterface = 0
 
UINTN mNumRestExInstance = 0
 
LIST_ENTRY mEfiRedfishDiscoverNetworkInterface
 
LIST_ENTRY mEfiRedfishDiscoverRestExInstance
 
EFI_GUID mRedfishDiscoverTcp4InstanceGuid = EFI_REDFISH_DISCOVER_TCP4_INSTANCE_GUID
 
EFI_GUID mRedfishDiscoverTcp6InstanceGuid = EFI_REDFISH_DISCOVER_TCP6_INSTANCE_GUID
 
EFI_GUID mRedfishDiscoverRestExInstanceGuid = EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_GUID
 
EFI_DRIVER_BINDING_PROTOCOL gRedfishDiscoverDriverBinding
 

Detailed Description

The implementation of EFI Redfish Discover Protocol.

(C) Copyright 2021 Hewlett Packard Enterprise Development LP
Copyright (c) 2022, AMD Incorporated. All rights reserved. Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
Copyright (c) 2023, Mike Maslenkin mike..nosp@m.masl.nosp@m.enkin.nosp@m.@gma.nosp@m.il.co.nosp@m.m

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

Definition in file RedfishDiscoverDxe.c.

Function Documentation

◆ AddAndSignalNewRedfishService()

EFI_STATUS AddAndSignalNewRedfishService ( IN EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE Instance,
IN UINTN *RedfishVersion  OPTIONAL,
IN CHAR8 *RedfishLocation  OPTIONAL,
IN CHAR8 *Uuid  OPTIONAL,
IN CHAR8 *Os  OPTIONAL,
IN CHAR8 *OsVer  OPTIONAL,
IN CHAR8 *Product  OPTIONAL,
IN CHAR8 *ProductVer  OPTIONAL,
IN BOOLEAN  UseHttps 
)

The function adds a new found Redfish service to internal list and notify client.

Parameters
[in]InstanceEFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE.
[in]RedfishVersionRedfish version.
[in]RedfishLocationRedfish location.
[in]UuidService UUID string.
[in]OsOS string.
[in]OsVerOS version string.
[in]ProductProduct string.
[in]ProductVerProduct version string.
[in]UseHttpsRedfish service requires secured connection.
Return values
EFI_SUCCESSRedfish service is added to list successfully.

Definition at line 925 of file RedfishDiscoverDxe.c.

◆ BuildupNetworkInterface()

EFI_STATUS BuildupNetworkInterface ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle 
)

Build up network interface and create corresponding service through the given controller handle.

Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to test. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
Return values
EFI_SUCCESSOne of required protocol is found.
EFI_UNSUPPORTEDNone of required protocol is found.
EFI_UNSUPPORTEDFailed to build up network interface.

Definition at line 1834 of file RedfishDiscoverDxe.c.

◆ CheckIsIpVersion6()

BOOLEAN CheckIsIpVersion6 ( IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL ThisNetworkInterface)

This function checks the IP version supported on this network interface.

Parameters
[in]ThisNetworkInterfaceEFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL
Return values
TRUEIs IPv6, otherwise IPv4.

Definition at line 480 of file RedfishDiscoverDxe.c.

◆ CloseProtocolService()

EFI_STATUS CloseProtocolService ( IN EFI_DRIVER_BINDING_PROTOCOL ThisBindingProtocol,
IN EFI_HANDLE  ControllerHandle,
IN REDFISH_DISCOVER_REQUIRED_PROTOCOL ThisRequiredProtocol,
IN EFI_HANDLE  DriverAgentHandle,
IN EFI_HANDLE  DriverControllerHandle 
)

Close the protocol opened for Redfish discovery. This function also destroy the network services.

Parameters
[in]ThisBindingProtocolA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to test. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
[in]ThisRequiredProtocolPointer to the instance of REDFISH_DISCOVER_REQUIRED_PROTOCOL.
[in]DriverAgentHandleDriver agent handle which used to open protocol earlier.
[in]DriverControllerHandleDriver controller handle which used to open protocol earlier.
Return values
EFI_SUCCESSProtocol is closed successfully.
OthersProtocol is closed unsuccessfully.

Definition at line 2025 of file RedfishDiscoverDxe.c.

◆ CreateRedfishDiscoverNetworkInterface()

EFI_STATUS CreateRedfishDiscoverNetworkInterface ( IN EFI_HANDLE  ControllerHandle,
IN UINT32  NetworkProtocolType,
OUT BOOLEAN *  IsNewInstance,
OUT EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL **  NetworkInterface 
)

This function create an EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL for the given network interface.

Parameters
[in]ControllerHandleMAC address of this network interface.
[in]NetworkProtocolTypeNetwork protocol type.
[out]IsNewInstanceBOOLEAN means new instance or not.
[out]NetworkInterfacePointer to to EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL.
Return values
EFI_STATUS

Definition at line 1682 of file RedfishDiscoverDxe.c.

◆ CreateRestExInstance()

EFI_STATUS CreateRestExInstance ( IN EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE Instance,
IN EFI_REDFISH_DISCOVERED_TOKEN Token 
)

This function creates REST EX instance for the found Resfish service. by known owner handle.

Parameters
[in]InstanceEFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE
[in]TokenClient token.
Return values
NULLInstance not found.
EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCEThe instance owned by this owner.

Definition at line 83 of file RedfishDiscoverDxe.c.

◆ DestroyRedfishNetworkInterface()

EFI_STATUS DestroyRedfishNetworkInterface ( IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL ThisNetworkInterface)

This function destroy network interface

Parameters
[in]ThisNetworkInterfaceEFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instance.
Return values
EFI_STATUS

Definition at line 1750 of file RedfishDiscoverDxe.c.

◆ DiscoverRedfishHostInterface()

EFI_STATUS DiscoverRedfishHostInterface ( IN EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE Instance)

This function discover Redfish service through SMBIOS host interface.

Parameters
[in]InstanceEFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE
Return values
EFI_SUCCESSRedfish service is discovered through SMBIOS Host interface.
OthersFail to discover Redfish service through SMBIOS host interface

Definition at line 525 of file RedfishDiscoverDxe.c.

◆ FilterProtocol()

STATIC BOOLEAN FilterProtocol ( IN UINT32  NetworkProtocolType,
IN UINT8  IpType 
)

Check if Network Protocol Type matches with SMBIOS Type 42 IP Address Type.

Parameters
[in]NetworkProtocolTypeThe Network Protocol Type to check with.
[in]IpTypeThe Host IP Address Type from SMBIOS Type 42.

Definition at line 499 of file RedfishDiscoverDxe.c.

◆ FreeInformationData()

STATIC VOID FreeInformationData ( IN EFI_REDFISH_DISCOVERED_INFORMATION Information)

The function releases particular strings into the structure instance.

Parameters
[in]InformationEFI_REDFISH_DISCOVERED_INFORMATION

Definition at line 723 of file RedfishDiscoverDxe.c.

◆ GetInstanceByOwner()

EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE * GetInstanceByOwner ( IN EFI_HANDLE  ImageHandle,
IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL TargetNetworkInterface,
IN EFI_REDFISH_DISCOVER_FLAG  DiscoverFlags 
)

This function gets EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE by known owner handle.

Parameters
[in]ImageHandleImage handle owns EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE.
[in]TargetNetworkInterfaceTarget network interface used by this EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE.
[in]DiscoverFlagsEFI_REDFISH_DISCOVER_FLAG
Return values
NULLInstance not found.
EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCEThe instance owned by this owner.

Definition at line 114 of file RedfishDiscoverDxe.c.

◆ GetTargetNetworkInterfaceInternal()

EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL * GetTargetNetworkInterfaceInternal ( IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE TargetNetworkInterface)

This function searches EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instance with the given EFI_REDFISH_DISCOVER_NETWORK_INTERFACE.

Parameters
[in]TargetNetworkInterfaceEFI_REDFISH_DISCOVER_NETWORK_INTERFACE. NULL for all EFI_REDFISH_DISCOVER_NETWORK_INTERFACEs.
Return values
Non-NULLEFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL is returned.
NULLNon of EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instance is returned.

Definition at line 320 of file RedfishDiscoverDxe.c.

◆ GetTargetNetworkInterfaceInternalByController()

EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL * GetTargetNetworkInterfaceInternalByController ( IN EFI_HANDLE  ControllerHandle)

This function searches EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instance with the given Controller handle.

Parameters
[in]ControllerHandleThe controller handle associated with network interface.
Return values
Non-NULLEFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL is returned.
NULLNon of EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instance is returned.

Definition at line 359 of file RedfishDiscoverDxe.c.

◆ InitInformationData()

STATIC VOID InitInformationData ( IN EFI_REDFISH_DISCOVERED_INFORMATION Information,
IN BOOLEAN  IsIpv6,
IN UINTN *RedfishVersion  OPTIONAL,
IN CONST CHAR8 *RedfishLocation  OPTIONAL,
IN CONST CHAR8 *Uuid  OPTIONAL,
IN CONST CHAR8 *Os  OPTIONAL,
IN CONST CHAR8 *OsVer  OPTIONAL,
IN CONST CHAR8 *Product  OPTIONAL,
IN CONST CHAR8 *ProductVer  OPTIONAL 
)

The function initializes particular strings into the structure instance.

Parameters
[in]InformationEFI_REDFISH_DISCOVERED_INFORMATION
[in]IsIpv6Flag indicating IP version 6 protocol is used
[in]RedfishVersionRedfish version.
[in]RedfishLocationRedfish location.
[in]UuidService UUID string.
[in]OsOS string.
[in]OsVerOS version string.
[in]ProductProduct string.
[in]ProductVerProduct version string.

Definition at line 774 of file RedfishDiscoverDxe.c.

◆ NetworkInterfaceGetSubnetInfo()

EFI_STATUS NetworkInterfaceGetSubnetInfo ( IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL Instance,
IN EFI_HANDLE  ImageHandle 
)

This function gets the subnet information of this network interface instance. can discover Redfish service on it.

Parameters
[in]InstanceEFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instance.
[in]ImageHandleEFI Image handle request the network interface list.
Return values
EFI_SUCCESS

Definition at line 1229 of file RedfishDiscoverDxe.c.

◆ NumberOfNetworkInterface()

UINTN NumberOfNetworkInterface ( VOID  )

This function returns number of network interface instance.

Return values
UINTNNumber of network interface instances.

Definition at line 445 of file RedfishDiscoverDxe.c.

◆ RedfishDiscoverDriverBindingStart()

EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Starts a device controller or a bus controller.

The Start() function is designed to be invoked from the EFI boot service ConnectController(). As a result, much of the error checking on the parameters to Start() has been moved into this common boot service. It is legal to call Start() from other locations, but the following calling restrictions must be followed, or the system behavior will not be deterministic.

  1. ControllerHandle must be a valid EFI_HANDLE.
  2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned EFI_DEVICE_PATH_PROTOCOL.
  3. Prior to calling Start(), the Supported() function for the driver specified by This must have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to start. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
[in]RemainingDevicePathA pointer to the remaining portion of a device path. This parameter is ignored by device drivers, and is optional for bus drivers. For a bus driver, if this parameter is NULL, then handles for all the children of Controller are created by this driver. If this parameter is not NULL and the first Device Path Node is not the End of Device Path Node, then only the handle for the child device specified by the first Device Path Node of RemainingDevicePath is created by this driver. If the first Device Path Node of RemainingDevicePath is the End of Device Path Node, no child handle is created by this driver.
Return values
EFI_SUCCESSThe device was started.
EFI_DEVICE_ERRORThe device could not be started due to a device error.Currently not implemented.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
OthersThe driver failed to start the device.

Definition at line 2280 of file RedfishDiscoverDxe.c.

◆ RedfishDiscoverDriverBindingStop()

EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer  OPTIONAL 
)

Stops a device controller or a bus controller.

The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). As a result, much of the error checking on the parameters to Stop() has been moved into this common boot service. It is legal to call Stop() from other locations, but the following calling restrictions must be followed, or the system behavior will not be deterministic.

  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this same driver's Start() function.
  2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid EFI_HANDLE. In addition, all of these handles must have been created in this driver's Start() function, and the Start() function must have called OpenProtocol() on ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleA handle to the device being stopped. The handle must support a bus specific I/O protocol for the driver to use to stop the device.
[in]NumberOfChildrenThe number of child device handles in ChildHandleBuffer.
[in]ChildHandleBufferAn array of child handles to be freed. May be NULL if NumberOfChildren is 0.
Return values
EFI_SUCCESSThe device was stopped.
EFI_DEVICE_ERRORThe device could not be stopped due to a device error.

Definition at line 2318 of file RedfishDiscoverDxe.c.

◆ RedfishDiscoverDriverBindingSupported()

EFI_STATUS EFIAPI RedfishDiscoverDriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Tests to see if this driver supports a given controller. If a child device is provided, it further tests to see if this driver supports creating a handle for the specified child device.

This function checks to see if the driver specified by This supports the device specified by ControllerHandle. Drivers will typically use the device path attached to ControllerHandle and/or the services from the bus I/O abstraction attached to ControllerHandle to determine if the driver supports ControllerHandle. This function may be called many times during platform initialization. In order to reduce boot times, the tests performed by this function must be very small, and take as little time as possible to execute. This function must not change the state of any hardware devices, and this function must be aware that the device specified by ControllerHandle may already be managed by the same driver or a different driver. This function must match its calls to AllocatePages() with FreePages(), AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). Because ControllerHandle may have been previously started by the same driver, if a protocol is already in the opened state, then it must not be closed with CloseProtocol(). This is required to guarantee the state of ControllerHandle is not modified by this function.

Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to test. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
[in]RemainingDevicePathA pointer to the remaining portion of a device path. This parameter is ignored by device drivers, and is optional for bus drivers. For bus drivers, if this parameter is not NULL, then the bus driver must determine if the bus controller specified by ControllerHandle and the child controller specified by RemainingDevicePath are both supported by this bus driver.
Return values
EFI_SUCCESSThe device specified by ControllerHandle and RemainingDevicePath is supported by the driver specified by This.
EFI_ALREADY_STARTEDThe device specified by ControllerHandle and RemainingDevicePath is already being managed by the driver specified by This.
EFI_ACCESS_DENIEDThe device specified by ControllerHandle and RemainingDevicePath is already being managed by a different driver or an application that requires exclusive access. Currently not implemented.
EFI_UNSUPPORTEDThe device specified by ControllerHandle and RemainingDevicePath is not supported by the driver specified by This.

Definition at line 2234 of file RedfishDiscoverDxe.c.

◆ RedfishDiscoverEntryPoint()

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

This is the declaration of an EFI image entry point.

Parameters
ImageHandleThe firmware allocated handle for the UEFI image.
SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe operation completed successfully.
OthersAn unexpected error occurred.

Definition at line 2348 of file RedfishDiscoverDxe.c.

◆ RedfishDiscoverUnload()

EFI_STATUS EFIAPI RedfishDiscoverUnload ( IN EFI_HANDLE  ImageHandle)

This is the unload handle for Redfish discover module.

Disconnect the driver specified by ImageHandle from all the devices in the handle database. Uninstall all the protocols installed in the driver entry point.

Parameters
[in]ImageHandleThe drivers' driver image.
Return values
EFI_SUCCESSThe image is unloaded.
OthersFailed to unload the image.

Definition at line 2388 of file RedfishDiscoverDxe.c.

◆ RedfishServiceAbortAcquire()

EFI_STATUS EFIAPI RedfishServiceAbortAcquire ( IN EFI_REDFISH_DISCOVER_PROTOCOL This,
IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *TargetNetworkInterface  OPTIONAL 
)

This function aborts Redfish service discovery on the given network interface.

Parameters
[in]ThisEFI_REDFISH_DISCOVER_PROTOCOL instance.
[in]TargetNetworkInterfaceTarget network interface to do the discovery.
Return values
EFI_SUCCESSREST EX instance of discovered Redfish services are returned.
OthersFail to abort Redfish service discovery.

Definition at line 1593 of file RedfishDiscoverDxe.c.

◆ RedfishServiceAcquireService()

EFI_STATUS EFIAPI RedfishServiceAcquireService ( IN EFI_REDFISH_DISCOVER_PROTOCOL This,
IN EFI_HANDLE  ImageHandle,
IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE TargetNetworkInterface,
IN EFI_REDFISH_DISCOVER_FLAG  Flags,
IN EFI_REDFISH_DISCOVERED_TOKEN Token 
)

This function acquires Redfish services by discovering static Redfish setting according to Redfish Host Interface or through SSDP. Returns a list of EFI handles in EFI_REDFISH_DISCOVERED_LIST. Each of EFI handle has corresponding EFI REST EX instance installed on it. Each REST EX instance is a child instance which created through EFI REST EX service protocol for communicating with specific Redfish service.

Parameters
[in]ThisEFI_REDFISH_DISCOVER_PROTOCOL instance.
[in]ImageHandleEFI image owns these Redfish service instances.
[in]TargetNetworkInterfaceTarget network interface to do the discovery. NULL means discover Redfish service on all network interfaces on platform.
[in]FlagsRedfish service discover flags.
[in]TokenEFI_REDFISH_DISCOVERED_TOKEN instance. The memory of EFI_REDFISH_DISCOVERED_LIST and the strings in EFI_REDFISH_DISCOVERED_INFORMATION are all allocated by Acquire() and must be freed when caller invoke Release().
Return values
EFI_SUCCESSREST EX instance of discovered Redfish services are returned.
EFI_INVALID_PARAMETERSImageHandle == NULL, Flags == 0, Token == NULL, Token->Timeout > 5, or Token->Event == NULL.
OthersFail acquire Redfish services.

Definition at line 1450 of file RedfishDiscoverDxe.c.

◆ RedfishServiceGetNetworkInterface()

EFI_STATUS EFIAPI RedfishServiceGetNetworkInterface ( IN EFI_REDFISH_DISCOVER_PROTOCOL This,
IN EFI_HANDLE  ImageHandle,
OUT UINTN NumberOfNetworkIntfs,
OUT EFI_REDFISH_DISCOVER_NETWORK_INTERFACE **  NetworkIntfInstances 
)

This function gets the network interface list which Redfish discover protocol can discover Redfish service on it.

Parameters
[in]ThisEFI_REDFISH_DISCOVER_PROTOCOL instance.
[in]ImageHandleEFI Image handle request the network interface list,
[out]NumberOfNetworkIntfsNumber of network interfaces can do Redfish service discovery.
[out]NetworkIntfInstancesNetwork interface instances. It's an array of instance. The number of entries in array is indicated by NumberOfNetworkIntfs. Caller has to release the memory allocated by Redfish discover protocol.
Return values
EFI_SUCCESSThe information of network interface is returned in NumberOfNetworkIntfs and NetworkIntfInstances.
OthersFail to return the information of network interface.

Definition at line 1340 of file RedfishDiscoverDxe.c.

◆ RedfishServiceReleaseService()

EFI_STATUS EFIAPI RedfishServiceReleaseService ( IN EFI_REDFISH_DISCOVER_PROTOCOL This,
IN EFI_REDFISH_DISCOVERED_LIST InstanceList 
)

This function releases Redfish services found by RedfishServiceAcquire().

Parameters
[in]ThisEFI_REDFISH_DISCOVER_PROTOCOL instance.
[in]InstanceListThe Redfish service to release.
Return values
EFI_SUCCESSREST EX instances of discovered Redfish are released.
OthersFail to remove the entry

Definition at line 1618 of file RedfishDiscoverDxe.c.

◆ StopServiceOnNetworkInterface()

EFI_STATUS StopServiceOnNetworkInterface ( IN EFI_DRIVER_BINDING_PROTOCOL ThisBindingProtocol,
IN EFI_HANDLE  ControllerHandle 
)

Stop the services on network interface.

Parameters
[in]ThisBindingProtocolA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to test. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
Return values
EFI_SUCCESSOne of required protocol is found.
OthersFailed to stop the services on network interface.

Definition at line 2064 of file RedfishDiscoverDxe.c.

◆ Tcp4GetSubnetInfo()

EFI_STATUS EFIAPI Tcp4GetSubnetInfo ( IN EFI_HANDLE  ImageHandle,
IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL Instance 
)

This function gets the subnet information of this TCP4 instance.

Parameters
[in]ImageHandleEFI handle with this image.
[in]InstanceInstance of Network interface.
Return values
EFI_STATUSGet subnet information successfully.
OtherwiseFail to get subnet information.

Definition at line 157 of file RedfishDiscoverDxe.c.

◆ Tcp6GetSubnetInfo()

EFI_STATUS EFIAPI Tcp6GetSubnetInfo ( IN EFI_HANDLE  ImageHandle,
IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL Instance 
)

This function gets the subnet information of this TCP6 instance.

Parameters
[in]ImageHandleEFI handle with this image.
[in]InstanceInstance of Network interface.
Return values
EFI_STATUSGet subnet information successfully.
OtherwiseFail to get subnet information.

Definition at line 257 of file RedfishDiscoverDxe.c.

◆ TestForRequiredProtocols()

EFI_STATUS TestForRequiredProtocols ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle 
)

Tests to see if the required protocols are provided on the given controller handle.

Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to test. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
Return values
EFI_SUCCESSOne of required protocol is found.
EFI_UNSUPPORTEDNone of required protocol is found.

Definition at line 1779 of file RedfishDiscoverDxe.c.

◆ ValidateTargetNetworkInterface()

EFI_STATUS ValidateTargetNetworkInterface ( IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE TargetNetworkInterface,
IN EFI_REDFISH_DISCOVER_FLAG  Flags 
)

This function validate if target network interface is ready for discovering Redfish service.

Parameters
[in]TargetNetworkInterfaceEFI_REDFISH_DISCOVER_NETWORK_INTERFACE. NULL for all EFI_REDFISH_DISCOVER_NETWORK_INTERFACEs.
[in]FlagsEFI_REDFISH_DISCOVER_FLAG
Return values
EFI_SUCCESSTarget network interface is ready to use.
EFI_UNSUPPORTEDTarget network interface is not ready to use.

Definition at line 397 of file RedfishDiscoverDxe.c.

Variable Documentation

◆ gRedfishDiscoverDriverBinding

EFI_DRIVER_BINDING_PROTOCOL gRedfishDiscoverDriverBinding
Initial value:
= {
REDFISH_DISCOVER_VERSION,
}
#define NULL
Definition: Base.h:319
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL)
EFI_STATUS EFIAPI RedfishDiscoverDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)

Definition at line 2328 of file RedfishDiscoverDxe.c.

◆ mEfiRedfishDiscoverNetworkInterface

LIST_ENTRY mEfiRedfishDiscoverNetworkInterface

Definition at line 23 of file RedfishDiscoverDxe.c.

◆ mEfiRedfishDiscoverRestExInstance

LIST_ENTRY mEfiRedfishDiscoverRestExInstance

Definition at line 24 of file RedfishDiscoverDxe.c.

◆ mNumNetworkInterface

UINTN mNumNetworkInterface = 0

Definition at line 21 of file RedfishDiscoverDxe.c.

◆ mNumRestExInstance

UINTN mNumRestExInstance = 0

Definition at line 22 of file RedfishDiscoverDxe.c.

◆ mRedfishDiscoverList

LIST_ENTRY mRedfishDiscoverList

Definition at line 17 of file RedfishDiscoverDxe.c.

◆ mRedfishDiscoverRestExInstanceGuid

EFI_GUID mRedfishDiscoverRestExInstanceGuid = EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_GUID

Definition at line 28 of file RedfishDiscoverDxe.c.

◆ mRedfishDiscoverTcp4InstanceGuid

EFI_GUID mRedfishDiscoverTcp4InstanceGuid = EFI_REDFISH_DISCOVER_TCP4_INSTANCE_GUID

Definition at line 26 of file RedfishDiscoverDxe.c.

◆ mRedfishDiscoverTcp6InstanceGuid

EFI_GUID mRedfishDiscoverTcp6InstanceGuid = EFI_REDFISH_DISCOVER_TCP6_INSTANCE_GUID

Definition at line 27 of file RedfishDiscoverDxe.c.

◆ mRedfishInstanceList

LIST_ENTRY mRedfishInstanceList

Definition at line 18 of file RedfishDiscoverDxe.c.

◆ mSmbios

Definition at line 19 of file RedfishDiscoverDxe.c.