aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/xports
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-01-08 19:23:28 -0800
committerMartin Braun <martin.braun@ettus.com>2018-02-07 14:04:30 -0800
commit852bf3aa10613e80a8b9434b2d69f967b53a2d97 (patch)
tree28800ad095553490d6df401c6ee3a6beaaa5676c /mpm/python/usrp_mpm/xports
parent88ab35529b5be85654b4b00cd558bc083b692df4 (diff)
downloaduhd-852bf3aa10613e80a8b9434b2d69f967b53a2d97.tar.gz
uhd-852bf3aa10613e80a8b9434b2d69f967b53a2d97.tar.bz2
uhd-852bf3aa10613e80a8b9434b2d69f967b53a2d97.zip
mpm: n310: Return CHDR addresses as part of device_info
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
Diffstat (limited to 'mpm/python/usrp_mpm/xports')
-rw-r--r--mpm/python/usrp_mpm/xports/xportmgr_liberio.py12
-rw-r--r--mpm/python/usrp_mpm/xports/xportmgr_udp.py17
2 files changed, 29 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/xports/xportmgr_liberio.py b/mpm/python/usrp_mpm/xports/xportmgr_liberio.py
index 8ac2f06f3..f1e9fe2de 100644
--- a/mpm/python/usrp_mpm/xports/xportmgr_liberio.py
+++ b/mpm/python/usrp_mpm/xports/xportmgr_liberio.py
@@ -38,6 +38,18 @@ class XportMgrLiberio(object):
" Clean up after a session terminates "
self._data_chan_ctr = 0
+ def get_xport_info(self):
+ """
+ Returns a dictionary of useful information, e.g. for appending into the
+ device info.
+
+ Note: This can be run by callers not owning a claim, even when the
+ device has been claimed by someone else.
+
+ In this case, returns an empty dict.
+ """
+ return {}
+
def request_xport(
self,
sid,
diff --git a/mpm/python/usrp_mpm/xports/xportmgr_udp.py b/mpm/python/usrp_mpm/xports/xportmgr_udp.py
index dd783e132..5e565ba86 100644
--- a/mpm/python/usrp_mpm/xports/xportmgr_udp.py
+++ b/mpm/python/usrp_mpm/xports/xportmgr_udp.py
@@ -112,6 +112,23 @@ class XportMgrUDP(object):
" Clean up after a session terminates "
self._allocations = {}
+ def get_xport_info(self):
+ """
+ Returns a dictionary of useful information, e.g. for appending into the
+ device info.
+
+ Note: This can be run by callers not owning a claim, even when the
+ device has been claimed by someone else.
+
+ In this case, returns the available IP addresses.
+ """
+ available_interfaces = \
+ self._init_interfaces(self._possible_chdr_ifaces)
+ return dict(zip(
+ ("addr", "second_addr", "third_addr", "fourth_addr"),
+ (x['ip_addr'] for x in itervalues(available_interfaces))
+ ))
+
def _preload_ethtables(self, eth_dispatchers, table_file):
"""
Populates the ethernet tables from a JSON file