aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/sys_utils
Commit message (Collapse)AuthorAgeFilesLines
* mpm: db_flash: Check mount status before mountingMartin Braun2021-04-261-7/+13
| | | | | This will make sure the flash partition is not already mounted before trying to re-mount.
* mpm: sysutils: mount: Check both mount point and data pathMartin Braun2021-04-211-4/+5
| | | | | This will return False on ismounted() if a Mount class is mounted, but in the wrong spot.
* mpm: mount: Demote already-mounted warningMartin Braun2021-04-211-1/+1
| | | | | | | | The class Mount defines a mount point and device path. It currently warns if mount() is called twice, but that warning is at odds with the contract of that API. It even returns 'True' (== success) after printing the warning, and the outcome is the desired one. For that reason, we demote the warning to a debug statement.
* mpm: Add i2c_dev lookup using sys_nameToni Jones2021-03-081-7/+51
| | | | | | | | | | | Add i2c_dev adapter device lookup which uses a the sys_name value instead of OF_NAME to find the adapter. OF_NAME is not unique for some i2c device nodes. The logic for finding the adapter from the parent node was pulled into a helper function and is shared across both lookup functions. Co-authored-by: Michael Auchter <michael.auchter@ni.com> Co-authored-by: Toni Jones <toni.jones@ni.com>
* mpm: add helper for symbol lookupCiro Nishiguchi2021-03-041-0/+81
| | | | | | | Add a helper that can lookup a device via a device tree symbol. Co-authored-by: Lars Amsel <lars.amsel@ni.com> Co-authored-by: Michael Auchter <michael.auchter@ni.com>
* mpm: added DBFlash classJoerg Hofrichter2021-02-111-0/+87
| | | | Class for accessing (mounting) the daughterboard flash
* mpm: added Mount classJoerg Hofrichter2021-02-111-0/+96
| | | | Class for creating a mount point
* mpm: filesystem_status: tolerate absence of menderMichael Auchter2021-02-091-5/+7
| | | | | | If the mender utility is not installed or exits with a failure, return NULL for the artifact rather than raising an exception (and disrupting device initialization).
* sim: Lay Groundwork for SimulatorSamuel O'Brien2020-10-071-1/+9
| | | | | | | | | | | | | | | At this point, only about half of the mpm methods work on the simulator over the mpm shell, and it hasn't been tested with uhd at all. If you want to give it a try, first install all of the python dependencies of mpm (The simulator doesn't require libusrp or any of the C++ deps). In addition, running mpm on a desktop machine requires the python lib netifaces. Next, make an /mpm/build directory and open it. Run `cmake .. -DMPM_DEVICE=sim`, then `make`. Finally, run `python3 python/usrp_hwd.py`. You should be able to open another terminal and run `mpm/tools/mpm_shell.py localhost` to connect to the mpm server. Signed-off-by: Samuel O'Brien <sam.obrien@ni.com>
* mpm: added check-filesystem utilityJoerg Hofrichter2020-10-061-0/+67
|
* mpm: Return 10 Gbs link speed on failuremattprost2020-09-011-0/+7
| | | | | | | | | | | The sysfs call used to determine link speed occasionally will fail and return -1. In order to mitigate side effects from this behavior, return 10 Gbs link speed instead of 1 Gbs. This mitigates problems that occur when this issue is seen on 10GbE ports. This approach was elected over returning -1 to be handled on the host side in order to avoid breaking mpm compatibility. Signed-off-by: ettus <matt.prost@ni.com>
* mpm: Fix documentation and minor issues in sys_utils.GPIOBankMartin Braun2020-07-281-6/+30
| | | | | | | | | | | - GPIOBank made the assumption that all bits used where contiguous. This amends the documentation to make that more clear, and adds an assert statement to check for that. - reset_all() would reset all pins, regardless of DDR value, rendering it useless for any GPIO bank that would want to have readable pins. Fixed that by checking DDR value before resetting. - Minor amendments to various docstrings; improve PyLint score by removing superfluous inheritance from object.
* mpm,mpmd: Add iface type and mtu info for UDP linksAlex Williams2020-07-161-0/+1
| | | | | | This changes MTU handling for the "internal" UDP type. Because MPM echo packets will not be returned for internal NICs, use the iface's programmed MTU instead.
* mpm: Make contextmanagers exception-safeLane Kolbly2020-03-031-2/+4
| | | | When making context managers in Python, the yield statement has to be wrapped in a try/finally clause in order to properly clean up after exceptions happen.
* mpm: net: Fix typo in docstringMartin Braun2019-07-201-1/+1
|
* mpm: sys_utils: Remove hardcoded 'subsystem' for temp sensorSugandha Gupta2019-05-011-8/+24
| | | | | This is needed for E31x with thermal sensors on different subsystems e.g. iio, hwmon.
* uhd: mpm: update all license header w/ "-or-later"Brent Stapleton2019-03-081-1/+1
| | | | Updating all SPDX license identifiers to include "-or-later"
* mpm: net: Add bridge utilitiesSugandha Gupta2019-01-171-10/+36
|
* cmake: Update coding style to use lowercase commandsMartin Braun2018-11-141-4/+4
| | | | | | | | | | | | | | | | | Also updates our coding style file. Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code (with GNU compliant sed): cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done > convert.sed \ && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \ '*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed (Make sure the backslashes don't get mangled!)
* mpm: Add convenience function to pull i2c bus from device treeAlex Williams2018-11-072-0/+37
| | | | | This function grabs the i2c character device path from the OF_NAME property. That property must be unique in the device tree!
* mpm: identify sysfs gpios more genericallyMark Meserve2018-10-181-17/+54
| | | | | - Allow generic path names to be given for each search parameter instead of only checking the label
* mpm: add link_speed xport_infoTrung Tran2018-09-131-0/+21
|
* mpm: sys_utils: Get list of temperatures from all thermal zonesSugandha Gupta2018-08-091-4/+21
|
* uio: mpm: Fixup for opening mboard-regs UIOBrent Stapleton2018-07-231-11/+20
| | | | | | | | | - Fix the syntax to open mboard-regs UIO objects, and change the open() and close() functions to be private. - We were calling open() twice in every context manager line- once manually, and once in __enter__. This commit corrects those usages, and allows the context manager to fully manage the opening and closing of UIO objects.
* mpm: uio: Fix use of loggerMartin Braun2018-07-191-1/+2
| | | | When logger==None, it uio.py would fail.
* mpm: net: Fix rare failures for IP addr detectionMartin Braun2018-06-081-12/+13
| | | | | | | Because the detection of valid Ethernet devices happens across multiple calls in a non-atomic fashion, we cannot assume that a device passed to net.get_iface_info() actually has a valid IP address, so we don't make that assumption.
* mpm: adding reference counters to UIOBrent Stapleton2018-03-141-5/+39
| | | | | | | | | | | | UIO objects now count references on open and close calls. This should prevent problems with nested function calls that open/close the same UIO object. References counts are not atomic -- this is intended for nesting with statements within the same thread context. Reviewed-by: Martin Braun <martin.braun@ettus.com> Reviewed-by: Trung Tran <trung.tran@ettus.com>
* mpm: sysfs_gpio: Throw exception on unsuccessful initMartin Braun2018-03-081-3/+8
| | | | | In case of a lost connection to a sysfs-gpio device, this will trigger the correct errors.
* mpm: Rename n310 to n3xxMartin Braun2018-03-051-1/+1
| | | | | This module (and class) are, in fact, used for all N3xx-derivates so renaming it is the more correct thing to do.
* mpm: net: Add get_hostname()Martin Braun2018-03-021-0/+3
|
* mpm: Update all license headersMartin Braun2018-02-198-15/+15
| | | | | - Fix typo in company name (missing 'a') - Updated SPDX license identifier to version 3.0
* mpm: remove GPIOBank.set_all functionTrung N Tran2018-02-091-12/+0
| | | | | | | | -set_all function doesn't fit well with the GPIO api. It is rather a test sepecific function. -Add gpio_set_all helper to n3xx_bist. Reviewed-by: Martin Braun <martin.braun@ettus.com>
* mpm: Add prefs modulesMartin Braun2018-02-081-1/+1
| | | | | - prefs is a module for centralized preferences management - Uses Python's ConfigParser module
* mpm: net: Add get_local_ip_addrs() methodMartin Braun2018-02-071-1/+15
|
* mpm: convert to string explicitly in GPIOBankTrung N Tran2018-01-241-1/+1
|
* mpm: Demoting watchdog related log message to DEBUGMartin Braun2018-01-191-1/+2
|
* mpm: Enable systemd watchdog and update it from MPMMartin Braun2018-01-151-4/+12
| | | | | | | | - Updated systemd service file - Added health status flag in shared data object - Added thread in RPC process to update watchdog Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
* mpm: sys_utils: Add watchdog moduleMartin Braun2018-01-152-0/+64
| | | | Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
* mpm: Factor GPIO panel code into common moduleMartin Braun2018-01-101-0/+66
| | | | | | | | | | GPIOBank is the new class, n310.FrontpanelGPIO and BackpanelGPIO now derive from that. Other minor changes: - Renamed classes to FrontpanelGPIO and BackpanelGPIO in accordance with coding guidelines - Moved MboardRegsControl before n310 class for consistent code layout
* mpm: Add sysfs_thermal moduleTrung Tran2017-12-222-0/+27
| | | | This will provide an API call to read thermal values via udev.
* mpm: Fix linter warningsMartin Braun2017-12-221-1/+1
| | | | | | - Magnesium: Bad formatting in DRP setup - PeriphManagerBase: Import order - dtoverlay: Missed default value for param
* mpm: Harmonize all license headerMartin Braun2017-12-225-65/+13
| | | | Now uses SPDX headers everywhere.
* mpm: UIOs now open only when necessaryBrent Stapleton2017-12-221-32/+36
| | | | | | | Refactoring to use the C++-based UIO objects. The Liberio and Ethernet objects now open the UIO before using it, and close it once done. Reviewed-By: Martin Braun <martin.braun@ettus.com>
* mpm: Harmonize imports, tidy + sort modulesMartin Braun2017-12-227-0/+705
- Moved nijesdcore to cores/ - Moved udev, net, dtoverlay, uio to sys_utils/ - Made all imports non-relative (except in __init__.py files) - Removed some unnecessary imports - Reordered some imports for Python conventions