Subrata Banik | 20fe24b | 2021-12-09 02:46:38 +0530 | [diff] [blame] | 1 | /** @file |
| 2 | EFI_ISCSI_INITIATOR_NAME_PROTOCOL as defined in UEFI 2.0. |
| 3 | It provides the ability to get and set the iSCSI Initiator Name. |
| 4 | |
| 5 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> |
| 6 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 7 | |
| 8 | **/ |
| 9 | |
| 10 | #ifndef __ISCSI_INITIATOR_NAME_H__ |
| 11 | #define __ISCSI_INITIATOR_NAME_H__ |
| 12 | |
| 13 | #define EFI_ISCSI_INITIATOR_NAME_PROTOCOL_GUID \ |
| 14 | { \ |
| 15 | 0x59324945, 0xec44, 0x4c0d, {0xb1, 0xcd, 0x9d, 0xb1, 0x39, 0xdf, 0x7, 0xc } \ |
| 16 | } |
| 17 | |
| 18 | typedef struct _EFI_ISCSI_INITIATOR_NAME_PROTOCOL EFI_ISCSI_INITIATOR_NAME_PROTOCOL; |
| 19 | |
| 20 | /** |
| 21 | Retrieves the current set value of iSCSI Initiator Name. |
| 22 | |
| 23 | @param This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance. |
| 24 | @param BufferSize Size of the buffer in bytes pointed to by Buffer / Actual size of the |
| 25 | variable data buffer. |
| 26 | @param Buffer Pointer to the buffer for data to be read. The data is a null-terminated UTF-8 encoded string. |
| 27 | The maximum length is 223 characters, including the null-terminator. |
| 28 | |
| 29 | @retval EFI_SUCCESS Data was successfully retrieved into the provided buffer and the |
| 30 | BufferSize was sufficient to handle the iSCSI initiator name |
| 31 | @retval EFI_BUFFER_TOO_SMALL BufferSize is too small for the result. |
| 32 | @retval EFI_INVALID_PARAMETER BufferSize or Buffer is NULL. |
| 33 | @retval EFI_DEVICE_ERROR The iSCSI initiator name could not be retrieved due to a hardware error. |
| 34 | |
| 35 | **/ |
| 36 | typedef |
| 37 | EFI_STATUS |
| 38 | (EFIAPI *EFI_ISCSI_INITIATOR_NAME_GET)( |
| 39 | IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This, |
| 40 | IN OUT UINTN *BufferSize, |
| 41 | OUT VOID *Buffer |
| 42 | ); |
| 43 | |
| 44 | |
| 45 | |
| 46 | /** |
| 47 | Sets the iSCSI Initiator Name. |
| 48 | |
| 49 | @param This Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance. |
| 50 | @param BufferSize Size of the buffer in bytes pointed to by Buffer. |
| 51 | @param Buffer Pointer to the buffer for data to be written. The data is a null-terminated UTF-8 encoded string. |
| 52 | The maximum length is 223 characters, including the null-terminator. |
| 53 | |
| 54 | @retval EFI_SUCCESS Data was successfully stored by the protocol. |
| 55 | @retval EFI_UNSUPPORTED Platform policies do not allow for data to be written. |
| 56 | @retval EFI_INVALID_PARAMETER BufferSize or Buffer is NULL, or BufferSize exceeds the maximum allowed limit. |
| 57 | @retval EFI_DEVICE_ERROR The data could not be stored due to a hardware error. |
| 58 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data. |
| 59 | @retval EFI_PROTOCOL_ERROR Input iSCSI initiator name does not adhere to RFC 3720 |
| 60 | (and other related protocols) |
| 61 | |
| 62 | **/ |
| 63 | typedef EFI_STATUS |
| 64 | (EFIAPI *EFI_ISCSI_INITIATOR_NAME_SET)( |
| 65 | IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This, |
| 66 | IN OUT UINTN *BufferSize, |
| 67 | IN VOID *Buffer |
| 68 | ); |
| 69 | |
| 70 | /// |
| 71 | /// iSCSI Initiator Name Protocol for setting and obtaining the iSCSI Initiator Name. |
| 72 | /// |
| 73 | struct _EFI_ISCSI_INITIATOR_NAME_PROTOCOL { |
| 74 | EFI_ISCSI_INITIATOR_NAME_GET Get; |
| 75 | EFI_ISCSI_INITIATOR_NAME_SET Set; |
| 76 | }; |
| 77 | |
| 78 | extern EFI_GUID gEfiIScsiInitiatorNameProtocolGuid; |
| 79 | |
| 80 | #endif |
| 81 | |