diff options
author | Alex Williams <alex.williams@ni.com> | 2019-12-11 13:28:41 -0800 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-12-20 16:32:22 -0800 |
commit | 6d6d0f22eb6a86be65b107c0d3387f9680d78ff6 (patch) | |
tree | 9a2ca3baa1708b393026324e6fe9fa0b199c2407 /host/lib | |
parent | 3a9d2b582dd35120e3035ec0c3c81dac468513d4 (diff) | |
download | uhd-6d6d0f22eb6a86be65b107c0d3387f9680d78ff6.tar.gz uhd-6d6d0f22eb6a86be65b107c0d3387f9680d78ff6.tar.bz2 uhd-6d6d0f22eb6a86be65b107c0d3387f9680d78ff6.zip |
rfnoc: Make chdr_ctrl_xport recv_io callbacks have symbols
This helps a little with debugging (for breakpoints).
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp | 7 | ||||
-rw-r--r-- | host/lib/rfnoc/chdr_ctrl_xport.cpp | 69 |
2 files changed, 50 insertions, 26 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp index f247761e7..d4564e935 100644 --- a/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp +++ b/host/lib/include/uhdlib/rfnoc/chdr_ctrl_xport.hpp @@ -136,6 +136,13 @@ public: private: chdr_ctrl_xport(const chdr_ctrl_xport&) = delete; + void _release_cb(uhd::transport::frame_buff::uptr buff, + uhd::transport::recv_link_if* recv_link); + + bool _ctrl_recv_cb(uhd::transport::frame_buff::uptr& buff); + + bool _mgmt_recv_cb(uhd::transport::frame_buff::uptr& buff); + sep_id_t _my_epid; // Packet for received data diff --git a/host/lib/rfnoc/chdr_ctrl_xport.cpp b/host/lib/rfnoc/chdr_ctrl_xport.cpp index 637d2c302..043055b75 100644 --- a/host/lib/rfnoc/chdr_ctrl_xport.cpp +++ b/host/lib/rfnoc/chdr_ctrl_xport.cpp @@ -35,22 +35,12 @@ chdr_ctrl_xport::chdr_ctrl_xport(io_service::sptr io_srv, recv_link_if* /*recv_link*/, send_link_if * /*send_link*/) -> bool { - _recv_packet->refresh(buff->data()); - auto hdr = _recv_packet->get_chdr_header(); - auto pkt_type = hdr.get_pkt_type(); - auto dst_epid = hdr.get_dst_epid(); - - /* Check type and destination EPID */ - if ((pkt_type == PKT_TYPE_CTRL) && (dst_epid == _my_epid)) { - return true; - } else { - return false; - } - return false; + return this->_ctrl_recv_cb(buff); }; + recv_io_if::fc_callback_t release_cb = - [](frame_buff::uptr buff, recv_link_if* link, send_link_if* /*send_link*/) { - link->release_recv_buff(std::move(buff)); + [this](frame_buff::uptr buff, recv_link_if* link, send_link_if* /*send_link*/) { + this->_release_cb(std::move(buff), link); }; _ctrl_recv_if = io_srv->make_recv_client( @@ -60,24 +50,51 @@ chdr_ctrl_xport::chdr_ctrl_xport(io_service::sptr io_srv, recv_link_if* /*recv_link*/, send_link_if * /*send_link*/) -> bool { - _recv_packet->refresh(buff->data()); - auto hdr = _recv_packet->get_chdr_header(); - auto pkt_type = hdr.get_pkt_type(); - auto dst_epid = hdr.get_dst_epid(); - - /* Check type and destination EPID */ - if ((pkt_type == PKT_TYPE_MGMT) && (dst_epid == _my_epid)) { - return true; - } else { - return false; - } - return false; + return this->_mgmt_recv_cb(buff); }; _mgmt_recv_if = io_srv->make_recv_client( recv_link, 1, mgmt_recv_cb, send_link_if::sptr(), 0, release_cb); } +bool chdr_ctrl_xport::_ctrl_recv_cb(uhd::transport::frame_buff::uptr& buff) +{ + _recv_packet->refresh(buff->data()); + auto hdr = _recv_packet->get_chdr_header(); + auto pkt_type = hdr.get_pkt_type(); + auto dst_epid = hdr.get_dst_epid(); + + /* Check type and destination EPID */ + if ((pkt_type == PKT_TYPE_CTRL) && (dst_epid == _my_epid)) { + return true; + } else { + return false; + } + return false; +} + +bool chdr_ctrl_xport::_mgmt_recv_cb(uhd::transport::frame_buff::uptr& buff) +{ + _recv_packet->refresh(buff->data()); + auto hdr = _recv_packet->get_chdr_header(); + auto pkt_type = hdr.get_pkt_type(); + auto dst_epid = hdr.get_dst_epid(); + + /* Check type and destination EPID */ + if ((pkt_type == PKT_TYPE_MGMT) && (dst_epid == _my_epid)) { + return true; + } else { + return false; + } + return false; +} + +void chdr_ctrl_xport::_release_cb(uhd::transport::frame_buff::uptr buff, + uhd::transport::recv_link_if* recv_link) +{ + recv_link->release_recv_buff(std::move(buff)); +} + chdr_ctrl_xport::~chdr_ctrl_xport() { |