aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd/mpmd_xport_mgr.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-12-20 18:08:40 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:06:11 -0800
commita2d0b50bc61442b471fe1a724d61d336af961e21 (patch)
tree2068abeeec45cdd2944e4186614b4d672ddae8af /host/lib/usrp/mpmd/mpmd_xport_mgr.cpp
parent93c1b176ca7ef9a62b903ce1d942b94185db8a7c (diff)
downloaduhd-a2d0b50bc61442b471fe1a724d61d336af961e21.tar.gz
uhd-a2d0b50bc61442b471fe1a724d61d336af961e21.tar.bz2
uhd-a2d0b50bc61442b471fe1a724d61d336af961e21.zip
mpmd: Expose get_mtu() API to mpmd_mboard_impl and to prop tree
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_xport_mgr.cpp')
-rw-r--r--host/lib/usrp/mpmd/mpmd_xport_mgr.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_xport_mgr.cpp b/host/lib/usrp/mpmd/mpmd_xport_mgr.cpp
index 0ca77c740..3d999c1ad 100644
--- a/host/lib/usrp/mpmd/mpmd_xport_mgr.cpp
+++ b/host/lib/usrp/mpmd/mpmd_xport_mgr.cpp
@@ -68,6 +68,24 @@ public:
);
}
+ size_t get_mtu(
+ const uhd::direction_t dir
+ ) const {
+ if (_xport_ctrls.empty()) {
+ UHD_LOG_WARNING("MPMD",
+ "Cannot determine MTU, no transport controls have been "
+ "established!");
+ return 0;
+ }
+
+ size_t mtu = ~size_t(0);
+ for (const auto &xport_ctrl_pair : _xport_ctrls) {
+ mtu = std::min(mtu, xport_ctrl_pair.second->get_mtu(dir));
+ }
+
+ return mtu;
+ }
+
private:
/**************************************************************************