aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2019-05-28 13:19:24 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:20 -0800
commit374b30cc0eb0842e567d01486d9be8155e361d9f (patch)
tree54b8f907015045cc7049717a8894ccc448155631 /host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp
parentb4bc85ac972b2e4f3e8e0b092947267f9f8aeee4 (diff)
downloaduhd-374b30cc0eb0842e567d01486d9be8155e361d9f.tar.gz
uhd-374b30cc0eb0842e567d01486d9be8155e361d9f.tar.bz2
uhd-374b30cc0eb0842e567d01486d9be8155e361d9f.zip
rfnoc: API cleanup for ctrl/mgmt code
- chdr_ctrl_endpoint can manage multiple dest EPIDs - Moved from both_xports_t to a special defs in rfnoc_common - Changed data-structures where appropriate
Diffstat (limited to 'host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp')
-rw-r--r--host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp b/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp
index 1fee0d40e..bac510f04 100644
--- a/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp
+++ b/host/lib/include/uhdlib/rfnoc/rfnoc_common.hpp
@@ -7,6 +7,7 @@
#ifndef INCLUDED_RFNOC_RFNOC_COMMON_HPP
#define INCLUDED_RFNOC_RFNOC_COMMON_HPP
+#include <uhd/transport/zero_copy.hpp>
#include <memory>
namespace uhd { namespace rfnoc {
@@ -42,11 +43,33 @@ using sep_inst_t = uint16_t;
using sep_addr_t = std::pair<device_id_t, sep_inst_t>;
//! Stream Endpoint ID Type
using sep_id_t = uint16_t;
+//! Stream Endpoint pair Type (first = source, second = destination)
+using sep_id_pair_t = std::pair<sep_id_t, sep_id_t>;
+//! Stream Endpoint Virtual Channel Type
+using sep_vc_t = uint8_t;
-//! Type of data carried by the stream endpoint
-enum class sep_type_t { CTRL, DATA };
+//! NULL/unassigned device ID
+static constexpr device_id_t NULL_DEVICE_ID = 0;
+//! NULL/unassigned device address
+static constexpr sep_addr_t NULL_DEVICE_ADDR{NULL_DEVICE_ID, 0};
+//! NULL/unassigned stream endpoint ID
+static constexpr sep_id_t NULL_EPID = 0;
+// TODO: Update these
+struct chdr_ctrl_xport_t
+{
+ chdr_ctrl_xport_t() = default;
+ uhd::transport::zero_copy_if::sptr recv;
+ uhd::transport::zero_copy_if::sptr send;
+ size_t recv_buff_size = 0;
+ size_t send_buff_size = 0;
+ sep_id_t src_epid = 0;
+ sep_id_t dst_epid = 0;
+};
+
+using chdr_data_xport_t = chdr_ctrl_xport_t;
+
//----------------------------------------------
// Constants
//----------------------------------------------