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
This commit is contained in:
Johannes Schlatow 2021-10-04 11:49:12 +02:00 committed by Christian Helmuth
parent 332cfb38c1
commit 87bb81cd66

View File

@ -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,