From 87bb81cd66edde76acb1c6fb4e140651f69039d9 Mon Sep 17 00:00:00 2001 From: Johannes Schlatow Date: Mon, 4 Oct 2021 11:49:12 +0200 Subject: [PATCH] nic: add _custom_conn_tx_ack_avail_handler() The custom ack avail handler is required for zero-copy nic drivers (e.g. the zynq nic driver), which must release the corresponding DMA buffers. Fixes genodelabs/genode#4277 --- .../nic/include/drivers/nic/uplink_client_base.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/repos/os/src/drivers/nic/include/drivers/nic/uplink_client_base.h b/repos/os/src/drivers/nic/include/drivers/nic/uplink_client_base.h index 730e602b81..47ac24269f 100644 --- a/repos/os/src/drivers/nic/include/drivers/nic/uplink_client_base.h +++ b/repos/os/src/drivers/nic/include/drivers/nic/uplink_client_base.h @@ -66,6 +66,11 @@ class Genode::Uplink_client_base : Noncopyable void _conn_tx_handle_ack_avail() { + if (_custom_conn_tx_ack_avail_handler()) { + _custom_conn_tx_handle_ack_avail(); + return; + } + while (_conn->tx()->ack_avail()) { _conn->tx()->release_packet(_conn->tx()->get_acked_packet()); @@ -310,8 +315,16 @@ class Genode::Uplink_client_base : Noncopyable throw Unexpected_call { }; } + virtual void _custom_conn_tx_handle_ack_avail() + { + class Unexpected_call { }; + throw Unexpected_call { }; + } + virtual bool _custom_conn_rx_packet_avail_handler() { return false; } + virtual bool _custom_conn_tx_ack_avail_handler() { return false; } + public: Uplink_client_base(Env &env,