Functions | |
VOID | IScsiStrTrim (IN OUT CHAR16 *Str, IN CHAR16 CharC) |
UINT8 | IScsiGetSubnetMaskPrefixLength (IN EFI_IPv4_ADDRESS *SubnetMask) |
EFI_STATUS | IScsiAsciiStrToLun (IN CHAR8 *Str, OUT UINT8 *Lun) |
VOID | IScsiLunToUnicodeStr (IN UINT8 *Lun, OUT CHAR16 *Str) |
EFI_STATUS | IScsiAsciiStrToIp (IN CHAR8 *Str, IN UINT8 IpMode, OUT EFI_IP_ADDRESS *Ip) |
VOID | IScsiMacAddrToStr (IN EFI_MAC_ADDRESS *Mac, IN UINT32 Len, IN UINT16 VlanId, OUT CHAR16 *Str) |
EFI_STATUS | IScsiBinToHex (IN UINT8 *BinBuffer, IN UINT32 BinLength, IN OUT CHAR8 *HexStr, IN OUT UINT32 *HexLength) |
EFI_STATUS | IScsiHexToBin (IN OUT UINT8 *BinBuffer, IN OUT UINT32 *BinLength, IN CHAR8 *HexStr) |
UINTN | IScsiNetNtoi (IN CHAR8 *Str) |
VOID | IScsiGenRandom (IN OUT UINT8 *Rand, IN UINTN RandLength) |
EFI_STATUS | IScsiAddNic (IN EFI_HANDLE Controller) |
EFI_STATUS | IScsiRemoveNic (IN EFI_HANDLE Controller) |
ISCSI_NIC_INFO * | IScsiGetNicInfoByIndex (IN UINT8 NicIndex) |
UINT16 | IScsiGetNICPciLocation (IN EFI_HANDLE Controller, OUT UINTN *Bus, OUT UINTN *Device, OUT UINTN *Function) |
VOID * | IScsiGetVariableAndSize (IN CHAR16 *Name, IN EFI_GUID *VendorGuid, OUT UINTN *VariableSize) |
ISCSI_DRIVER_DATA * | IScsiCreateDriverData (IN EFI_HANDLE Image, IN EFI_HANDLE Controller) |
VOID | IScsiCleanDriverData (IN ISCSI_DRIVER_DATA *Private) |
BOOLEAN | IScsiDhcpIsConfigured (IN EFI_HANDLE Controller, IN UINT8 IpVersion) |
EFI_STATUS | IScsiGetConfigData (IN ISCSI_DRIVER_DATA *Private) |
EFI_DEVICE_PATH_PROTOCOL * | IScsiGetTcpConnDevicePath (IN ISCSI_SESSION *Session) |
VOID EFIAPI | IScsiOnExitBootService (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS EFIAPI | IScsiTestManagedDevice (IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE DriverBindingHandle, IN EFI_GUID *ProtocolGuid) |
Variables | |
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 | IScsiHexString [] = "0123456789ABCDEFabcdef" |
Copyright (c) 2004 - 2015, 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.
EFI_STATUS IScsiAddNic | ( | IN EFI_HANDLE | Controller | ) |
Record the NIC info in global structure.
[in] | Controller | The handle of the controller. |
EFI_SUCCESS | The operation is completed. | |
EFI_OUT_OF_RESOURCES | Do not have sufficient resources to finish this operation. |
References ISCSI_NIC_INFO::BusNumber, ISCSI_PRIVATE_DATA::CurrentNic, ISCSI_NIC_INFO::DeviceNumber, ISCSI_NIC_INFO::FunctionNumber, ISCSI_NIC_INFO::HwAddressSize, IScsiGetNICPciLocation(), ISCSI_NIC_INFO::Link, ISCSI_PRIVATE_DATA::MaxNic, mPrivate, ISCSI_PRIVATE_DATA::NicCount, ISCSI_NIC_INFO::NicIndex, ISCSI_PRIVATE_DATA::NicInfoList, ISCSI_NIC_INFO::PermanentAddress, and ISCSI_NIC_INFO::VlanId.
Referenced by IScsiStart().
EFI_STATUS IScsiAsciiStrToIp | ( | IN CHAR8 * | Str, | |
IN UINT8 | IpMode, | |||
OUT EFI_IP_ADDRESS * | Ip | |||
) |
Convert the formatted IP address into the binary IP address.
[in] | Str | The UNICODE string. |
[in] | IpMode | Indicates whether the IP address is v4 or v6. |
[out] | Ip | The storage to return the ASCII string. |
EFI_SUCCESS | The binary IP address is returned in Ip. | |
EFI_INVALID_PARAMETER | The IP string is malformatted or IpMode is invalid. |
References IP_MODE_AUTOCONFIG, IP_MODE_AUTOCONFIG_IP4, IP_MODE_AUTOCONFIG_IP6, IP_MODE_IP4, and IP_MODE_IP6.
Referenced by IScsiDhcp6ExtractRootPath(), IScsiDhcpExtractRootPath(), IScsiFormCallback(), and IScsiUpdateTargetAddress().
EFI_STATUS IScsiAsciiStrToLun | ( | IN CHAR8 * | Str, | |
OUT UINT8 * | Lun | |||
) |
Convert the hexadecimal encoded LUN string into the 64-bit LUN.
[in] | Str | The hexadecimal encoded LUN string. |
[out] | Lun | Storage to return the 64-bit LUN. |
EFI_SUCCESS | The 64-bit LUN is stored in Lun. | |
EFI_INVALID_PARAMETER | The string is malformatted. |
Referenced by IScsiDhcp6ExtractRootPath(), IScsiDhcpExtractRootPath(), and IScsiFormCallback().
EFI_STATUS IScsiBinToHex | ( | IN UINT8 * | BinBuffer, | |
IN UINT32 | BinLength, | |||
IN OUT CHAR8 * | HexStr, | |||
IN OUT UINT32 * | HexLength | |||
) |
Convert the binary encoded buffer into a hexadecimal encoded string.
[in] | BinBuffer | The buffer containing the binary data. |
[in] | BinLength | Length of the binary buffer. |
[in,out] | HexStr | Pointer to the string. |
[in,out] | HexLength | The length of the string. |
EFI_SUCCESS | The binary data is converted to the hexadecimal string and the length of the string is updated. | |
EFI_BUFFER_TOO_SMALL | The string is too small. | |
EFI_INVALID_PARAMETER | The IP string is malformatted. |
References IScsiHexString.
Referenced by IScsiCHAPToSendReq().
VOID IScsiCleanDriverData | ( | IN ISCSI_DRIVER_DATA * | Private | ) |
Clean the iSCSI driver data.
[in] | Private | The iSCSI driver data. |
References mPrivate, and ISCSI_PRIVATE_DATA::OneSessionEstablished.
Referenced by IScsiStart(), and IScsiStop().
ISCSI_DRIVER_DATA* IScsiCreateDriverData | ( | IN EFI_HANDLE | Image, | |
IN EFI_HANDLE | Controller | |||
) |
Create the iSCSI driver data.
[in] | Image | The handle of the driver image. |
[in] | Controller | The handle of the controller. |
NULL | Other errors as indicated. |
References _ISCSI_DRIVER_DATA::Controller, _ISCSI_DRIVER_DATA::ExitBootServiceEvent, _ISCSI_DRIVER_DATA::ExtScsiPassThruHandle, _ISCSI_DRIVER_DATA::ExtScsiPassThruMode, gIScsiExtScsiPassThruProtocolTemplate, _ISCSI_DRIVER_DATA::Image, ISCSI_DRIVER_DATA_SIGNATURE, _ISCSI_DRIVER_DATA::IScsiExtScsiPassThru, IScsiOnExitBootService(), _ISCSI_DRIVER_DATA::Session, and _ISCSI_DRIVER_DATA::Signature.
Referenced by IScsiStart().
BOOLEAN IScsiDhcpIsConfigured | ( | IN EFI_HANDLE | Controller, | |
IN UINT8 | IpVersion | |||
) |
Check wheather the Controller handle is configured to use DHCP protocol.
[in] | Controller | The handle of the controller. |
[in] | IpVersion | IP_VERSION_4 or IP_VERSION_6. |
TRUE | The handle of the controller need the Dhcp protocol. | |
FALSE | The handle of the controller does not need the Dhcp protocol. |
References gIScsiConfigGuid, IP_MODE_AUTOCONFIG, IP_MODE_IP4, IP_MODE_IP6, ISCSI_DISABLED, ISCSI_MAX_MAC_STRING_LEN, ISCSI_NAME_IFR_MAX_SIZE, IScsiGetVariableAndSize(), and IScsiMacAddrToStr().
Referenced by IScsiSupported().
VOID IScsiGenRandom | ( | IN OUT UINT8 * | Rand, | |
IN UINTN | RandLength | |||
) |
Generate random numbers.
[in,out] | Rand | The buffer to contain random numbers. |
[in] | RandLength | The length of the Rand buffer. |
Referenced by IScsiCHAPToSendReq().
EFI_STATUS IScsiGetConfigData | ( | IN ISCSI_DRIVER_DATA * | Private | ) |
Get the various configuration data.
[in] | Private | The iSCSI driver data. |
EFI_SUCCESS | The configuration data is retrieved. | |
EFI_NOT_FOUND | This iSCSI driver is not configured yet. |
References _ISCSI_ATTEMPT_CONFIG_NVDATA::AttemptConfigIndex, ISCSI_PRIVATE_DATA::AttemptConfigs, ISCSI_PRIVATE_DATA::AttemptCount, _ISCSI_ATTEMPT_CONFIG_NVDATA::AutoConfigureMode, _ISCSI_ATTEMPT_CONFIG_NVDATA::AutoConfigureSuccess, ISCSI_NIC_INFO::BusNumber, ISCSI_PRIVATE_DATA::CurrentNic, ISCSI_NIC_INFO::DeviceNumber, _ISCSI_ATTEMPT_CONFIG_NVDATA::DhcpSuccess, _ISCSI_SESSION_CONFIG_NVDATA::Enabled, ISCSI_PRIVATE_DATA::EnableMpio, ISCSI_NIC_INFO::FunctionNumber, gIScsiConfigGuid, gIScsiInitiatorName, ISCSI_NIC_INFO::HwAddressSize, _ISCSI_SESSION_CONFIG_NVDATA::InitiatorInfoFromDhcp, ISCSI_PRIVATE_DATA::InitiatorName, ISCSI_PRIVATE_DATA::InitiatorNameLength, IP_MODE_AUTOCONFIG, IP_MODE_AUTOCONFIG_IP4, IP_MODE_AUTOCONFIG_IP6, IP_MODE_IP4, IP_MODE_IP6, _ISCSI_SESSION_CONFIG_NVDATA::IpMode, IpMode, ISCSI_PRIVATE_DATA::Ipv6Flag, ISCSI_AUTH_TYPE_KRB, ISCSI_CONFIG_VAR_ATTR, ISCSI_DISABLED, ISCSI_ENABLED, ISCSI_ENABLED_FOR_MPIO, ISCSI_MAX_MAC_STRING_LEN, ISCSI_NAME_IFR_MAX_SIZE, ISCSI_NAME_MAX_SIZE, IScsiConfigGetAttemptByConfigIndex(), IScsiConfigUpdateAttempt(), IScsiDoDhcp(), IScsiDoDhcp6(), IScsiGetNicInfoByIndex(), IScsiGetVariableAndSize(), IScsiMacAddrToStr(), ISCSI_PRIVATE_DATA::Krb5MpioCount, _ISCSI_ATTEMPT_CONFIG_NVDATA::Link, _ISCSI_ATTEMPT_CONFIG_NVDATA::MacString, mCallbackInfo, ISCSI_PRIVATE_DATA::MpioCount, mPrivate, ISCSI_NIC_INFO::NicIndex, ISCSI_NIC_INFO::PermanentAddress, ISCSI_PRIVATE_DATA::PortString, _ISCSI_FORM_CALLBACK_INFO::RegisteredHandle, _ISCSI_ATTEMPT_CONFIG_NVDATA::SessionConfigData, ISCSI_PRIVATE_DATA::SinglePathCount, _ISCSI_SESSION_CONFIG_NVDATA::TargetInfoFromDhcp, _ISCSI_ATTEMPT_CONFIG_NVDATA::ValidPath, ISCSI_PRIVATE_DATA::ValidSinglePathCount, and ISCSI_NIC_INFO::VlanId.
Referenced by IScsiStart().
ISCSI_NIC_INFO* IScsiGetNicInfoByIndex | ( | IN UINT8 | NicIndex | ) |
Get the recorded NIC info from global structure by the Index.
[in] | NicIndex | The index indicates the position of NIC info. |
References mPrivate, ISCSI_NIC_INFO::NicIndex, and ISCSI_PRIVATE_DATA::NicInfoList.
Referenced by IScsiConfigProcessDefault(), IScsiConvertIfrNvDataToAttemptConfigData(), IScsiFillNICAndTargetSections(), and IScsiGetConfigData().
UINT16 IScsiGetNICPciLocation | ( | IN EFI_HANDLE | Controller, | |
OUT UINTN * | Bus, | |||
OUT UINTN * | Device, | |||
OUT UINTN * | Function | |||
) |
Get the NIC's PCI location and return it accroding to the composited format defined in iSCSI Boot Firmware Table.
[in] | Controller | The handle of the controller. |
[out] | Bus | The bus number. |
[out] | Device | The device number. |
[out] | Function | The function number. |
Referenced by IScsiAddNic().
UINT8 IScsiGetSubnetMaskPrefixLength | ( | IN EFI_IPv4_ADDRESS * | SubnetMask | ) |
Calculate the prefix length of the IPv4 subnet mask.
[in] | SubnetMask | The IPv4 subnet mask. |
0 | Other errors as indicated. |
Referenced by IScsiFillNICAndTargetSections(), and IScsiFormCallback().
EFI_DEVICE_PATH_PROTOCOL* IScsiGetTcpConnDevicePath | ( | IN ISCSI_SESSION * | Session | ) |
Get the device path of the iSCSI tcp connection and update it.
Session | The iSCSI session. |
NULL | Other errors as indicated. |
References IP4_NODE_LEN_NEW_VERSIONS, IP6_NODE_LEN_NEW_VERSIONS, IP6_NODE_LEN_OLD_VERSIONS, IP6_OLD_IPADDRESS_OFFSET, _ISCSI_CONNECTION::Ipv6Flag, ISCSI_CONNECTION_SIGNATURE, SESSION_STATE_LOGGED_IN, and _ISCSI_CONNECTION::TcpIo.
Referenced by IScsiStart().
VOID* IScsiGetVariableAndSize | ( | IN CHAR16 * | Name, | |
IN EFI_GUID * | VendorGuid, | |||
OUT UINTN * | VariableSize | |||
) |
Read the EFI variable (VendorGuid/Name) and return a dynamically allocated buffer, and the size of the buffer. If failure, return NULL.
[in] | Name | String part of EFI variable name. |
[in] | VendorGuid | GUID part of EFI variable name. |
[out] | VariableSize | Returns the size of the EFI variable that was read. |
Caller is responsible freeing the buffer.
NULL | Variable was not read. |
Referenced by IScsiConfigDeleteAttempts(), IScsiConfigDisplayDeleteAttempts(), IScsiConfigOrderAttempts(), IScsiConfigProcessDefault(), IScsiConvertIfrNvDataToAttemptConfigData(), IScsiDhcpIsConfigured(), IScsiGetConfigData(), and IScsiStart().
EFI_STATUS IScsiHexToBin | ( | IN OUT UINT8 * | BinBuffer, | |
IN OUT UINT32 * | BinLength, | |||
IN CHAR8 * | HexStr | |||
) |
Convert the hexadecimal string into a binary encoded buffer.
[in,out] | BinBuffer | The binary buffer. |
[in,out] | BinLength | Length of the binary buffer. |
[in] | HexStr | The hexadecimal string. |
EFI_SUCCESS | The hexadecimal string is converted into a binary encoded buffer. | |
EFI_BUFFER_TOO_SMALL | The binary buffer is too small to hold the converted data. |
Referenced by IScsiCHAPOnRspReceived().
VOID IScsiLunToUnicodeStr | ( | IN UINT8 * | Lun, | |
OUT CHAR16 * | Str | |||
) |
Convert the 64-bit LUN into the hexadecimal encoded LUN string.
[in] | Lun | The 64-bit LUN. |
[out] | Str | The storage to return the hexadecimal encoded LUN string. |
References IScsiHexString, and IScsiStrTrim().
Referenced by IScsiConvertAttemptConfigDataToIfrNvData().
VOID IScsiMacAddrToStr | ( | IN EFI_MAC_ADDRESS * | Mac, | |
IN UINT32 | Len, | |||
IN UINT16 | VlanId, | |||
OUT CHAR16 * | Str | |||
) |
Convert the mac address into a hexadecimal encoded "-" seperated string.
[in] | Mac | The mac address. |
[in] | Len | Length in bytes of the mac address. |
[in] | VlanId | VLAN ID of the network device. |
[out] | Str | The storage to return the mac string. |
References IScsiHexString.
Referenced by IScsiConfigAddAttempt(), IScsiConfigProcessDefault(), IScsiDhcpIsConfigured(), and IScsiGetConfigData().
UINTN IScsiNetNtoi | ( | IN CHAR8 * | Str | ) |
Convert the decimal-constant string or hex-constant string into a numerical value.
[in] | Str | String in decimal or hex. |
Referenced by IScsiCHAPOnRspReceived(), and IScsiCheckOpParams().
VOID EFIAPI IScsiOnExitBootService | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
Abort the session when the transition from BS to RT is initiated.
[in] | Event | The event signaled. |
[in] | Context | The iSCSI driver data. |
References _ISCSI_DRIVER_DATA::ExitBootServiceEvent, IScsiSessionAbort(), and _ISCSI_DRIVER_DATA::Session.
Referenced by IScsiCreateDriverData().
EFI_STATUS IScsiRemoveNic | ( | IN EFI_HANDLE | Controller | ) |
Delete the recorded NIC info from global structure. Also delete corresponding attempts.
[in] | Controller | The handle of the controller. |
EFI_SUCCESS | The operation is completed. | |
EFI_NOT_FOUND | The NIC info to be deleted is not recorded. |
References ISCSI_PRIVATE_DATA::AttemptConfigs, ISCSI_PRIVATE_DATA::AttemptCount, _ISCSI_ATTEMPT_CONFIG_NVDATA::AuthenticationType, ISCSI_PRIVATE_DATA::CurrentNic, _ISCSI_SESSION_CONFIG_NVDATA::Enabled, ISCSI_PRIVATE_DATA::EnableMpio, ISCSI_NIC_INFO::HwAddressSize, ISCSI_AUTH_TYPE_KRB, ISCSI_ENABLED, ISCSI_ENABLED_FOR_MPIO, ISCSI_PRIVATE_DATA::Krb5MpioCount, _ISCSI_ATTEMPT_CONFIG_NVDATA::Link, ISCSI_NIC_INFO::Link, ISCSI_PRIVATE_DATA::MpioCount, mPrivate, ISCSI_PRIVATE_DATA::NewAttempt, ISCSI_PRIVATE_DATA::NicCount, _ISCSI_ATTEMPT_CONFIG_NVDATA::NicIndex, ISCSI_NIC_INFO::NicIndex, ISCSI_PRIVATE_DATA::NicInfoList, ISCSI_NIC_INFO::PermanentAddress, _ISCSI_ATTEMPT_CONFIG_NVDATA::SessionConfigData, ISCSI_PRIVATE_DATA::SinglePathCount, ISCSI_PRIVATE_DATA::ValidSinglePathCount, and ISCSI_NIC_INFO::VlanId.
Referenced by IScsiStart(), and IScsiStop().
VOID IScsiStrTrim | ( | IN OUT CHAR16 * | Str, | |
IN CHAR16 | CharC | |||
) |
Removes (trims) specified leading and trailing characters from a string.
[in,out] | Str | Pointer to the null-terminated string to be trimmed. On return, Str will hold the trimmed string. |
[in] | CharC | Character will be trimmed from str. |
Referenced by IScsiLunToUnicodeStr().
EFI_STATUS EFIAPI IScsiTestManagedDevice | ( | IN EFI_HANDLE | ControllerHandle, | |
IN EFI_HANDLE | DriverBindingHandle, | |||
IN EFI_GUID * | ProtocolGuid | |||
) |
Tests whether a controller handle is being managed by IScsi driver.
This function tests whether the driver specified by DriverBindingHandle is currently managing the controller specified by ControllerHandle. This test is performed by evaluating if the the protocol specified by ProtocolGuid is present on ControllerHandle and is was opened by DriverBindingHandle and Nic Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER. If ProtocolGuid is NULL, then ASSERT().
ControllerHandle | A handle for a controller to test. | |
DriverBindingHandle | Specifies the driver binding handle for the driver. | |
ProtocolGuid | Specifies the protocol that the driver specified by DriverBindingHandle opens in its Start() function. |
EFI_SUCCESS | ControllerHandle is managed by the driver specified by DriverBindingHandle. | |
EFI_UNSUPPORTED | ControllerHandle is not managed by the driver specified by DriverBindingHandle. |
Referenced by IScsiUnload().
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 IScsiHexString[] = "0123456789ABCDEFabcdef" |
Referenced by IScsiBinToHex(), IScsiLunToUnicodeStr(), and IScsiMacAddrToStr().