diff options
| author | Martin Braun <martin.braun@ettus.com> | 2017-05-16 15:30:43 -0700 | 
|---|---|---|
| committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:53 -0800 | 
| commit | e2503018dac0ed1fb08fae9444f3282464942bfa (patch) | |
| tree | 9b6bdd7d8447c21c757561dba0c828a97b3df144 | |
| parent | 0a9632ad39179ce80fe3c20a990e488de06170b1 (diff) | |
| download | uhd-e2503018dac0ed1fb08fae9444f3282464942bfa.tar.gz uhd-e2503018dac0ed1fb08fae9444f3282464942bfa.tar.bz2 uhd-e2503018dac0ed1fb08fae9444f3282464942bfa.zip  | |
mpm: SIDs are returned to pool after device is uninitialized
| -rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 17 | ||||
| -rw-r--r-- | mpm/python/usrp_mpm/periph_manager/n310.py | 2 | 
2 files changed, 6 insertions, 13 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index 62e461db8..df6ee8b4b 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -168,15 +168,12 @@ class PeriphManagerBase(object):      separate motherboard classes derived from this class      """      # stores discovered device information in dicts -    claimed = False      mboard_if_addrs = {}      mboard_overlays = {}      # this information has to be provided by      # the specific periph_manager implementation -    dboard_spimaster_addrs = {}      updateable_components = []      sid_endpoints = {} -    available_endpoints = range(256)      #########################################################################      # Overridables @@ -242,8 +239,10 @@ class PeriphManagerBase(object):          assert self.mboard_eeprom_magic is not None          # Set up logging          self.log = get_logger('PeriphManager') +        self.claimed = False          self._init_mboard_with_eeprom()          self._init_dboards(args.override_db_pids) +        self._available_endpoints = range(256)      def _init_mboard_with_eeprom(self):          """ @@ -366,6 +365,8 @@ class PeriphManagerBase(object):          self.log.info("Mboard deinit() called.")          for dboard in self.dboards:              dboard.deinit() +        self.log.trace("Resetting SID pool...") +        self._available_endpoints = range(256)      def safe_list_updateable_components(self):          """ @@ -413,19 +414,11 @@ class PeriphManagerBase(object):          """          pass -    def init_device(self, *args, **kwargs): -        """ -        Do the real init on the mboard and all dboards -        """ -        # Load FPGA -        # Init dboards -        pass -      def _allocate_sid(self, sender_addr, sid, xbar_src_addr, xbar_src_port):          """          Overload this method in actual device implementation          """ -        return True +        raise NotImplementedError("_allocate_sid() not implented")      def get_interfaces(self):          """ diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py index 470d1c84d..7c52bbf30 100644 --- a/mpm/python/usrp_mpm/periph_manager/n310.py +++ b/mpm/python/usrp_mpm/periph_manager/n310.py @@ -149,7 +149,7 @@ class n310(PeriphManagerBase):          Get the MAC address of the sender and store it in the FPGA ARP table          """          mac_addr = get_mac_addr(sender_addr) -        new_ep = self.available_endpoints.pop(0) +        new_ep = self._available_endpoints.pop(0)          if mac_addr is not None:              if sender_addr not in self.sid_endpoints:                  self.sid_endpoints.update({sender_addr: (new_ep,)})  | 
