From: Adriano Cordova <adrianox@gmail.com>
To: u-boot@lists.denx.de
Cc: joe.hershberger@ni.com, rfried.dev@gmail.com,
jerome.forissier@linaro.org, xypron.glpk@gmx.de,
ilias.apalodimas@linaro.org, Adriano Cordova <adrianox@gmail.com>
Subject: [PATCH v4 05/14] efi_api: add definitions for HTTP and IP4_CONFIG2 protocols
Date: Mon, 18 Nov 2024 18:08:59 -0300 [thread overview]
Message-ID: <20241118210908.51196-6-adrianox@gmail.com> (raw)
In-Reply-To: <20241118210908.51196-1-adrianox@gmail.com>
Add EFI definitions for EFI_IP4_CONFIG2_PROTOCOL,
EFI_HTTP_SERVICE_BINDING_PROTOCOL, and EFI_HTTP_PROTOCOL.
According to UEFI spec 2.10.
Signed-off-by: Adriano Cordova <adrianox@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
(no changes since v2)
include/efi_api.h | 203 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 203 insertions(+)
diff --git a/include/efi_api.h b/include/efi_api.h
index 99ee749522..61c4eda8f8 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -1725,6 +1725,209 @@ struct efi_pxe_base_code_protocol {
struct efi_pxe_mode *mode;
};
+#define EFI_IP4_CONFIG2_PROTOCOL_GUID \
+ EFI_GUID(0x5b446ed1, 0xe30b, 0x4faa, \
+ 0x87, 0x1a, 0x36, 0x54, 0xec, 0xa3, 0x60, 0x80)
+
+enum efi_ip4_config2_data_type {
+ EFI_IP4_CONFIG2_DATA_TYPE_INTERFACEINFO,
+ EFI_IP4_CONFIG2_DATA_TYPE_POLICY,
+ EFI_IP4_CONFIG2_DATA_TYPE_MANUAL_ADDRESS,
+ EFI_IP4_CONFIG2_DATA_TYPE_GATEWAY,
+ EFI_IP4_CONFIG2_DATA_TYPE_DNSSERVER,
+ EFI_IP4_CONFIG2_DATA_TYPE_MAXIMUM,
+};
+
+struct efi_ip4_config2_protocol {
+ efi_status_t (EFIAPI * set_data)(struct efi_ip4_config2_protocol *this,
+ enum efi_ip4_config2_data_type data_type,
+ efi_uintn_t data_size,
+ void *data);
+ efi_status_t (EFIAPI * get_data)(struct efi_ip4_config2_protocol *this,
+ enum efi_ip4_config2_data_type data_type,
+ efi_uintn_t *data_size,
+ void *data);
+ efi_status_t (EFIAPI * register_data_notify)(struct efi_ip4_config2_protocol *this,
+ enum efi_ip4_config2_data_type data_type,
+ struct efi_event *event);
+ efi_status_t (EFIAPI * unregister_data_notify)(struct efi_ip4_config2_protocol *this,
+ enum efi_ip4_config2_data_type data_type,
+ struct efi_event *event);
+};
+
+struct efi_ip4_route_table {
+ struct efi_ipv4_address subnet_address;
+ struct efi_ipv4_address subnet_mask;
+ struct efi_ipv4_address gateway_address;
+};
+
+#define EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE 32
+
+struct efi_ip4_config2_interface_info {
+ u16 name[EFI_IP4_CONFIG2_INTERFACE_INFO_NAME_SIZE];
+ u8 if_type;
+ u32 hw_address_size;
+ struct efi_mac_address hw_address;
+ struct efi_ipv4_address station_address;
+ struct efi_ipv4_address subnet_mask;
+ u32 route_table_size;
+ struct efi_ip4_route_table *route_table;
+};
+
+enum efi_ip4_config2_policy {
+ EFI_IP4_CONFIG2_POLICY_STATIC,
+ EFI_IP4_CONFIG2_POLICY_DHCP,
+ EFI_IP4_CONFIG2_POLICY_MAX
+};
+
+struct efi_ip4_config2_manual_address {
+ struct efi_ipv4_address address;
+ struct efi_ipv4_address subnet_mask;
+};
+
+#define EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID \
+ EFI_GUID(0xbdc8e6af, 0xd9bc, 0x4379, \
+ 0xa7, 0x2a, 0xe0, 0xc4, 0xe7, 0x5d, 0xae, 0x1c)
+
+struct efi_service_binding_protocol {
+ efi_status_t (EFIAPI * create_child)(struct efi_service_binding_protocol *this,
+ efi_handle_t *child_handle);
+ efi_status_t (EFIAPI * destroy_child)(struct efi_service_binding_protocol *this,
+ efi_handle_t child_handle);
+};
+
+#define EFI_HTTP_PROTOCOL_GUID \
+ EFI_GUID(0x7A59B29B, 0x910B, 0x4171, \
+ 0x82, 0x42, 0xA8, 0x5A, 0x0D, 0xF2, 0x5B, 0x5B)
+
+enum efi_http_version {
+ HTTPVERSION10,
+ HTTPVERSION11,
+ HTTPVERSIONUNSUPPORTED
+};
+
+struct efi_httpv4_access_point {
+ bool use_default_address;
+ struct efi_ipv4_address local_address;
+ struct efi_ipv4_address local_subnet;
+ u16 local_port;
+};
+
+union efi_http_access_point {
+ struct efi_httpv4_access_point *ipv4_node;
+ struct efi_httpv6_access_point *ipv6_node;
+};
+
+struct efi_http_config_data {
+ enum efi_http_version http_version;
+ u32 timeout;
+ bool is_ipv6;
+ union efi_http_access_point access_point;
+};
+
+enum efi_http_method {
+ HTTP_METHOD_GET,
+ HTTP_METHOD_POST,
+ HTTP_METHOD_PATCH,
+ HTTP_METHOD_OPTIONS,
+ HTTP_METHOD_CONNECT,
+ HTTP_METHOD_HEAD,
+ HTTP_METHOD_PUT,
+ HTTP_METHOD_DELETE,
+ HTTP_METHOD_TRACE,
+ HTTP_METHOD_MAX
+};
+
+enum efi_http_status_code {
+ HTTP_STATUS_UNSUPPORTED_STATUS = 0,
+ HTTP_STATUS_100_CONTINUE,
+ HTTP_STATUS_101_SWITCHING_PROTOCOLS,
+ HTTP_STATUS_200_OK,
+ HTTP_STATUS_201_CREATED,
+ HTTP_STATUS_202_ACCEPTED,
+ HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION,
+ HTTP_STATUS_204_NO_CONTENT,
+ HTTP_STATUS_205_RESET_CONTENT,
+ HTTP_STATUS_206_PARTIAL_CONTENT,
+ HTTP_STATUS_300_MULTIPLE_CHOICES,
+ HTTP_STATUS_301_MOVED_PERMANENTLY,
+ HTTP_STATUS_302_FOUND,
+ HTTP_STATUS_303_SEE_OTHER,
+ HTTP_STATUS_304_NOT_MODIFIED,
+ HTTP_STATUS_305_USE_PROXY,
+ HTTP_STATUS_307_TEMPORARY_REDIRECT,
+ HTTP_STATUS_400_BAD_REQUEST,
+ HTTP_STATUS_401_UNAUTHORIZED,
+ HTTP_STATUS_402_PAYMENT_REQUIRED,
+ HTTP_STATUS_403_FORBIDDEN,
+ HTTP_STATUS_404_NOT_FOUND,
+ HTTP_STATUS_405_METHOD_NOT_ALLOWED,
+ HTTP_STATUS_406_NOT_ACCEPTABLE,
+ HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED,
+ HTTP_STATUS_408_REQUEST_TIME_OUT,
+ HTTP_STATUS_409_CONFLICT,
+ HTTP_STATUS_410_GONE,
+ HTTP_STATUS_411_LENGTH_REQUIRED,
+ HTTP_STATUS_412_PRECONDITION_FAILED,
+ HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE,
+ HTTP_STATUS_414_REQUEST_URI_TOO_LARGE,
+ HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE,
+ HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED,
+ HTTP_STATUS_417_EXPECTATION_FAILED,
+ HTTP_STATUS_500_INTERNAL_SERVER_ERROR,
+ HTTP_STATUS_501_NOT_IMPLEMENTED,
+ HTTP_STATUS_502_BAD_GATEWAY,
+ HTTP_STATUS_503_SERVICE_UNAVAILABLE,
+ HTTP_STATUS_504_GATEWAY_TIME_OUT,
+ HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED,
+ HTTP_STATUS_308_PERMANENT_REDIRECT
+};
+
+struct efi_http_request_data {
+ enum efi_http_method method;
+ u16 *url;
+};
+
+struct efi_http_response_data {
+ enum efi_http_status_code status_code;
+};
+
+struct efi_http_header {
+ char *field_name;
+ char *field_value;
+};
+
+struct efi_http_message {
+ union {
+ struct efi_http_request_data *request;
+ struct efi_http_response_data *response;
+ } data;
+ efi_uintn_t header_count;
+ struct efi_http_header *headers;
+ efi_uintn_t body_length;
+ void *body;
+};
+
+struct efi_http_token {
+ struct efi_event *event;
+ efi_status_t status;
+ struct efi_http_message *message;
+};
+
+struct efi_http_protocol {
+ efi_status_t (EFIAPI * get_mode_data)(struct efi_http_protocol *this,
+ struct efi_http_config_data *data);
+ efi_status_t (EFIAPI * configure)(struct efi_http_protocol *this,
+ struct efi_http_config_data *data);
+ efi_status_t (EFIAPI * request)(struct efi_http_protocol *this,
+ struct efi_http_token *token);
+ efi_status_t (EFIAPI * cancel)(struct efi_http_protocol *this,
+ struct efi_http_token *token);
+ efi_status_t (EFIAPI * response)(struct efi_http_protocol *this,
+ struct efi_http_token *token);
+ efi_status_t (EFIAPI * poll)(struct efi_http_protocol *this);
+};
+
#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
EFI_GUID(0x964e5b22, 0x6459, 0x11d2, \
0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
--
2.43.0
next prev parent reply other threads:[~2024-11-18 21:10 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 21:08 [PATCH v4 00/14] efi_loader: efi http and ipconfig drivers Adriano Cordova
2024-11-18 21:08 ` [PATCH v4 01/14] net: wget: let wget_with_dns work with dns disabled Adriano Cordova
2024-11-19 9:27 ` Heinrich Schuchardt
2024-11-20 14:50 ` Adriano Córdova
2024-11-19 9:29 ` Jerome Forissier
2024-11-18 21:08 ` [PATCH v4 02/14] efi_loader: device_path: add definition of DEVICE_PATH_SUB_TYPE_MSG_IPV4 Adriano Cordova
2024-11-18 21:08 ` [PATCH v4 03/14] efi_loader: device_path: add efi_dp_from_ipv4 Adriano Cordova
2024-11-19 9:50 ` Heinrich Schuchardt
2024-11-19 10:34 ` Ilias Apalodimas
2024-11-19 11:01 ` Heinrich Schuchardt
2024-11-20 14:55 ` Adriano Córdova
2024-11-20 15:22 ` Heinrich Schuchardt
2024-11-18 21:08 ` [PATCH v4 04/14] efi_loader: add IPv4() to device path to text protocol Adriano Cordova
2024-11-22 12:01 ` Ilias Apalodimas
2024-11-18 21:08 ` Adriano Cordova [this message]
2024-11-18 21:09 ` [PATCH v4 06/14] efi_loader: efi_net: add efi_net_set_addr, efi_net_get_addr Adriano Cordova
2024-11-22 12:18 ` Ilias Apalodimas
2024-11-18 21:09 ` [PATCH v4 07/14] efi_loader: device_path: add support for HTTP device path Adriano Cordova
2024-11-19 10:14 ` Heinrich Schuchardt
2024-11-20 14:52 ` Adriano Córdova
2024-11-20 16:07 ` Heinrich Schuchardt
2024-11-20 17:00 ` Jerome Forissier
2024-11-21 7:36 ` Ilias Apalodimas
2024-11-18 21:09 ` [PATCH v4 08/14] efi_loader: net: set EFI bootdevice device path to HTTP when loaded from wget Adriano Cordova
2024-11-19 10:29 ` Heinrich Schuchardt
2024-11-18 21:09 ` [PATCH v4 09/14] efi_loader: net: add support to send http requests and parse http headers Adriano Cordova
2024-11-18 21:09 ` [PATCH v4 10/14] efi_loader: efi_net: add EFI_IP4_CONFIG2_PROTOCOL Adriano Cordova
2024-11-18 21:09 ` [PATCH v4 11/14] efi_loader: efi_net: add EFI_HTTP_PROTOCOL Adriano Cordova
2024-11-18 21:09 ` [PATCH v4 12/14] lib: uuid: display HTTP and IPV4 Config II protocols Adriano Cordova
2024-11-18 21:09 ` [PATCH v4 13/14] efi_selftest: add test for HTTP protocol Adriano Cordova
2024-11-18 21:09 ` [PATCH v4 14/14] efi_selftest: add test for IPv4 Config2 protocol Adriano Cordova
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241118210908.51196-6-adrianox@gmail.com \
--to=adrianox@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=joe.hershberger@ni.com \
--cc=rfried.dev@gmail.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox