diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2017-10-05 16:36:01 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2017-10-09 07:00:33 +0200 |
commit | e5c21603fce2e6143f7312211eaed47c16510ea3 (patch) | |
tree | f1a4c538bbfc2f31d07c36ec079cc70ca6d2f4bc /lib/efi_loader/efi_net.c | |
parent | a0549ef6073e346eb0cbbae1395d4db446b7b05e (diff) | |
download | u-boot-e5c21603fce2e6143f7312211eaed47c16510ea3.tar.gz |
efi_loader: implement WaitForPacket event
The WaitForPacket event informs that a network package has been
received by the SimpleNetworkProtocol.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
[agraf: Move is_signaled = true line into efi_net_push()]
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib/efi_loader/efi_net.c')
-rw-r--r-- | lib/efi_loader/efi_net.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c index 37047891c9..cd46d2db53 100644 --- a/lib/efi_loader/efi_net.c +++ b/lib/efi_loader/efi_net.c @@ -24,6 +24,10 @@ static void *new_tx_packet; * to check if a new network packet has been received. */ static struct efi_event *network_timer_event; +/* + * This event is signaled when a packet has been received. + */ +static struct efi_event *wait_for_packet; struct efi_net_obj { /* Generic EFI object parent class data */ @@ -171,6 +175,7 @@ static efi_status_t EFIAPI efi_net_transmit(struct efi_simple_network *this, static void efi_net_push(void *pkt, int len) { new_rx_packet = true; + wait_for_packet->is_signaled = true; } static efi_status_t EFIAPI efi_net_receive(struct efi_simple_network *this, @@ -281,6 +286,17 @@ int efi_net_register(void) list_add_tail(&netobj->parent.link, &efi_obj_list); /* + * Create WaitForPacket event. + */ + r = efi_create_event(EVT_NOTIFY_WAIT, TPL_CALLBACK, + efi_network_timer_notify, NULL, + &wait_for_packet); + if (r != EFI_SUCCESS) { + printf("ERROR: Failed to register network event\n"); + return r; + } + netobj->net.wait_for_packet = wait_for_packet; + /* * Create a timer event. * * The notification function is used to check if a new network packet |