aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/transport
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-08-21 15:14:39 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:42 -0800
commit027cf1fe9b484197bc7f2aeb2f1bb588442d0bdc (patch)
treeb94743f513b3e0d5d53241592f1caaa72e2acb56 /host/lib/include/uhdlib/transport
parent77a5358dd03669366a162d67f9ea11b2056c78b6 (diff)
downloaduhd-027cf1fe9b484197bc7f2aeb2f1bb588442d0bdc.tar.gz
uhd-027cf1fe9b484197bc7f2aeb2f1bb588442d0bdc.tar.bz2
uhd-027cf1fe9b484197bc7f2aeb2f1bb588442d0bdc.zip
rfnoc: radio/streamer: Handle late commands and burst ACKs
- Burst ACKs are already handled by the TX streamer, but the radio now also sends an action upstream on reception of a burst ACK - Late commands were only acquitted by an 'L', now an action gets sent downstream and is handled in the rx streamer
Diffstat (limited to 'host/lib/include/uhdlib/transport')
-rw-r--r--host/lib/include/uhdlib/transport/rx_streamer_impl.hpp6
-rw-r--r--host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp16
2 files changed, 22 insertions, 0 deletions
diff --git a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp
index b52358e55..c57a8e0d1 100644
--- a/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp
+++ b/host/lib/include/uhdlib/transport/rx_streamer_impl.hpp
@@ -220,6 +220,12 @@ protected:
_zero_copy_streamer.set_stopped_due_to_overrun();
}
+ //! Notifies the streamer that an overrun has occured
+ void set_stopped_due_to_late_command()
+ {
+ _zero_copy_streamer.set_stopped_due_to_late_command();
+ }
+
//! Provides a callback to handle overruns
void set_overrun_handler(
typename rx_streamer_zero_copy<transport_t>::overrun_handler_t handler)
diff --git a/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp b/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp
index 1f7320330..27b7eaf7d 100644
--- a/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp
+++ b/host/lib/include/uhdlib/transport/rx_streamer_zero_copy.hpp
@@ -93,6 +93,12 @@ public:
_stopped_due_to_overrun = true;
}
+ //! Notifies the streamer that a late command has occured
+ void set_stopped_due_to_late_command()
+ {
+ _stopped_due_to_late_cmd = true;
+ }
+
//! Provides a callback to handle overruns
void set_overrun_handler(overrun_handler_t handler)
{
@@ -161,6 +167,12 @@ public:
// Packets were not available with zero timeout, wait for them
// to arrive using the specified timeout.
result = _get_aligned_buffs(timeout_ms);
+ if (_stopped_due_to_late_cmd) {
+ metadata.has_time_spec = false;
+ metadata.error_code = rx_metadata_t::ERROR_CODE_LATE_COMMAND;
+ _stopped_due_to_late_cmd = false;
+ return 0;
+ }
}
}
@@ -285,6 +297,10 @@ private:
// overrun error when no more packets are available.
std::atomic<bool> _stopped_due_to_overrun{false};
+ // Flag that indicates a late command occurred. The streamer will return a
+ // late command error when no more packets are available.
+ std::atomic<bool> _stopped_due_to_late_cmd{false};
+
// Callback for overrun
overrun_handler_t _overrun_handler;
};