AKASHI Takahiro | ca8aa71 | 2019-01-21 12:13:00 +0900 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
Heinrich Schuchardt | 2a2654f | 2020-12-07 18:20:57 +0100 | [diff] [blame] | 3 | * EFI Human Interface Infrastructure ... Configuration |
| 4 | * |
| 5 | * Copyright (c) 2017 Leif Lindholm |
| 6 | * Copyright (c) 2018 AKASHI Takahiro, Linaro Limited |
AKASHI Takahiro | ca8aa71 | 2019-01-21 12:13:00 +0900 | [diff] [blame] | 7 | * |
Heinrich Schuchardt | 2a2654f | 2020-12-07 18:20:57 +0100 | [diff] [blame] | 8 | * As this is still a non-working stub and the protocol is neither required |
| 9 | * by the EFI shell nor by the UEFI SCT this module has been removed from |
| 10 | * the Makefile. |
AKASHI Takahiro | ca8aa71 | 2019-01-21 12:13:00 +0900 | [diff] [blame] | 11 | */ |
| 12 | |
AKASHI Takahiro | ca8aa71 | 2019-01-21 12:13:00 +0900 | [diff] [blame] | 13 | #include <efi_loader.h> |
| 14 | |
| 15 | const efi_guid_t efi_guid_hii_config_routing_protocol |
| 16 | = EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID; |
| 17 | const efi_guid_t efi_guid_hii_config_access_protocol |
| 18 | = EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID; |
| 19 | |
| 20 | /* |
| 21 | * EFI_HII_CONFIG_ROUTING_PROTOCOL |
| 22 | */ |
| 23 | |
| 24 | static efi_status_t EFIAPI |
| 25 | extract_config(const struct efi_hii_config_routing_protocol *this, |
| 26 | const efi_string_t request, |
| 27 | efi_string_t *progress, |
| 28 | efi_string_t *results) |
| 29 | { |
| 30 | EFI_ENTRY("%p, \"%ls\", %p, %p", this, request, progress, results); |
| 31 | |
| 32 | return EFI_EXIT(EFI_OUT_OF_RESOURCES); |
| 33 | } |
| 34 | |
| 35 | static efi_status_t EFIAPI |
| 36 | export_config(const struct efi_hii_config_routing_protocol *this, |
| 37 | efi_string_t *results) |
| 38 | { |
| 39 | EFI_ENTRY("%p, %p", this, results); |
| 40 | |
| 41 | return EFI_EXIT(EFI_OUT_OF_RESOURCES); |
| 42 | } |
| 43 | |
| 44 | static efi_status_t EFIAPI |
| 45 | route_config(const struct efi_hii_config_routing_protocol *this, |
| 46 | const efi_string_t configuration, |
| 47 | efi_string_t *progress) |
| 48 | { |
| 49 | EFI_ENTRY("%p, \"%ls\", %p", this, configuration, progress); |
| 50 | |
| 51 | return EFI_EXIT(EFI_OUT_OF_RESOURCES); |
| 52 | } |
| 53 | |
| 54 | static efi_status_t EFIAPI |
| 55 | block_to_config(const struct efi_hii_config_routing_protocol *this, |
| 56 | const efi_string_t config_request, |
| 57 | const u8 *block, |
| 58 | const efi_uintn_t block_size, |
| 59 | efi_string_t *config, |
| 60 | efi_string_t *progress) |
| 61 | { |
| 62 | EFI_ENTRY("%p, \"%ls\", %p, %zu, %p, %p", this, config_request, |
| 63 | block, block_size, config, progress); |
| 64 | |
| 65 | return EFI_EXIT(EFI_OUT_OF_RESOURCES); |
| 66 | } |
| 67 | |
| 68 | static efi_status_t EFIAPI |
| 69 | config_to_block(const struct efi_hii_config_routing_protocol *this, |
| 70 | const efi_string_t config_resp, |
| 71 | const u8 *block, |
| 72 | const efi_uintn_t *block_size, |
| 73 | efi_string_t *progress) |
| 74 | { |
| 75 | EFI_ENTRY("%p, \"%ls\", %p, %p, %p", this, config_resp, |
| 76 | block, block_size, progress); |
| 77 | |
| 78 | return EFI_EXIT(EFI_OUT_OF_RESOURCES); |
| 79 | } |
| 80 | |
| 81 | static efi_status_t EFIAPI |
| 82 | get_alt_config(const struct efi_hii_config_routing_protocol *this, |
| 83 | const efi_string_t config_resp, |
| 84 | const efi_guid_t *guid, |
| 85 | const efi_string_t name, |
| 86 | const struct efi_device_path *device_path, |
| 87 | const efi_string_t alt_cfg_id, |
| 88 | efi_string_t *alt_cfg_resp) |
| 89 | { |
Heinrich Schuchardt | 282249d | 2022-01-16 14:15:31 +0100 | [diff] [blame] | 90 | EFI_ENTRY("%p, \"%ls\", %pUs, \"%ls\", %p, \"%ls\", %p", |
AKASHI Takahiro | ca8aa71 | 2019-01-21 12:13:00 +0900 | [diff] [blame] | 91 | this, config_resp, guid, name, device_path, |
| 92 | alt_cfg_id, alt_cfg_resp); |
| 93 | |
| 94 | return EFI_EXIT(EFI_OUT_OF_RESOURCES); |
| 95 | } |
| 96 | |
| 97 | /* |
| 98 | * EFI_HII_ACCESS_PROTOCOL |
| 99 | */ |
| 100 | |
| 101 | efi_status_t EFIAPI |
| 102 | extract_config_access(const struct efi_hii_config_access_protocol *this, |
| 103 | const efi_string_t request, |
| 104 | efi_string_t *progress, |
| 105 | efi_string_t *results) |
| 106 | { |
| 107 | EFI_ENTRY("%p, \"%ls\", %p, %p", this, request, progress, results); |
| 108 | |
| 109 | return EFI_EXIT(EFI_OUT_OF_RESOURCES); |
| 110 | }; |
| 111 | |
| 112 | efi_status_t EFIAPI |
| 113 | route_config_access(const struct efi_hii_config_access_protocol *this, |
| 114 | const efi_string_t configuration, |
| 115 | efi_string_t *progress) |
| 116 | { |
| 117 | EFI_ENTRY("%p, \"%ls\", %p", this, configuration, progress); |
| 118 | |
| 119 | return EFI_EXIT(EFI_OUT_OF_RESOURCES); |
| 120 | }; |
| 121 | |
| 122 | efi_status_t EFIAPI |
| 123 | form_callback(const struct efi_hii_config_access_protocol *this, |
| 124 | efi_browser_action_t action, |
| 125 | efi_question_id_t question_id, |
| 126 | u8 type, |
| 127 | union efi_ifr_type_value *value, |
| 128 | efi_browser_action_request_t *action_request) |
| 129 | { |
Heinrich Schuchardt | 4b6f19f | 2019-01-23 22:55:36 +0100 | [diff] [blame] | 130 | EFI_ENTRY("%p, 0x%zx, 0x%x, 0x%x, %p, %p", this, action, |
AKASHI Takahiro | ca8aa71 | 2019-01-21 12:13:00 +0900 | [diff] [blame] | 131 | question_id, type, value, action_request); |
| 132 | |
| 133 | return EFI_EXIT(EFI_DEVICE_ERROR); |
| 134 | }; |
| 135 | |
| 136 | const struct efi_hii_config_routing_protocol efi_hii_config_routing = { |
| 137 | .extract_config = extract_config, |
| 138 | .export_config = export_config, |
| 139 | .route_config = route_config, |
| 140 | .block_to_config = block_to_config, |
| 141 | .config_to_block = config_to_block, |
| 142 | .get_alt_config = get_alt_config |
| 143 | }; |
| 144 | |
| 145 | const struct efi_hii_config_access_protocol efi_hii_config_access = { |
| 146 | .extract_config_access = extract_config_access, |
| 147 | .route_config_access = route_config_access, |
| 148 | .form_callback = form_callback |
| 149 | }; |