mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-17 10:24:49 +00:00
efi_loader: expose symbols to be used by the EFI network stack
The following symbols are exposed: - efi_reinstall_protocol_interface This is done so that the device path protocol interface of the network device can be changed internally by u-boot when a new bootfile gets downloaded. - eth_set_dev To support multiple network udevices - efi_close_event This comes in preparation to support unregistering an EFI network device from the EFI network stack when the underlying U-boot device gets removed - efi_[dis]connect_controller The EFI network driver uses ConnectController to add a NIC to the EFI network stack. - efi_uninstall_protocol_interface connect_controler for the efi network driver can install protocols, which need to be uninstalled in disconnect_controller - EFI_SIMPLE_NETWORK_PROTOCOL_GUID Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
This commit is contained in:
parent
908033ea22
commit
74829b4d93
5 changed files with 29 additions and 13 deletions
|
@ -321,6 +321,8 @@ extern const efi_guid_t efi_guid_host_dev;
|
||||||
#endif
|
#endif
|
||||||
/* GUID of the EFI_BLOCK_IO_PROTOCOL */
|
/* GUID of the EFI_BLOCK_IO_PROTOCOL */
|
||||||
extern const efi_guid_t efi_block_io_guid;
|
extern const efi_guid_t efi_block_io_guid;
|
||||||
|
/* GUID of the EFI_SIMPLE_NETWORK_PROTOCOL */
|
||||||
|
extern const efi_guid_t efi_net_guid;
|
||||||
extern const efi_guid_t efi_global_variable_guid;
|
extern const efi_guid_t efi_global_variable_guid;
|
||||||
extern const efi_guid_t efi_guid_console_control;
|
extern const efi_guid_t efi_guid_console_control;
|
||||||
extern const efi_guid_t efi_guid_device_path;
|
extern const efi_guid_t efi_guid_device_path;
|
||||||
|
@ -733,6 +735,10 @@ efi_status_t efi_search_protocol(const efi_handle_t handle,
|
||||||
efi_status_t efi_add_protocol(const efi_handle_t handle,
|
efi_status_t efi_add_protocol(const efi_handle_t handle,
|
||||||
const efi_guid_t *protocol,
|
const efi_guid_t *protocol,
|
||||||
void *protocol_interface);
|
void *protocol_interface);
|
||||||
|
/* Uninstall new protocol on a handle */
|
||||||
|
efi_status_t efi_uninstall_protocol
|
||||||
|
(efi_handle_t handle, const efi_guid_t *protocol,
|
||||||
|
void *protocol_interface, bool preserve);
|
||||||
/* Reinstall a protocol on a handle */
|
/* Reinstall a protocol on a handle */
|
||||||
efi_status_t EFIAPI efi_reinstall_protocol_interface(
|
efi_status_t EFIAPI efi_reinstall_protocol_interface(
|
||||||
efi_handle_t handle,
|
efi_handle_t handle,
|
||||||
|
@ -748,6 +754,15 @@ efi_status_t EFIAPI
|
||||||
efi_install_multiple_protocol_interfaces(efi_handle_t *handle, ...);
|
efi_install_multiple_protocol_interfaces(efi_handle_t *handle, ...);
|
||||||
efi_status_t EFIAPI
|
efi_status_t EFIAPI
|
||||||
efi_uninstall_multiple_protocol_interfaces(efi_handle_t handle, ...);
|
efi_uninstall_multiple_protocol_interfaces(efi_handle_t handle, ...);
|
||||||
|
/* Connect and disconnect controller */
|
||||||
|
efi_status_t EFIAPI efi_connect_controller(efi_handle_t controller_handle,
|
||||||
|
efi_handle_t *driver_image_handle,
|
||||||
|
struct efi_device_path *remain_device_path,
|
||||||
|
bool recursive);
|
||||||
|
efi_status_t EFIAPI efi_disconnect_controller(
|
||||||
|
efi_handle_t controller_handle,
|
||||||
|
efi_handle_t driver_image_handle,
|
||||||
|
efi_handle_t child_handle);
|
||||||
/* Get handles that support a given protocol */
|
/* Get handles that support a given protocol */
|
||||||
efi_status_t EFIAPI efi_locate_handle_buffer(
|
efi_status_t EFIAPI efi_locate_handle_buffer(
|
||||||
enum efi_locate_search_type search_type,
|
enum efi_locate_search_type search_type,
|
||||||
|
@ -768,6 +783,8 @@ efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
|
||||||
void *context),
|
void *context),
|
||||||
void *notify_context, const efi_guid_t *group,
|
void *notify_context, const efi_guid_t *group,
|
||||||
struct efi_event **event);
|
struct efi_event **event);
|
||||||
|
/* Call this to close an event */
|
||||||
|
efi_status_t EFIAPI efi_close_event(struct efi_event *event);
|
||||||
/* Call this to set a timer */
|
/* Call this to set a timer */
|
||||||
efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,
|
efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type,
|
||||||
uint64_t trigger_time);
|
uint64_t trigger_time);
|
||||||
|
|
|
@ -291,6 +291,7 @@ struct eth_ops {
|
||||||
#define eth_get_ops(dev) ((struct eth_ops *)(dev)->driver->ops)
|
#define eth_get_ops(dev) ((struct eth_ops *)(dev)->driver->ops)
|
||||||
|
|
||||||
struct udevice *eth_get_dev(void); /* get the current device */
|
struct udevice *eth_get_dev(void); /* get the current device */
|
||||||
|
void eth_set_dev(struct udevice *dev); /* set a device */
|
||||||
unsigned char *eth_get_ethaddr(void); /* get the current device MAC */
|
unsigned char *eth_get_ethaddr(void); /* get the current device MAC */
|
||||||
int eth_rx(void); /* Check for received packets */
|
int eth_rx(void); /* Check for received packets */
|
||||||
void eth_halt(void); /* stop SCC */
|
void eth_halt(void); /* stop SCC */
|
||||||
|
|
|
@ -60,7 +60,7 @@ static efi_handle_t current_image;
|
||||||
static volatile gd_t *efi_gd, *app_gd;
|
static volatile gd_t *efi_gd, *app_gd;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static efi_status_t efi_uninstall_protocol
|
efi_status_t efi_uninstall_protocol
|
||||||
(efi_handle_t handle, const efi_guid_t *protocol,
|
(efi_handle_t handle, const efi_guid_t *protocol,
|
||||||
void *protocol_interface, bool preserve);
|
void *protocol_interface, bool preserve);
|
||||||
|
|
||||||
|
@ -100,12 +100,11 @@ const efi_guid_t efi_guid_load_file2_protocol = EFI_LOAD_FILE2_PROTOCOL_GUID;
|
||||||
/* GUID of the SMBIOS table */
|
/* GUID of the SMBIOS table */
|
||||||
const efi_guid_t smbios_guid = SMBIOS_TABLE_GUID;
|
const efi_guid_t smbios_guid = SMBIOS_TABLE_GUID;
|
||||||
|
|
||||||
static efi_status_t EFIAPI efi_disconnect_controller(
|
efi_status_t EFIAPI efi_disconnect_controller(
|
||||||
efi_handle_t controller_handle,
|
efi_handle_t controller_handle,
|
||||||
efi_handle_t driver_image_handle,
|
efi_handle_t driver_image_handle,
|
||||||
efi_handle_t child_handle);
|
efi_handle_t child_handle);
|
||||||
|
|
||||||
static
|
|
||||||
efi_status_t EFIAPI efi_connect_controller(efi_handle_t controller_handle,
|
efi_status_t EFIAPI efi_connect_controller(efi_handle_t controller_handle,
|
||||||
efi_handle_t *driver_image_handle,
|
efi_handle_t *driver_image_handle,
|
||||||
struct efi_device_path *remain_device_path,
|
struct efi_device_path *remain_device_path,
|
||||||
|
@ -1039,7 +1038,7 @@ static efi_status_t EFIAPI efi_signal_event_ext(struct efi_event *event)
|
||||||
*
|
*
|
||||||
* Return: status code
|
* Return: status code
|
||||||
*/
|
*/
|
||||||
static efi_status_t EFIAPI efi_close_event(struct efi_event *event)
|
efi_status_t EFIAPI efi_close_event(struct efi_event *event)
|
||||||
{
|
{
|
||||||
struct efi_register_notify_event *item, *next;
|
struct efi_register_notify_event *item, *next;
|
||||||
|
|
||||||
|
@ -1380,7 +1379,7 @@ static efi_status_t efi_disconnect_all_drivers
|
||||||
*
|
*
|
||||||
* Return: status code
|
* Return: status code
|
||||||
*/
|
*/
|
||||||
static efi_status_t efi_uninstall_protocol
|
efi_status_t efi_uninstall_protocol
|
||||||
(efi_handle_t handle, const efi_guid_t *protocol,
|
(efi_handle_t handle, const efi_guid_t *protocol,
|
||||||
void *protocol_interface, bool preserve)
|
void *protocol_interface, bool preserve)
|
||||||
{
|
{
|
||||||
|
@ -3665,7 +3664,7 @@ static efi_status_t efi_connect_single_controller(
|
||||||
*
|
*
|
||||||
* Return: status code
|
* Return: status code
|
||||||
*/
|
*/
|
||||||
static efi_status_t EFIAPI efi_connect_controller(
|
efi_status_t EFIAPI efi_connect_controller(
|
||||||
efi_handle_t controller_handle,
|
efi_handle_t controller_handle,
|
||||||
efi_handle_t *driver_image_handle,
|
efi_handle_t *driver_image_handle,
|
||||||
struct efi_device_path *remain_device_path,
|
struct efi_device_path *remain_device_path,
|
||||||
|
@ -3844,7 +3843,7 @@ static efi_status_t efi_get_child_controllers(
|
||||||
*
|
*
|
||||||
* Return: status code
|
* Return: status code
|
||||||
*/
|
*/
|
||||||
static efi_status_t EFIAPI efi_disconnect_controller(
|
efi_status_t EFIAPI efi_disconnect_controller(
|
||||||
efi_handle_t controller_handle,
|
efi_handle_t controller_handle,
|
||||||
efi_handle_t driver_image_handle,
|
efi_handle_t driver_image_handle,
|
||||||
efi_handle_t child_handle)
|
efi_handle_t child_handle)
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <vsprintf.h>
|
#include <vsprintf.h>
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
|
|
||||||
static const efi_guid_t efi_net_guid = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
|
const efi_guid_t efi_net_guid = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
|
||||||
static const efi_guid_t efi_pxe_base_code_protocol_guid =
|
static const efi_guid_t efi_pxe_base_code_protocol_guid =
|
||||||
EFI_PXE_BASE_CODE_PROTOCOL_GUID;
|
EFI_PXE_BASE_CODE_PROTOCOL_GUID;
|
||||||
static struct efi_pxe_packet *dhcp_ack;
|
static struct efi_pxe_packet *dhcp_ack;
|
||||||
|
|
|
@ -67,7 +67,6 @@ struct dhcp {
|
||||||
static struct efi_boot_services *boottime;
|
static struct efi_boot_services *boottime;
|
||||||
static struct efi_simple_network *net;
|
static struct efi_simple_network *net;
|
||||||
static struct efi_event *timer;
|
static struct efi_event *timer;
|
||||||
static const efi_guid_t efi_net_guid = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
|
|
||||||
/* IP packet ID */
|
/* IP packet ID */
|
||||||
static unsigned int net_ip_id;
|
static unsigned int net_ip_id;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue