* 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 */
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,
/* Hook net up to the device list */
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.
*