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