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

Go to the source code of this file.

Functions

BOOLEAN ProbeRedfishCredentialBootstrap (VOID)
 
EFI_STATUS RedfishPlatformHostInterfaceDeviceDescriptor (IN UINT8 *DeviceType, OUT REDFISH_INTERFACE_DATA **DeviceDescriptor)
 
EFI_STATUS RedfishPlatformHostInterfaceProtocolData (IN OUT MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord, IN UINT8 IndexOfProtocolData)
 
EFI_STATUS RetrievedBmcUsbNicInfo (VOID)
 
EFI_STATUS CacheIpmiLanMac (IN UINT8 ChannelNum, IN EFI_MAC_ADDRESS *IpmiLanChannelMacAddress, IN UINT8 IpmiLanMacAddressSize)
 
EFI_STATUS CheckCachedIpmiLanMac (IN UINT8 ChannelNum, OUT BMC_IPMI_LAN_CHANNEL_INFO **CachedIpmiLanChannel)
 
EFI_STATUS HostInterfaceIpmiCheckMacAddress (IN HOST_INTERFACE_BMC_USB_NIC_INFO *UsbNicInfo)
 
EFI_DEVICE_PATH_PROTOCOLUsbNicGetNextMsgUsbDp (IN EFI_DEVICE_PATH_PROTOCOL *ThisDevicePath)
 
EFI_STATUS UsbNicSearchUsbIo (IN EFI_DEVICE_PATH_PROTOCOL *UsbDevicePath, OUT EFI_USB_IO_PROTOCOL **UsbIo)
 
EFI_STATUS IdentifyNetworkMessageDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *UsbDevicePath)
 
EFI_STATUS IdentifyUsbNicBmcChannel (IN EFI_HANDLE Handle, IN EFI_DEVICE_PATH_PROTOCOL *UsbDevicePath)
 
EFI_STATUS CheckBmcUsbNicOnHandles (IN UINTN HandleNumer, IN EFI_HANDLE *HandleBuffer)
 
EFI_STATUS CheckBmcUsbNic (VOID *Registration)
 
VOID EFIAPI PlatformHostInterfaceSnpCallback (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS RedfishPlatformHostInterfaceNotification (OUT EFI_GUID **InformationReadinessGuid)
 

Detailed Description

Source file to provide the platform Redfish Host Interface information of USB NIC Device exposed by BMC.

Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.

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

Definition in file PlatformHostInterfaceBmcUsbNicLib.c.

Function Documentation

◆ CacheIpmiLanMac()

EFI_STATUS CacheIpmiLanMac ( IN UINT8  ChannelNum,
IN EFI_MAC_ADDRESS IpmiLanChannelMacAddress,
IN UINT8  IpmiLanMacAddressSize 
)

This function caches the found IPMI LAN channel. So we don't have to sedn IPMI commands again if the USB NIC is connected later.

Parameters
[in]ChannelNumThe IPMI channel number.
[in]IpmiLanChannelMacAddressPointer to EFI_MAC_ADDRESS.
[in]IpmiLanMacAddressSizeThe MAC address size.
Return values
EFI_SUCCESSIPMI LAN channel is cached.
EFI_OUT_OF_RESOURCEMemory allocated failed.
OthersOther errors.

Definition at line 523 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ CheckBmcUsbNic()

EFI_STATUS CheckBmcUsbNic ( VOID *  Registration)

This function checks if the USB NIC exposed by BMC is already connected.

Parameters
[in]RegistrationLocate SNP protocol from the notification registeration key. NULL means locate SNP protocol from the existing handles.
Return values
EFI_SUCCESSYes, USB NIC exposed by BMC is found.
EFI_NOT_FOUNDNo, USB NIC exposed by BMC is not found on the existing SNP handle.
OthersOther errors.

Definition at line 1199 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ CheckBmcUsbNicOnHandles()

EFI_STATUS CheckBmcUsbNicOnHandles ( IN UINTN  HandleNumer,
IN EFI_HANDLE HandleBuffer 
)

This function checks if the USB NIC exposed by BMC on each handle has SNP protocol installed on it.

Parameters
[in]HandleNumerNumber of handles to check.
[in]HandleBufferHandles buffer.
Return values
EFI_SUCCESSYes, USB NIC exposed by BMC is found.
EFI_NOT_FOUNDNo, USB NIC exposed by BMC is not found on the existing SNP handle.
OthersOther errors.

Definition at line 1118 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ CheckCachedIpmiLanMac()

EFI_STATUS CheckCachedIpmiLanMac ( IN UINT8  ChannelNum,
OUT BMC_IPMI_LAN_CHANNEL_INFO **  CachedIpmiLanChannel 
)

This function checks if the IPMI channel already identified previously.

Parameters
[in]ChannelNumThe IPMI channel number.
[out]CachedIpmiLanChannelPointer to retrieve the cached BMC_IPMI_LAN_CHANNEL_INFO.
Return values
EFI_SUCCESSIPMI LAN channel is found.
OthersOther errors.

Definition at line 557 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ HostInterfaceIpmiCheckMacAddress()

EFI_STATUS HostInterfaceIpmiCheckMacAddress ( IN HOST_INTERFACE_BMC_USB_NIC_INFO UsbNicInfo)

This function goes through IPMI channels to find the mactched MAC addrss of BMC USB NIC endpoint.

Parameters
[in]UsbNicInfoThe instance of HOST_INTERFACE_BMC_USB_NIC_INFO.
Return values
EFI_SUCCESSYes, USB NIC exposed by BMC is found.
EFI_NOT_FOUNDNo, USB NIC exposed by BMC is not found on the existing SNP handle.
OthersOther errors.

Definition at line 599 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ IdentifyNetworkMessageDevicePath()

EFI_STATUS IdentifyNetworkMessageDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL UsbDevicePath)

This function identifies if the USB NIC has MAC address and internet protocol device path installed. (Only support IPv4)

Parameters
[in]UsbDevicePathUSB device path.
Return values
EFI_SUCCESSYes, this is IPv4 SNP handle
EFI_NOT_FOUNDNo, this is not IPv4 SNP handle

Definition at line 988 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ IdentifyUsbNicBmcChannel()

EFI_STATUS IdentifyUsbNicBmcChannel ( IN EFI_HANDLE  Handle,
IN EFI_DEVICE_PATH_PROTOCOL UsbDevicePath 
)

This function identifies if the USB NIC is exposed by BMC as the host-BMC channel.

Parameters
[in]HandleThis is the EFI handle with SNP installed.
[in]UsbDevicePathUSB device path.
Return values
EFI_SUCCESSYes, USB NIC exposed by BMC is found.
EFI_NOT_FOUNDNo, USB NIC exposed by BMC is not found on the existing SNP handle.
OthersOther errors.

Definition at line 1034 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ PlatformHostInterfaceSnpCallback()

VOID EFIAPI PlatformHostInterfaceSnpCallback ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Notification event of SNP readiness.

Parameters
[in]EventEvent whose notification function is being invoked.
[in]ContextThe pointer to the notification function's context, which is implementation-dependent.

Definition at line 1288 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ ProbeRedfishCredentialBootstrap()

BOOLEAN ProbeRedfishCredentialBootstrap ( VOID  )

Probe if the system supports Redfish Host Interface Credentail Bootstrapping.

Return values
TRUEYes, it is supported. FALSE No, it is not supported.

Definition at line 30 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ RedfishPlatformHostInterfaceDeviceDescriptor()

EFI_STATUS RedfishPlatformHostInterfaceDeviceDescriptor ( IN UINT8 *  DeviceType,
OUT REDFISH_INTERFACE_DATA **  DeviceDescriptor 
)

Get platform Redfish host interface device descriptor.

Parameters
[in]DeviceTypePointer to retrieve device type.
[out]DeviceDescriptorPointer to retrieve REDFISH_INTERFACE_DATA, caller has to free this memory using FreePool().
Return values
EFI_NOT_FOUNDNo Redfish host interface descriptor provided on this platform.

Definition at line 95 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ RedfishPlatformHostInterfaceNotification()

EFI_STATUS RedfishPlatformHostInterfaceNotification ( OUT EFI_GUID **  InformationReadinessGuid)

Get the EFI protocol GUID installed by platform library which indicates the necessary information is ready for building SMBIOS 42h record.

Parameters
[out]InformationReadinessGuidPointer to retrive the protocol GUID.
Return values
EFI_SUCCESSNotification is required for building up SMBIOS type 42h record.
EFI_UNSUPPORTEDNotification is not required for building up SMBIOS type 42h record.
EFI_ALREADY_STARTEDPlatform host information is already ready.
OthersOther errors.

Definition at line 1315 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ RedfishPlatformHostInterfaceProtocolData()

EFI_STATUS RedfishPlatformHostInterfaceProtocolData ( IN OUT MC_HOST_INTERFACE_PROTOCOL_RECORD **  ProtocolRecord,
IN UINT8  IndexOfProtocolData 
)

Get platform Redfish host interface protocol data. Caller should pass NULL in ProtocolRecord to retrive the first protocol record. Then continuously pass previous ProtocolRecord for retrieving the next ProtocolRecord.

Parameters
[in,out]ProtocolRecordPointer to retrieve the first or the next protocol record. caller has to free the new protocol record returned from this function using FreePool().
[in]IndexOfProtocolDataThe index of protocol data.
Return values
EFI_NOT_FOUNDNo more protocol records.

Definition at line 164 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ RetrievedBmcUsbNicInfo()

EFI_STATUS RetrievedBmcUsbNicInfo ( VOID  )

This function retrieve the information of BMC USB NIC.

Return values
EFI_SUCCESSAll necessary information is retrieved.
EFI_NOT_FOUNDThere is no BMC exposed USB NIC.
OthersOther errors.

Definition at line 293 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ UsbNicGetNextMsgUsbDp()

EFI_DEVICE_PATH_PROTOCOL * UsbNicGetNextMsgUsbDp ( IN EFI_DEVICE_PATH_PROTOCOL ThisDevicePath)

This function searches the next MSG_USB_DP device path node.

Parameters
[in]ThisDevicePathDevice path to search.
Return values
NULLMSG_USB_DP is not found. Otherwise MSG_USB_DP is found.

Definition at line 787 of file PlatformHostInterfaceBmcUsbNicLib.c.

◆ UsbNicSearchUsbIo()

EFI_STATUS UsbNicSearchUsbIo ( IN EFI_DEVICE_PATH_PROTOCOL UsbDevicePath,
OUT EFI_USB_IO_PROTOCOL **  UsbIo 
)

This function search the UsbIo handle that matches the UsbDevicePath.

Parameters
[in]UsbDevicePathDevice path of this SNP handle.
[out]UsbIoReturn the UsbIo protocol.
Return values
EFI_SUCCESSYes, UsbIo protocl is found.
EFI_NOT_FOUNDNo, UsbIo protocl is not found
OthersOther errors.

Definition at line 821 of file PlatformHostInterfaceBmcUsbNicLib.c.