diff options
author | Martin Braun <martin.braun@ettus.com> | 2022-07-04 14:33:51 +0200 |
---|---|---|
committer | skooNI <60897865+skooNI@users.noreply.github.com> | 2022-07-20 15:57:20 -0500 |
commit | 54990c55f8ca4568c3281325636f15d02bb31f3f (patch) | |
tree | e2b5d06fd327ba21ead9ebf5ae54094898c45b21 /mpm/python/usrp_mpm/periph_manager/n3xx.py | |
parent | 807e19c107fcc316988b8f58a16a5b5613d3354f (diff) | |
download | uhd-54990c55f8ca4568c3281325636f15d02bb31f3f.tar.gz uhd-54990c55f8ca4568c3281325636f15d02bb31f3f.tar.bz2 uhd-54990c55f8ca4568c3281325636f15d02bb31f3f.zip |
mpm: Factor out transport API into PeriphManagerBase
All MPM devices use identical implementations of the transport API.
Minor differences between the actual lines of code in the various
transport adapters are due to minor optimizations, such as hard-coding
'udp' as the only valid transport type for the N3xx series.
This change moves the implementation of the transport API calls
(get_chdr_link_options() and get_chdr_link_types()) into
PeriphManagerBase. The class attributes _xport_adapter_mgrs is also
declared in that class, but defining them is left up to the individual
device implementations.
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/n3xx.py')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/n3xx.py | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx.py b/mpm/python/usrp_mpm/periph_manager/n3xx.py index 6800d356b..3e502be4e 100644 --- a/mpm/python/usrp_mpm/periph_manager/n3xx.py +++ b/mpm/python/usrp_mpm/periph_manager/n3xx.py @@ -7,12 +7,11 @@ N3xx implementation module """ -from __future__ import print_function import copy import re import threading import time -from six import iteritems, itervalues +from six import iteritems from usrp_mpm.cores import WhiteRabbitRegsControl from usrp_mpm.components import ZynqComponents from usrp_mpm.gpsd_iface import GPSDIfaceExtension @@ -451,22 +450,8 @@ class n3xx(ZynqComponents, PeriphManagerBase): 'pps_export', N3XX_DEFAULT_ENABLE_PPS_EXPORT )) - for xport_mgr in itervalues(self._xport_mgrs): - xport_mgr.init(args) return result - def deinit(self): - """ - Clean up after a UHD session terminates. - """ - if not self._device_initialized: - self.log.warning( - "Cannot run deinit(), device was never fully initialized!") - return - super(n3xx, self).deinit() - for xport_mgr in itervalues(self._xport_mgrs): - xport_mgr.deinit() - def tear_down(self): """ Tear down all members that need to be specially handled before @@ -488,38 +473,6 @@ class n3xx(ZynqComponents, PeriphManagerBase): dtoverlay.rm_overlay(overlay) ########################################################################### - # Transport API - ########################################################################### - def get_chdr_link_types(self): - """ - This will only ever return a single item (udp). - """ - assert self.mboard_info['rpc_connection'] in ('remote', 'local') - return ["udp"] - - def get_chdr_link_options(self, xport_type): - """ - Returns a list of dictionaries. Every dictionary contains information - about one way to connect to this device in order to initiate CHDR - traffic. - - The interpretation of the return value is very highly dependant on the - transport type (xport_type). - For UDP, the every entry of the list has the following keys: - - ipv4 (IP Address) - - port (UDP port) - - link_rate (bps of the link, e.g. 10e9 for 10GigE) - """ - if xport_type not in self._xport_mgrs: - self.log.warning("Can't get link options for unknown link type: `{}'.".format(xport_type)) - return [] - if xport_type == "udp": - return self._xport_mgrs[xport_type].get_chdr_link_options( - self.mboard_info['rpc_connection']) - else: - return self._xport_mgrs[xport_type].get_chdr_link_options() - - ########################################################################### # Device info ########################################################################### def get_device_info_dyn(self): |