TianoCore EDK2 master
|
#include "IScsiImpl.h"
Go to the source code of this file.
Variables | |
CHAR16 | mVendorStorageName [] = L"ISCSI_CONFIG_IFR_NVDATA" |
ISCSI_FORM_CALLBACK_INFO * | mCallbackInfo = NULL |
HII_VENDOR_DEVICE_PATH | mIScsiHiiVendorDevicePath |
Helper functions for configuring or getting the parameters relating to iSCSI.
Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file IScsiConfig.c.
BOOLEAN IpIsUnicast | ( | IN EFI_IP_ADDRESS * | Ip, |
IN UINT8 | IpMode | ||
) |
Check whether the input IP address is valid.
[in] | Ip | The IP address. |
[in] | IpMode | Indicates iSCSI running on IP4 or IP6 stack. |
TRUE | The input IP address is valid. |
FALSE | Otherwise |
Definition at line 153 of file IScsiConfig.c.
EFI_STATUS IScsiConfigAddAttempt | ( | VOID | ) |
Callback function when user presses "Add an Attempt".
EFI_OUT_OF_RESOURCES | Does not have sufficient resources to finish this operation. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 1956 of file IScsiConfig.c.
EFI_STATUS IScsiConfigAddAttemptsByKeywords | ( | IN UINT8 * | AttemptList | ) |
Add the attempts by keyword 'iSCSIAddAttempts', you can use this keyword with value 'attempt:1 attempt:2' etc to add one or more attempts once. This is different with IScsiConfigAddAttempt function which is used to add attempt by UI configuration.
[in] | AttemptList | The new attempt List will be added. |
EFI_SUCCESS | The operation to add attempt list successfully. |
EFI_INVALID_PARAMETER | Any parameter is invalid. |
EFI_NOT_FOUND | Cannot find the corresponding variable. |
EFI_OUT_OF_RESOURCES | Fail to finish the operation due to lack of resources. |
Definition at line 2060 of file IScsiConfig.c.
EFI_STATUS IScsiConfigDeleteAttempts | ( | IN ISCSI_CONFIG_IFR_NVDATA * | IfrNvData | ) |
Callback function when user presses "Commit Changes and Exit" in Delete Attempts or Delete Attempts by Keyword.
[in] | IfrNvData | The IFR NV data. |
EFI_NOT_FOUND | Cannot find the corresponding variable. |
EFI_SUCCESS | The operation is completed successfully. |
EFI_ABORTED | This operation is aborted cause of error configuration. |
EFI_OUT_OF_RESOURCES | Fail to finish the operation due to lack of resources. |
Definition at line 2236 of file IScsiConfig.c.
EFI_STATUS IScsiConfigDisplayDeleteAttempts | ( | IN ISCSI_CONFIG_IFR_NVDATA * | IfrNvData | ) |
Callback function when user presses "Delete Attempts".
[in] | IfrNvData | The IFR nv data. |
EFI_INVALID_PARAMETER | Any parameter is invalid. |
EFI_BUFFER_TOO_SMALL | The buffer in UpdateData is too small. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 2424 of file IScsiConfig.c.
EFI_STATUS IScsiConfigDisplayOrderAttempts | ( | VOID | ) |
Callback function when user presses "Change Attempt Order".
EFI_INVALID_PARAMETER | Any parameter is invalid. |
EFI_OUT_OF_RESOURCES | Does not have sufficient resources to finish this operation. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 2511 of file IScsiConfig.c.
EFI_STATUS IScsiConfigFormInit | ( | IN EFI_HANDLE | DriverBindingHandle | ) |
Initialize the iSCSI configuration form.
[in] | DriverBindingHandle | The iSCSI driverbinding handle. |
EFI_SUCCESS | The iSCSI configuration form is initialized. |
EFI_OUT_OF_RESOURCES | Failed to allocate memory. |
Definition at line 3806 of file IScsiConfig.c.
EFI_STATUS IScsiConfigFormUnload | ( | IN EFI_HANDLE | DriverBindingHandle | ) |
Unload the iSCSI configuration form, this includes: delete all the iSCSI configuration entries, uninstall the form callback protocol, and free the resources used.
[in] | DriverBindingHandle | The iSCSI driverbinding handle. |
EFI_SUCCESS | The iSCSI configuration form is unloaded. |
Others | Failed to unload the form. |
Definition at line 3878 of file IScsiConfig.c.
ISCSI_ATTEMPT_CONFIG_NVDATA * IScsiConfigGetAttemptByConfigIndex | ( | IN UINT8 | AttemptConfigIndex | ) |
Get the attempt config data from global structure by the ConfigIndex.
[in] | AttemptConfigIndex | The unique index indicates the attempt. |
NULL | The attempt configuration data cannot be found. |
Definition at line 391 of file IScsiConfig.c.
ISCSI_ATTEMPT_CONFIG_NVDATA * IScsiConfigGetAttemptByNic | ( | IN ISCSI_ATTEMPT_CONFIG_NVDATA * | NewAttempt, |
IN UINT8 | IScsiMode | ||
) |
Get the existing attempt config data from global structure by the NicIndex.
[in] | NewAttempt | The created new attempt |
[in] | IScsiMode | The IScsi Mode of the new attempt, Enabled or Enabled for MPIO. |
NULL | The attempt with NicIndex does not exist. |
Definition at line 421 of file IScsiConfig.c.
EFI_STATUS IScsiConfigOrderAttempts | ( | IN ISCSI_CONFIG_IFR_NVDATA * | IfrNvData | ) |
Callback function when user presses "Commit Changes and Exit" in Change Attempt Order or Change Attempt Order by Keyword.
[in] | IfrNvData | The IFR nv data. |
EFI_OUT_OF_RESOURCES | Does not have sufficient resources to finish this operation. |
EFI_NOT_FOUND | Cannot find the corresponding variable. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 2618 of file IScsiConfig.c.
EFI_STATUS IScsiConfigProcessDefault | ( | IN EFI_QUESTION_ID | KeyValue, |
IN ISCSI_CONFIG_IFR_NVDATA * | IfrNvData | ||
) |
Callback function when a user presses "Attempt *" or when a user selects a NIC to create the new attempt.
[in] | KeyValue | A unique value which is sent to the original exporting driver so that it can identify the type of data to expect. |
[in] | IfrNvData | The IFR nv data. |
EFI_OUT_OF_RESOURCES | Does not have sufficient resources to finish this operation. |
EFI_NOT_FOUND | Cannot find the corresponding variable. |
EFI_UNSUPPORTED | Can not create more attempts. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 2727 of file IScsiConfig.c.
VOID IScsiConfigUpdateAttempt | ( | VOID | ) |
Update the MAIN form to display the configured attempts.
Definition at line 1884 of file IScsiConfig.c.
VOID IScsiConvertAttemptConfigDataToIfrNvData | ( | IN ISCSI_ATTEMPT_CONFIG_NVDATA * | Attempt, |
IN OUT ISCSI_CONFIG_IFR_NVDATA * | IfrNvData | ||
) |
Convert the iSCSI configuration data into the IFR data.
[in] | Attempt | The iSCSI attempt config data. |
[in,out] | IfrNvData | The IFR nv data. |
Definition at line 510 of file IScsiConfig.c.
VOID EFIAPI IScsiConvertAttemptConfigDataToIfrNvDataByKeyword | ( | IN OUT ISCSI_CONFIG_IFR_NVDATA * | IfrNvData | ) |
Convert the iSCSI configuration data into the IFR data Which will be used to extract the iSCSI Keyword configuration in <ConfigAltResp> format.
[in,out] | IfrNvData | The IFR nv data. |
Definition at line 621 of file IScsiConfig.c.
EFI_STATUS IScsiConvertIfrNvDataToAttemptConfigData | ( | IN ISCSI_CONFIG_IFR_NVDATA * | IfrNvData, |
IN OUT ISCSI_ATTEMPT_CONFIG_NVDATA * | Attempt | ||
) |
Convert the IFR data to iSCSI configuration data.
[in] | IfrNvData | Point to ISCSI_CONFIG_IFR_NVDATA. |
[in,out] | Attempt | The iSCSI attempt config data. |
EFI_INVALID_PARAMETER | Any input or configured parameter is invalid. |
EFI_NOT_FOUND | Cannot find the corresponding variable. |
EFI_OUT_OF_RESOURCES | The operation is failed due to lack of resources. |
EFI_ABORTED | The operation is aborted. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 786 of file IScsiConfig.c.
EFI_STATUS IScsiConvertIsIdToString | ( | OUT CHAR16 * | String, |
IN UINT8 * | IsId | ||
) |
Convert IsId from binary to string format.
[out] | String | The buffer to store the converted string. |
[in] | IsId | The buffer to store IsId. |
EFI_SUCCESS | The string converted successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
Definition at line 251 of file IScsiConfig.c.
EFI_STATUS IScsiConvertlfrNvDataToAttemptConfigDataByKeyword | ( | IN ISCSI_CONFIG_IFR_NVDATA * | IfrNvData, |
IN UINTN | OffSet | ||
) |
Convert the IFR data configured by keyword to iSCSI configuration data.
[in] | IfrNvData | Point to ISCSI_CONFIG_IFR_NVDATA. |
[in] | OffSet | The offset of the variable to the configuration structure. |
EFI_INVALID_PARAMETER | Any input or configured parameter is invalid. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 1218 of file IScsiConfig.c.
EFI_STATUS IScsiCreateOpCode | ( | IN UINT16 | StartLabelNumber, |
OUT VOID ** | StartOpCodeHandle, | ||
OUT EFI_IFR_GUID_LABEL ** | StartLabel, | ||
OUT VOID ** | EndOpCodeHandle, | ||
OUT EFI_IFR_GUID_LABEL ** | EndLabel | ||
) |
Create Hii Extend Label OpCode as the start opcode and end opcode. It is a help function.
[in] | StartLabelNumber | The number of start label. |
[out] | StartOpCodeHandle | Points to the start opcode handle. |
[out] | StartLabel | Points to the created start opcode. |
[out] | EndOpCodeHandle | Points to the end opcode handle. |
[out] | EndLabel | Points to the created end opcode. |
EFI_OUT_OF_RESOURCES | Do not have sufficient resource to finish this operation. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
EFI_SUCCESS | The operation is completed successfully. |
Definition at line 1796 of file IScsiConfig.c.
EFI_STATUS EFIAPI IScsiFormCallback | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN EFI_BROWSER_ACTION | Action, | ||
IN EFI_QUESTION_ID | QuestionId, | ||
IN UINT8 | Type, | ||
IN OUT EFI_IFR_TYPE_VALUE * | Value, | ||
OUT EFI_BROWSER_ACTION_REQUEST * | ActionRequest | ||
) |
This function is called to provide results data to the driver. This data consists of a unique key that is used to identify which data is either being passed back or being asked for.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Action | Specifies the type of action taken by the browser. |
[in] | QuestionId | A unique value which is sent to the original exporting driver so that it can identify the type of data to expect. The format of the data tends to vary based on the opcode that generated the callback. |
[in] | Type | The type of value for the question. |
[in,out] | Value | A pointer to the data being sent to the original exporting driver. |
[out] | ActionRequest | On return, points to the action requested by the callback function. |
EFI_SUCCESS | The callback successfully handled the action. |
EFI_OUT_OF_RESOURCES | Not enough storage is available to hold the variable and its data. |
EFI_DEVICE_ERROR | The variable could not be saved. |
EFI_UNSUPPORTED | The specified Action is not supported by the callback. |
Definition at line 3385 of file IScsiConfig.c.
EFI_STATUS EFIAPI IScsiFormExtractConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Request, | ||
OUT EFI_STRING * | Progress, | ||
OUT EFI_STRING * | Results | ||
) |
This function allows the caller to request the current configuration for one or more named elements. The resulting string is in <ConfigAltResp> format. Also, any and all alternative configuration strings shall be appended to the end of the current configuration string. If they are, they must appear after the current configuration. They must contain the same routing (GUID, NAME, PATH) as the current configuration string. They must have an additional description indicating the type of alternative configuration the string represents, "ALTCFG=<StringToken>". That <StringToken> (when converted from Hex UNICODE to binary) is a reference to a string in the associated string pack.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Request | A null-terminated Unicode string in <ConfigRequest> format. Note that this includes the routing information as well as the configurable name / value pairs. It is invalid for this string to be in <MultiConfigRequest> format. |
[out] | Progress | On return, points to a character in the Request string. Points to the string's null terminator if request was successful. Points to the most recent "&" before the first failing name / value pair (or the beginning of the string if the failure is in the first name / value pair) if the request was not successful. |
[out] | Results | A null-terminated Unicode string in <ConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function. |
EFI_SUCCESS | The Results string is filled with the values corresponding to all requested names. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the parts of the results that must be stored awaiting possible future protocols. |
EFI_INVALID_PARAMETER | For example, passing in a NULL for the Request parameter would result in this type of error. In this case, the Progress parameter would be set to NULL. |
EFI_NOT_FOUND | Routing data doesn't match any known driver. Progress set to the first character in the routing header. Note: There is no requirement that the driver validate the routing data. It must skip the <ConfigHdr> in order to process the names. |
EFI_INVALID_PARAMETER | Illegal syntax. Progress set to most recent "&" before the error or the beginning of the string. |
EFI_INVALID_PARAMETER | Unknown name. Progress points to the & before the name in question. |
Definition at line 2979 of file IScsiConfig.c.
EFI_STATUS EFIAPI IScsiFormRouteConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Configuration, | ||
OUT EFI_STRING * | Progress | ||
) |
This function applies changes in a driver's configuration. Input is a Configuration, which has the routing data for this driver followed by name / value configuration pairs. The driver must apply those pairs to its configurable storage. If the driver's configuration is stored in a linear block of data and the driver's name / value pairs are in <BlockConfig> format, it may use the ConfigToBlock helper function (above) to simplify the job.
[in] | This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
[in] | Configuration | A null-terminated Unicode string in <ConfigString> format. |
[out] | Progress | A pointer to a string filled in with the offset of the most recent '&' before the first failing name / value pair (or the beginning of the string if the failure is in the first name / value pair) or the terminating NULL if all was successful. |
EFI_SUCCESS | The results have been distributed or are awaiting distribution. |
EFI_OUT_OF_RESOURCES | Not enough memory to store the parts of the results that must be stored awaiting possible future protocols. |
EFI_INVALID_PARAMETERS | Passing in a NULL for the Results parameter would result in this type of error. |
EFI_NOT_FOUND | Target for the specified routing data was not found. |
Definition at line 3141 of file IScsiConfig.c.
EFI_STATUS IScsiGetAttemptIndexList | ( | IN CHAR16 * | AttemptNameList, |
OUT UINT8 * | AttemptIndexList, | ||
IN BOOLEAN | IsAddAttempts | ||
) |
Extract the Index of the attempt list.
[in] | AttemptNameList | The Name list of the Attempts. |
[out] | AttemptIndexList | The Index list of the Attempts. |
[in] | IsAddAttempts | If TRUE, Indicates add one or more attempts. If FALSE, Indicates delete attempts or change attempt order. |
EFI_SUCCESS | The Attempt list is valid. |
EFI_INVALID_PARAMETERS | The Attempt List is invalid. |
Definition at line 454 of file IScsiConfig.c.
EFI_STATUS IScsiGetValue | ( | IN CONST EFI_STRING | Configuration, |
IN CHAR16 * | String, | ||
OUT UINTN * | Value | ||
) |
Get the Offset value specified by the input String.
[in] | Configuration | A null-terminated Unicode string in <ConfigString> format. |
[in] | String | The string is "&OFFSET=". |
[out] | Value | The Offset value. |
EFI_OUT_OF_RESOURCES | Insufficient resources to store necessary structures. |
EFI_SUCCESS | Value of <Number> is outputted in Number successfully. |
Definition at line 303 of file IScsiConfig.c.
VOID IScsiIpToStr | ( | IN EFI_IP_ADDRESS * | Ip, |
IN BOOLEAN | Ipv6Flag, | ||
OUT CHAR16 * | Str | ||
) |
Convert the IP address into a dotted string.
[in] | Ip | The IP address. |
[in] | Ipv6Flag | Indicates whether the IP address is version 4 or version 6. |
[out] | Str | The formatted IP string. |
Definition at line 45 of file IScsiConfig.c.
EFI_STATUS IScsiParseIsIdFromString | ( | IN CONST CHAR16 * | String, |
IN OUT UINT8 * | IsId | ||
) |
Parse IsId in string format and convert it to binary.
[in] | String | The buffer of the string to be parsed. |
[in,out] | IsId | The buffer to store IsId. |
EFI_SUCCESS | The operation finished successfully. |
EFI_INVALID_PARAMETER | Any input parameter is invalid. |
Definition at line 183 of file IScsiConfig.c.
ISCSI_FORM_CALLBACK_INFO* mCallbackInfo = NULL |
Definition at line 12 of file IScsiConfig.c.
HII_VENDOR_DEVICE_PATH mIScsiHiiVendorDevicePath |
Definition at line 14 of file IScsiConfig.c.
CHAR16 mVendorStorageName[] = L"ISCSI_CONFIG_IFR_NVDATA" |
Definition at line 11 of file IScsiConfig.c.