lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

May 2023

  • 1 participants
  • 2583 discussions
[L] Change in osmo-trx[master]: devices: unify band handling
by Hoernchen 17 May '23

17 May '23
Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/32763 ) Change subject: devices: unify band handling ...................................................................... devices: unify band handling This is basically common, but optional code. Change-Id: I64f5a462451e967d4750d8e4f1d5832cbab41cff --- M Transceiver52M/device/bladerf/bladerf.cpp M Transceiver52M/device/bladerf/bladerf.h A Transceiver52M/device/common/bandmanager.h M Transceiver52M/device/lms/LMSDevice.cpp M Transceiver52M/device/lms/LMSDevice.h M Transceiver52M/device/uhd/UHDDevice.cpp M Transceiver52M/device/uhd/UHDDevice.h 7 files changed, 239 insertions(+), 318 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/32763/1 diff --git a/Transceiver52M/device/bladerf/bladerf.cpp b/Transceiver52M/device/bladerf/bladerf.cpp index 3d9aab9..6ed4220 100644 --- a/Transceiver52M/device/bladerf/bladerf.cpp +++ b/Transceiver52M/device/bladerf/bladerf.cpp @@ -47,25 +47,11 @@ LOGC(DDEV, ERROR) << bladerf_strerror(status); \ } -/* Device Type, Tx-SPS, Rx-SPS */ -typedef std::tuple<blade_dev_type, int, int> dev_key; - -/* Device parameter descriptor */ -struct dev_desc { - unsigned channels; - double mcr; - double rate; - double offset; - std::string str; -}; - -static const std::map<dev_key, dev_desc> dev_param_map{ +static const dev_map_t dev_param_map{ { std::make_tuple(blade_dev_type::BLADE2, 4, 4), { 1, 26e6, GSMRATE, B2XX_TIMING_4_4SPS, "B200 4 SPS" } }, }; -typedef std::tuple<blade_dev_type, enum gsm_band> dev_band_key; -typedef std::map<dev_band_key, dev_band_desc>::const_iterator dev_band_map_it; -static const std::map<dev_band_key, dev_band_desc> dev_band_nom_power_param_map{ +static const power_map_t dev_band_nom_power_param_map{ { std::make_tuple(blade_dev_type::BLADE2, GSM_BAND_850), { 89.75, 13.3, -7.5 } }, { std::make_tuple(blade_dev_type::BLADE2, GSM_BAND_900), { 89.75, 13.3, -7.5 } }, { std::make_tuple(blade_dev_type::BLADE2, GSM_BAND_1800), { 89.75, 7.5, -11.0 } }, @@ -85,9 +71,9 @@ } blade_device::blade_device(InterfaceType iface, const struct trx_cfg *cfg) - : RadioDevice(iface, cfg), dev(nullptr), rx_gain_min(0.0), rx_gain_max(0.0), band_ass_curr_sess(false), - band((enum gsm_band)0), tx_spp(0), rx_spp(0), started(false), aligned(false), drop_cnt(0), prev_ts(0), - ts_initial(0), ts_offset(0), async_event_thrd(NULL) + : RadioDevice(iface, cfg), band_manager(dev_band_nom_power_param_map, dev_param_map), dev(nullptr), + rx_gain_min(0.0), rx_gain_max(0.0), band_ass_curr_sess(false), band((enum gsm_band)0), tx_spp(0), rx_spp(0), + started(false), aligned(false), drop_cnt(0), prev_ts(0), ts_initial(0), ts_offset(0), async_event_thrd(NULL) { } @@ -104,47 +90,6 @@ delete rx_buffers[i]; } -void blade_device::assign_band_desc(enum gsm_band req_band) -{ - dev_band_map_it it; - - it = dev_band_nom_power_param_map.find(dev_band_key(dev_type, req_band)); - if (it == dev_band_nom_power_param_map.end()) { - dev_desc desc = dev_param_map.at(dev_key(dev_type, tx_sps, rx_sps)); - LOGC(DDEV, ERROR) << "No Power parameters exist for device " << desc.str << " on band " - << gsm_band_name(req_band) << ", using B210 ones as fallback"; - it = dev_band_nom_power_param_map.find(dev_band_key(blade_dev_type::BLADE2, req_band)); - } - OSMO_ASSERT(it != dev_band_nom_power_param_map.end()) - band_desc = it->second; -} - -bool blade_device::set_band(enum gsm_band req_band) -{ - if (band_ass_curr_sess && req_band != band) { - LOGC(DDEV, ALERT) << "Requesting band " << gsm_band_name(req_band) << " different from previous band " - << gsm_band_name(band); - return false; - } - - if (req_band != band) { - band = req_band; - assign_band_desc(band); - } - band_ass_curr_sess = true; - return true; -} - -void blade_device::get_dev_band_desc(dev_band_desc &desc) -{ - if (band == 0) { - LOGC(DDEV, ERROR) - << "Power parameters requested before Tx Frequency was set! Providing band 900 by default..."; - assign_band_desc(GSM_BAND_900); - } - desc = band_desc; -} - void blade_device::init_gains() { double tx_gain_min, tx_gain_max; @@ -580,27 +525,13 @@ bool blade_device::setTxFreq(double wFreq, size_t chan) { - uint16_t req_arfcn; - enum gsm_band req_band; - if (chan >= tx_freqs.size()) { LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; return false; } ScopedLock lock(tune_lock); - req_arfcn = gsm_freq102arfcn(wFreq / 1000 / 100, 0); - if (req_arfcn == 0xffff) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown ARFCN for Tx Frequency " << wFreq / 1000 << " kHz"; - return false; - } - if (gsm_arfcn2band_rc(req_arfcn, &req_band) < 0) { - LOGCHAN(chan, DDEV, ALERT) - << "Unknown GSM band for Tx Frequency " << wFreq << " Hz (ARFCN " << req_arfcn << " )"; - return false; - } - - if (!set_band(req_band)) + if (!update_band_from_freq(wFreq, chan, true)) return false; if (!set_freq(wFreq, chan, true)) @@ -611,27 +542,13 @@ bool blade_device::setRxFreq(double wFreq, size_t chan) { - uint16_t req_arfcn; - enum gsm_band req_band; - if (chan >= rx_freqs.size()) { LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; return false; } ScopedLock lock(tune_lock); - req_arfcn = gsm_freq102arfcn(wFreq / 1000 / 100, 1); - if (req_arfcn == 0xffff) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown ARFCN for Rx Frequency " << wFreq / 1000 << " kHz"; - return false; - } - if (gsm_arfcn2band_rc(req_arfcn, &req_band) < 0) { - LOGCHAN(chan, DDEV, ALERT) - << "Unknown GSM band for Rx Frequency " << wFreq << " Hz (ARFCN " << req_arfcn << " )"; - return false; - } - - if (!set_band(req_band)) + if (!update_band_from_freq(wFreq, chan, false)) return false; return set_freq(wFreq, chan, false); diff --git a/Transceiver52M/device/bladerf/bladerf.h b/Transceiver52M/device/bladerf/bladerf.h index 4db2569..d8a80fc 100644 --- a/Transceiver52M/device/bladerf/bladerf.h +++ b/Transceiver52M/device/bladerf/bladerf.h @@ -22,10 +22,12 @@ #pragma once +#include <map> #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "bandmanager.h" #include "radioDevice.h" #include "smpl_buf.h" @@ -33,8 +35,6 @@ #include <osmocom/gsm/gsm_utils.h> } -#include <bladerf.h> - enum class blade_dev_type { BLADE1, BLADE2 }; struct dev_band_desc { @@ -52,7 +52,21 @@ double rxgain2rssioffset_rel; /* dB */ }; -class blade_device : public RadioDevice { +/* Device parameter descriptor */ +struct dev_desc { + unsigned channels; + double mcr; + double rate; + double offset; + std::string desc_str; +}; + +using dev_key = std::tuple<blade_dev_type, int, int>; +using dev_band_key = std::tuple<blade_dev_type, enum gsm_band>; +using power_map_t = std::map<dev_band_key, dev_band_desc>; +using dev_map_t = std::map<dev_key, dev_desc>; + +class blade_device : public RadioDevice, public band_manager<power_map_t, dev_map_t> { public: blade_device(InterfaceType iface, const struct trx_cfg *cfg); ~blade_device(); @@ -178,9 +192,6 @@ bool flush_recv(size_t num_pkts); bool set_freq(double freq, size_t chan, bool tx); - void get_dev_band_desc(dev_band_desc &desc); - bool set_band(enum gsm_band req_band); - void assign_band_desc(enum gsm_band req_band); Thread *async_event_thrd; Mutex tune_lock; diff --git a/Transceiver52M/device/common/bandmanager.h b/Transceiver52M/device/common/bandmanager.h new file mode 100644 index 0000000..014e4ca --- /dev/null +++ b/Transceiver52M/device/common/bandmanager.h @@ -0,0 +1,132 @@ +#pragma once +/* + * (C) 2022 by sysmocom s.f.m.c. GmbH <info(a)sysmocom.de> + * All Rights Reserved + * + * Author: Eric Wild <ewild(a)sysmocom.de> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <string> + +#include "Logger.h" + +extern "C" { +#include <osmocom/gsm/gsm_utils.h> +} + +template <typename powermapt, typename devmapt> +class band_manager { + using powerkeyt = typename powermapt::key_type; + using powermappedt = typename powermapt::mapped_type; + using devkeyt = typename devmapt::key_type; + const devkeyt &m_dev_type; + const powermapt &m_power_map; + const devmapt &m_dev_map; + devkeyt m_fallback; + enum gsm_band m_band; + powermappedt m_band_desc; + bool band_ass_curr_sess{}; /* true if "band" was set after last POWEROFF */ + + // looks up either first tuple element (->enum) or straight enum + template <typename T, typename std::enable_if<std::is_enum<T>::value>::type *dummy = nullptr> + auto key_helper(T &t) -> T + { + return t; + } + + template <typename T> + auto key_helper(T t) -> typename std::tuple_element<0, T>::type + { + return std::get<0>(t); + } + + void assign_band_desc(enum gsm_band req_band) + { + auto key = key_helper(m_dev_type); + auto fallback_key = key_helper(m_fallback); + auto it = m_power_map.find({ key, req_band }); + if (it == m_power_map.end()) { + auto desc = m_dev_map.at(m_dev_type); + LOGC(DDEV, ERROR) << "No Tx Power measurements exist for device " << desc.desc_str + << " on band " << gsm_band_name(req_band) << ", using fallback.."; + it = m_power_map.find({ fallback_key, req_band }); + } + OSMO_ASSERT(it != m_power_map.end()); + m_band_desc = it->second; + } + + bool set_band(enum gsm_band req_band) + { + if (band_ass_curr_sess && req_band != m_band) { + LOGC(DDEV, ALERT) << "Requesting band " << gsm_band_name(req_band) + << " different from previous band " << gsm_band_name(m_band); + return false; + } + + if (req_band != m_band) { + m_band = req_band; + assign_band_desc(m_band); + } + band_ass_curr_sess = true; + return true; + } + + public: + band_manager(const devkeyt &dev_type, const powermapt &power_map, const devmapt &dev_map, devkeyt fallback) + : m_dev_type(dev_type), m_power_map(power_map), m_dev_map(dev_map), m_fallback(fallback), + m_band((enum gsm_band)0) + { + } + band_manager(const powermapt &power_map, const devmapt &dev_map) + : m_dev_type(dev_map.begin()->first), m_power_map(power_map), m_dev_map(dev_map), + m_fallback(dev_map.begin()->first), m_band((enum gsm_band)0) + { + } + void reset() + { + band_ass_curr_sess = false; + } + + void get_dev_band_desc(powermappedt &desc) + { + if (m_band == 0) { + LOGC(DDEV, ERROR) + << "Power parameters requested before Tx Frequency was set! Providing band 900 by default..."; + assign_band_desc(GSM_BAND_900); + } + desc = m_band_desc; + } + + bool update_band_from_freq(double wFreq, int chan, bool is_tx) + { + enum gsm_band req_band; + auto dirstr = is_tx ? "Tx" : "Rx"; + auto req_arfcn = gsm_freq102arfcn(wFreq / 1000 / 100, !is_tx); + if (req_arfcn == 0xffff) { + LOGCHAN(chan, DDEV, ALERT) + << "Unknown ARFCN for " << dirstr << " Frequency " << wFreq / 1000 << " kHz"; + return false; + } + if (gsm_arfcn2band_rc(req_arfcn, &req_band) < 0) { + LOGCHAN(chan, DDEV, ALERT) << "Unknown GSM band for " << dirstr << " Frequency " << wFreq + << " Hz (ARFCN " << req_arfcn << " )"; + return false; + } + + return set_band(req_band); + } +}; \ No newline at end of file diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp index e336e77..9617d56 100644 --- a/Transceiver52M/device/lms/LMSDevice.cpp +++ b/Transceiver52M/device/lms/LMSDevice.cpp @@ -52,39 +52,16 @@ #define LMS_DEV_SDR_MINI_PREFIX_NAME "LimeSDR-Mini" #define LMS_DEV_NET_MICRO_PREFIX_NAME "LimeNET-Micro" -/* Device parameter descriptor */ -struct dev_desc { - /* Does LimeSuite allow switching the clock source for this device? - * LimeSDR-Mini does not have switches but needs soldering to select - * external/internal clock. Any call to LMS_SetClockFreq() will fail. - */ - bool clock_src_switchable; - /* Does LimeSuite allow using REF_INTERNAL for this device? - * LimeNET-Micro does not like selecting internal clock - */ - bool clock_src_int_usable; - /* Sample rate coef (without having TX/RX samples per symbol into account) */ - double rate; - /* Sample rate coef (without having TX/RX samples per symbol into account), if multi-arfcn is enabled */ - double rate_multiarfcn; - /* Coefficient multiplied by TX sample rate in order to shift Tx time */ - double ts_offset_coef; - /* Coefficient multiplied by TX sample rate in order to shift Tx time, if multi-arfcn is enabled */ - double ts_offset_coef_multiarfcn; - /* Device Name Prefix as presented by LimeSuite API LMS_GetDeviceInfo() */ - std::string name_prefix; -}; -static const std::map<enum lms_dev_type, struct dev_desc> dev_param_map { + +static const dev_map_t dev_param_map { { LMS_DEV_SDR_USB, { true, true, GSMRATE, MCBTS_SPACING, 8.9e-5, 7.9e-5, LMS_DEV_SDR_USB_PREFIX_NAME } }, { LMS_DEV_SDR_MINI, { false, true, GSMRATE, MCBTS_SPACING, 8.9e-5, 8.2e-5, LMS_DEV_SDR_MINI_PREFIX_NAME } }, { LMS_DEV_NET_MICRO, { true, false, GSMRATE, MCBTS_SPACING, 8.9e-5, 7.9e-5, LMS_DEV_NET_MICRO_PREFIX_NAME } }, { LMS_DEV_UNKNOWN, { true, true, GSMRATE, MCBTS_SPACING, 8.9e-5, 7.9e-5, "UNKNOWN" } }, }; -typedef std::tuple<lms_dev_type, enum gsm_band> dev_band_key; -typedef std::map<dev_band_key, dev_band_desc>::const_iterator dev_band_map_it; -static const std::map<dev_band_key, dev_band_desc> dev_band_nom_power_param_map { +static const power_map_t dev_band_nom_power_param_map { { std::make_tuple(LMS_DEV_SDR_USB, GSM_BAND_850), { 73.0, 11.2, -6.0 } }, { std::make_tuple(LMS_DEV_SDR_USB, GSM_BAND_900), { 73.0, 10.8, -6.0 } }, { std::make_tuple(LMS_DEV_SDR_USB, GSM_BAND_1800), { 65.0, -3.5, -17.0 } }, /* FIXME: OS#4583: 1800Mhz is failing above TxGain=65, which is around -3.5dBm (already < 0 dBm) */ @@ -122,8 +99,8 @@ enum lms_dev_type dev_type = it->first; struct dev_desc desc = it->second; - if (strncmp(device_info->deviceName, desc.name_prefix.c_str(), desc.name_prefix.length()) == 0) { - LOGC(DDEV, INFO) << "Device identified as " << desc.name_prefix; + if (strncmp(device_info->deviceName, desc.desc_str.c_str(), desc.desc_str.length()) == 0) { + LOGC(DDEV, INFO) << "Device identified as " << desc.desc_str; return dev_type; } it++; @@ -132,8 +109,9 @@ } LMSDevice::LMSDevice(InterfaceType iface, const struct trx_cfg *cfg) - : RadioDevice(iface, cfg), m_lms_dev(NULL), started(false), band_ass_curr_sess(false), band((enum gsm_band)0), - m_dev_type(LMS_DEV_UNKNOWN) + : RadioDevice(iface, cfg), + band_manager(m_dev_type, dev_band_nom_power_param_map, dev_param_map, LMS_DEV_SDR_USB), m_lms_dev(NULL), + started(false), m_dev_type(LMS_DEV_UNKNOWN) { LOGC(DDEV, INFO) << "creating LMS device..."; @@ -220,47 +198,6 @@ return -1; } -void LMSDevice::assign_band_desc(enum gsm_band req_band) -{ - dev_band_map_it it; - - it = dev_band_nom_power_param_map.find(dev_band_key(m_dev_type, req_band)); - if (it == dev_band_nom_power_param_map.end()) { - dev_desc desc = dev_param_map.at(m_dev_type); - LOGC(DDEV, ERROR) << "No Tx Power measurements exist for device " - << desc.name_prefix << " on band " << gsm_band_name(req_band) - << ", using LimeSDR-USB ones as fallback"; - it = dev_band_nom_power_param_map.find(dev_band_key(LMS_DEV_SDR_USB, req_band)); - } - OSMO_ASSERT(it != dev_band_nom_power_param_map.end()); - band_desc = it->second; -} - -bool LMSDevice::set_band(enum gsm_band req_band) -{ - if (band_ass_curr_sess && req_band != band) { - LOGC(DDEV, ALERT) << "Requesting band " << gsm_band_name(req_band) - << " different from previous band " << gsm_band_name(band); - return false; - } - - if (req_band != band) { - band = req_band; - assign_band_desc(band); - } - band_ass_curr_sess = true; - return true; -} - -void LMSDevice::get_dev_band_desc(dev_band_desc& desc) -{ - if (band == 0) { - LOGC(DDEV, ERROR) << "Power parameters requested before Tx Frequency was set! Providing band 900 by default..."; - assign_band_desc(GSM_BAND_900); - } - desc = band_desc; -} - int LMSDevice::open() { lms_info_str_t* info_list; @@ -466,7 +403,7 @@ LMS_DestroyStream(m_lms_dev, &m_lms_stream_rx[i]); } - band_ass_curr_sess = false; + reset(); started = false; return true; @@ -483,8 +420,8 @@ break; case REF_INTERNAL: if (!dev_desc.clock_src_int_usable) { - LOGC(DDEV, ERROR) << "Device type " << dev_desc.name_prefix - << " doesn't support internal reference clock"; + LOGC(DDEV, ERROR) + << "Device type " << dev_desc.desc_str << " doesn't support internal reference clock"; return false; } /* According to lms using LMS_CLOCK_EXTREF with a @@ -502,8 +439,8 @@ if (LMS_SetClockFreq(m_lms_dev, lms_clk_id, freq) < 0) return false; } else { - LOGC(DDEV, INFO) << "Device type " << dev_desc.name_prefix - << " doesn't support switching clock source through SW"; + LOGC(DDEV, INFO) + << "Device type " << dev_desc.desc_str << " doesn't support switching clock source through SW"; } return true; @@ -996,9 +933,6 @@ bool LMSDevice::setTxFreq(double wFreq, size_t chan) { - uint16_t req_arfcn; - enum gsm_band req_band; - if (chan >= chans) { LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; return false; @@ -1006,18 +940,7 @@ LOGCHAN(chan, DDEV, NOTICE) << "Setting Tx Freq to " << wFreq << " Hz"; - req_arfcn = gsm_freq102arfcn(wFreq / 1000 / 100 , 0); - if (req_arfcn == 0xffff) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown ARFCN for Tx Frequency " << wFreq / 1000 << " kHz"; - return false; - } - if (gsm_arfcn2band_rc(req_arfcn, &req_band) < 0) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown GSM band for Tx Frequency " << wFreq - << " Hz (ARFCN " << req_arfcn << " )"; - return false; - } - - if (!set_band(req_band)) + if (!update_band_from_freq(wFreq, chan, true)) return false; if (LMS_SetLOFrequency(m_lms_dev, LMS_CH_TX, chan, wFreq) < 0) { @@ -1030,23 +953,9 @@ bool LMSDevice::setRxFreq(double wFreq, size_t chan) { - uint16_t req_arfcn; - enum gsm_band req_band; - LOGCHAN(chan, DDEV, NOTICE) << "Setting Rx Freq to " << wFreq << " Hz"; - req_arfcn = gsm_freq102arfcn(wFreq / 1000 / 100, 1); - if (req_arfcn == 0xffff) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown ARFCN for Rx Frequency " << wFreq / 1000 << " kHz"; - return false; - } - if (gsm_arfcn2band_rc(req_arfcn, &req_band) < 0) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown GSM band for Rx Frequency " << wFreq - << " Hz (ARFCN " << req_arfcn << " )"; - return false; - } - - if (!set_band(req_band)) + if (!update_band_from_freq(wFreq, chan, false)) return false; if (LMS_SetLOFrequency(m_lms_dev, LMS_CH_RX, chan, wFreq) < 0) { diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h index 75d11cf..832e911 100644 --- a/Transceiver52M/device/lms/LMSDevice.h +++ b/Transceiver52M/device/lms/LMSDevice.h @@ -18,11 +18,13 @@ #ifndef _LMS_DEVICE_H_ #define _LMS_DEVICE_H_ +#include <map> #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "radioDevice.h" +#include "bandmanager.h" #include "smpl_buf.h" #include <sys/time.h> @@ -69,8 +71,35 @@ double rxgain2rssioffset_rel; /* dB */ }; +/* Device parameter descriptor */ +struct dev_desc { + /* Does LimeSuite allow switching the clock source for this device? + * LimeSDR-Mini does not have switches but needs soldering to select + * external/internal clock. Any call to LMS_SetClockFreq() will fail. + */ + bool clock_src_switchable; + /* Does LimeSuite allow using REF_INTERNAL for this device? + * LimeNET-Micro does not like selecting internal clock + */ + bool clock_src_int_usable; + /* Sample rate coef (without having TX/RX samples per symbol into account) */ + double rate; + /* Sample rate coef (without having TX/RX samples per symbol into account), if multi-arfcn is enabled */ + double rate_multiarfcn; + /* Coefficient multiplied by TX sample rate in order to shift Tx time */ + double ts_offset_coef; + /* Coefficient multiplied by TX sample rate in order to shift Tx time, if multi-arfcn is enabled */ + double ts_offset_coef_multiarfcn; + /* Device Name Prefix as presented by LimeSuite API LMS_GetDeviceInfo() */ + std::string desc_str; +}; + +using dev_band_key = std::tuple<lms_dev_type, gsm_band>; +using power_map_t = std::map<dev_band_key, dev_band_desc>; +using dev_map_t = std::map<lms_dev_type, struct dev_desc>; + /** A class to handle a LimeSuite supported device */ -class LMSDevice:public RadioDevice { +class LMSDevice:public RadioDevice, public band_manager<power_map_t, dev_map_t> { private: lms_device_t *m_lms_dev; @@ -87,9 +116,6 @@ TIMESTAMP ts_initial, ts_offset; std::vector<double> tx_gains, rx_gains; - bool band_ass_curr_sess; /* true if "band" was set after last POWEROFF */ - enum gsm_band band; - struct dev_band_desc band_desc; enum lms_dev_type m_dev_type; @@ -101,9 +127,6 @@ void update_stream_stats_rx(size_t chan, bool *overrun); void update_stream_stats_tx(size_t chan, bool *underrun); bool do_clock_src_freq(enum ReferenceType ref, double freq); - void get_dev_band_desc(dev_band_desc& desc); - bool set_band(enum gsm_band req_band); - void assign_band_desc(enum gsm_band req_band); public: /** Object constructor */ diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index a0021db..f7c134a 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -91,19 +91,7 @@ * USRP1 with timestamps is not supported by UHD. */ -/* Device Type, Tx-SPS, Rx-SPS */ -typedef std::tuple<uhd_dev_type, int, int> dev_key; - -/* Device parameter descriptor */ -struct dev_desc { - unsigned channels; - double mcr; - double rate; - double offset; - std::string str; -}; - -static const std::map<dev_key, dev_desc> dev_param_map { +static const dev_map_t dev_param_map { { std::make_tuple(USRP2, 1, 1), { 1, 0.0, 390625, 1.2184e-4, "N2XX 1 SPS" } }, { std::make_tuple(USRP2, 4, 1), { 1, 0.0, 390625, 7.6547e-5, "N2XX 4/1 Tx/Rx SPS" } }, { std::make_tuple(USRP2, 4, 4), { 1, 0.0, 390625, 4.6080e-5, "N2XX 4 SPS" } }, @@ -129,9 +117,7 @@ { std::make_tuple(B2XX_MCBTS, 4, 4), { 1, 51.2e6, MCBTS_SPACING*4, B2XX_TIMING_MCBTS, "B200/B210 4 SPS Multi-ARFCN" } }, }; -typedef std::tuple<uhd_dev_type, enum gsm_band> dev_band_key; -typedef std::map<dev_band_key, dev_band_desc>::const_iterator dev_band_map_it; -static const std::map<dev_band_key, dev_band_desc> dev_band_nom_power_param_map { +static const power_map_t dev_band_nom_power_param_map { { std::make_tuple(B200, GSM_BAND_850), { 89.75, 13.3, -7.5 } }, { std::make_tuple(B200, GSM_BAND_900), { 89.75, 13.3, -7.5 } }, { std::make_tuple(B200, GSM_BAND_1800), { 89.75, 7.5, -11.0 } }, @@ -221,9 +207,9 @@ } uhd_device::uhd_device(InterfaceType iface, const struct trx_cfg *cfg) - : RadioDevice(iface, cfg), rx_gain_min(0.0), rx_gain_max(0.0), band_ass_curr_sess(false), - band((enum gsm_band)0), tx_spp(0), rx_spp(0), started(false), aligned(false), drop_cnt(0), prev_ts(0, 0), - ts_initial(0), ts_offset(0), async_event_thrd(NULL) + : RadioDevice(iface, cfg), band_manager(dev_band_nom_power_param_map, dev_param_map), rx_gain_min(0.0), + rx_gain_max(0.0), band_ass_curr_sess(false), band((enum gsm_band)0), tx_spp(0), rx_spp(0), started(false), + aligned(false), drop_cnt(0), prev_ts(0, 0), ts_initial(0), ts_offset(0), async_event_thrd(NULL) { } @@ -235,47 +221,6 @@ delete rx_buffers[i]; } -void uhd_device::assign_band_desc(enum gsm_band req_band) -{ - dev_band_map_it it; - - it = dev_band_nom_power_param_map.find(dev_band_key(dev_type, req_band)); - if (it == dev_band_nom_power_param_map.end()) { - dev_desc desc = dev_param_map.at(dev_key(dev_type, tx_sps, rx_sps)); - LOGC(DDEV, ERROR) << "No Power parameters exist for device " - << desc.str << " on band " << gsm_band_name(req_band) - << ", using B210 ones as fallback"; - it = dev_band_nom_power_param_map.find(dev_band_key(B210, req_band)); - } - OSMO_ASSERT(it != dev_band_nom_power_param_map.end()) - band_desc = it->second; -} - -bool uhd_device::set_band(enum gsm_band req_band) -{ - if (band_ass_curr_sess && req_band != band) { - LOGC(DDEV, ALERT) << "Requesting band " << gsm_band_name(req_band) - << " different from previous band " << gsm_band_name(band); - return false; - } - - if (req_band != band) { - band = req_band; - assign_band_desc(band); - } - band_ass_curr_sess = true; - return true; -} - -void uhd_device::get_dev_band_desc(dev_band_desc& desc) -{ - if (band == 0) { - LOGC(DDEV, ERROR) << "Power parameters requested before Tx Frequency was set! Providing band 900 by default..."; - assign_band_desc(GSM_BAND_900); - } - desc = band_desc; -} - void uhd_device::init_gains() { double tx_gain_min, tx_gain_max; @@ -340,7 +285,7 @@ rx_rate = usrp_dev->get_rx_rate(); ts_offset = static_cast<TIMESTAMP>(desc.offset * rx_rate); - LOGC(DDEV, INFO) << "Rates configured for " << desc.str; + LOGC(DDEV, INFO) << "Rates configured for " << desc.desc_str; } double uhd_device::setRxGain(double db, size_t chan) @@ -1031,17 +976,19 @@ { std::vector<double> freqs; uhd::tune_result_t tres; + std::string str_dir = tx ? "Tx" : "Rx"; + + if (!update_band_from_freq(freq, chan, tx)) + return false; + uhd::tune_request_t treq = select_freq(freq, chan, tx); - std::string str_dir; if (tx) { tres = usrp_dev->set_tx_freq(treq, chan); tx_freqs[chan] = usrp_dev->get_tx_freq(chan); - str_dir = "Tx"; } else { tres = usrp_dev->set_rx_freq(treq, chan); rx_freqs[chan] = usrp_dev->get_rx_freq(chan); - str_dir = "Rx"; } LOGCHAN(chan, DDEV, INFO) << "set_freq(" << freq << ", " << str_dir << "): " << tres.to_pp_string() << std::endl; @@ -1071,59 +1018,20 @@ bool uhd_device::setTxFreq(double wFreq, size_t chan) { - uint16_t req_arfcn; - enum gsm_band req_band; - if (chan >= tx_freqs.size()) { LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; return false; } - ScopedLock lock(tune_lock); - req_arfcn = gsm_freq102arfcn(wFreq / 1000 / 100 , 0); - if (req_arfcn == 0xffff) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown ARFCN for Tx Frequency " << wFreq / 1000 << " kHz"; - return false; - } - if (gsm_arfcn2band_rc(req_arfcn, &req_band) < 0) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown GSM band for Tx Frequency " << wFreq - << " Hz (ARFCN " << req_arfcn << " )"; - return false; - } - - if (!set_band(req_band)) - return false; - - if (!set_freq(wFreq, chan, true)) - return false; - - return true; + return set_freq(wFreq, chan, true); } bool uhd_device::setRxFreq(double wFreq, size_t chan) { - uint16_t req_arfcn; - enum gsm_band req_band; - if (chan >= rx_freqs.size()) { LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan; return false; } - ScopedLock lock(tune_lock); - - req_arfcn = gsm_freq102arfcn(wFreq / 1000 / 100, 1); - if (req_arfcn == 0xffff) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown ARFCN for Rx Frequency " << wFreq / 1000 << " kHz"; - return false; - } - if (gsm_arfcn2band_rc(req_arfcn, &req_band) < 0) { - LOGCHAN(chan, DDEV, ALERT) << "Unknown GSM band for Rx Frequency " << wFreq - << " Hz (ARFCN " << req_arfcn << " )"; - return false; - } - - if (!set_band(req_band)) - return false; return set_freq(wFreq, chan, false); } diff --git a/Transceiver52M/device/uhd/UHDDevice.h b/Transceiver52M/device/uhd/UHDDevice.h index 299d98c..e662d52 100644 --- a/Transceiver52M/device/uhd/UHDDevice.h +++ b/Transceiver52M/device/uhd/UHDDevice.h @@ -30,6 +30,7 @@ #include "config.h" #endif +#include "bandmanager.h" #include "radioDevice.h" #include "smpl_buf.h" @@ -71,6 +72,19 @@ double rxgain2rssioffset_rel; /* dB */ }; +struct dev_desc { + unsigned channels; + double mcr; + double rate; + double offset; + std::string desc_str; +}; + +using dev_key = std::tuple<uhd_dev_type, int, int>; +using dev_band_key = std::tuple<uhd_dev_type, enum gsm_band>; +using power_map_t = std::map<dev_band_key, dev_band_desc>; +using dev_map_t = std::map<dev_key, dev_desc>; + /* uhd_device - UHD implementation of the Device interface. Timestamped samples are sent to and received from the device. An intermediate buffer @@ -78,7 +92,7 @@ Events and errors such as underruns are reported asynchronously by the device and received in a separate thread. */ -class uhd_device : public RadioDevice { +class uhd_device : public RadioDevice, public band_manager<power_map_t, dev_map_t> { public: uhd_device(InterfaceType iface, const struct trx_cfg *cfg); ~uhd_device(); @@ -191,10 +205,6 @@ uhd::tune_request_t select_freq(double wFreq, size_t chan, bool tx); bool set_freq(double freq, size_t chan, bool tx); - void get_dev_band_desc(dev_band_desc& desc); - bool set_band(enum gsm_band req_band); - void assign_band_desc(enum gsm_band req_band); Thread *async_event_thrd; - Mutex tune_lock; }; -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/32763 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I64f5a462451e967d4750d8e4f1d5832cbab41cff Gerrit-Change-Number: 32763 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-trx[master]: devices: add freq/gain override for uhd
by Hoernchen 17 May '23

17 May '23
Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/32764 ) Change subject: devices: add freq/gain override for uhd ...................................................................... devices: add freq/gain override for uhd This allows using arbitrary gain and frequencies. Change-Id: I3c1b9a067cafc6d696b9aa2da8ee0480ec1e094f --- M CommonLibs/config_defs.h M CommonLibs/trx_vty.c M Transceiver52M/device/uhd/UHDDevice.cpp 3 files changed, 122 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/64/32764/1 diff --git a/CommonLibs/config_defs.h b/CommonLibs/config_defs.h index 33be73f..bf49bcf 100644 --- a/CommonLibs/config_defs.h +++ b/CommonLibs/config_defs.h @@ -57,4 +57,14 @@ unsigned int stack_size; unsigned int num_chans; struct trx_chan chans[TRX_CHAN_MAX]; + struct { + bool ul_freq_override; + bool dl_freq_override; + bool ul_gain_override; + bool dl_gain_override; + double ul_freq; + double dl_freq; + double ul_gain; + double dl_gain; + } overrides; }; diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c index 6724189..1878d83 100644 --- a/CommonLibs/trx_vty.c +++ b/CommonLibs/trx_vty.c @@ -285,6 +285,60 @@ return CMD_SUCCESS; } +DEFUN_ATTR(cfg_ul_freq_override, cfg_ul_freq_override_cmd, + "ul-freq-override FLOAT", + "Overrides Rx carrier frequency\n" + "Frequency in Hz (e.g. 145300000)\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.overrides.ul_freq_override = true; + trx->cfg.overrides.ul_freq = atof(argv[0]); + + return CMD_SUCCESS; +} +DEFUN_ATTR(cfg_dl_freq_override, cfg_dl_freq_override_cmd, + "dl-freq-override FLOAT", + "Overrides Tx carrier frequency\n" + "Frequency in Hz (e.g. 145300000)\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.overrides.dl_freq_override = true; + trx->cfg.overrides.dl_freq = atof(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN_ATTR(cfg_ul_gain_override, cfg_ul_gain_override_cmd, + "ul-gain-override FLOAT", + "Overrides Rx gain\n" + "gain in dB\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.overrides.ul_gain_override = true; + trx->cfg.overrides.ul_gain = atof(argv[0]); + + return CMD_SUCCESS; +} +DEFUN_ATTR(cfg_dl_gain_override, cfg_dl_gain_override_cmd, + "dl-gain-override FLOAT", + "Overrides Tx gain\n" + "gain in dB\n", + CMD_ATTR_HIDDEN) +{ + struct trx_ctx *trx = trx_from_vty(vty); + + trx->cfg.overrides.dl_gain_override = true; + trx->cfg.overrides.dl_gain = atof(argv[0]); + + return CMD_SUCCESS; +} + DEFUN(cfg_swap_channels, cfg_swap_channels_cmd, "swap-channels (disable|enable)", "Swap primary and secondary channels of the PHY (if any)\n" @@ -638,6 +692,14 @@ vty_out(vty, " stack-size %u%s", trx->cfg.stack_size, VTY_NEWLINE); if (trx->cfg.ul_fn_offset != 0) vty_out(vty, " ul-fn-offset %d%s", trx->cfg.ul_fn_offset, VTY_NEWLINE); + if (trx->cfg.overrides.dl_freq_override) + vty_out(vty, " dl-freq-override %f%s", trx->cfg.overrides.dl_freq, VTY_NEWLINE); + if (trx->cfg.overrides.ul_freq_override) + vty_out(vty, " ul-freq-override %f%s", trx->cfg.overrides.ul_freq, VTY_NEWLINE); + if (trx->cfg.overrides.dl_gain_override) + vty_out(vty, " dl-gain-override %f%s", trx->cfg.overrides.dl_gain, VTY_NEWLINE); + if (trx->cfg.overrides.ul_gain_override) + vty_out(vty, " ul-gain-override %f%s", trx->cfg.overrides.ul_gain, VTY_NEWLINE); trx_rate_ctr_threshold_write_config(vty, " "); for (i = 0; i < trx->cfg.num_chans; i++) { @@ -803,6 +865,10 @@ install_element(TRX_NODE, &cfg_chan_cmd); install_element(TRX_NODE, &cfg_ul_fn_offset_cmd); + install_element(TRX_NODE, &cfg_ul_freq_override_cmd); + install_element(TRX_NODE, &cfg_dl_freq_override_cmd); + install_element(TRX_NODE, &cfg_ul_gain_override_cmd); + install_element(TRX_NODE, &cfg_dl_gain_override_cmd); install_node(&chan_node, dummy_config_write); install_element(CHAN_NODE, &cfg_chan_rx_path_cmd); install_element(CHAN_NODE, &cfg_chan_tx_path_cmd); diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp index f7c134a..8221f71 100644 --- a/Transceiver52M/device/uhd/UHDDevice.cpp +++ b/Transceiver52M/device/uhd/UHDDevice.cpp @@ -295,6 +295,9 @@ return 0.0f; } + if (cfg->overrides.ul_freq_override) + return rx_gains[chan]; + usrp_dev->set_rx_gain(db, chan); rx_gains[chan] = usrp_dev->get_rx_gain(chan); @@ -337,6 +340,9 @@ return 0.0f; } + if (cfg->overrides.dl_gain_override) + return 0.0f; + get_dev_band_desc(desc); tx_power = desc.nom_out_tx_power - atten; db = TxPower2TxGain(desc, tx_power); @@ -626,6 +632,32 @@ // Print configuration LOGC(DDEV, INFO) << "Device configuration: " << usrp_dev->get_pp_string(); + if (cfg->overrides.dl_freq_override) { + uhd::tune_request_t treq_tx = uhd::tune_request_t(cfg->overrides.dl_freq, 0); + auto tres = usrp_dev->set_tx_freq(treq_tx, 0); + tx_freqs[0] = usrp_dev->get_tx_freq(0); + LOGCHAN(0, DDEV, INFO) << "OVERRIDE set_freq(" << cfg->overrides.dl_freq << ", TX): " << tres.to_pp_string() << std::endl; + } + + if (cfg->overrides.ul_freq_override) { + uhd::tune_request_t treq_rx = uhd::tune_request_t(cfg->overrides.ul_freq, 0); + auto tres = usrp_dev->set_rx_freq(treq_rx, 0); + rx_freqs[0] = usrp_dev->get_rx_freq(0); + LOGCHAN(0, DDEV, INFO) << "OVERRIDE set_freq(" << cfg->overrides.ul_freq << ", RX): " << tres.to_pp_string() << std::endl; + } + + if (cfg->overrides.ul_gain_override) { + usrp_dev->set_rx_gain(cfg->overrides.ul_gain, 0); + rx_gains[0] = usrp_dev->get_rx_gain(0); + LOGCHAN(0, DDEV, INFO) << " OVERRIDE RX gain:" << rx_gains[0] << std::endl; + } + + if (cfg->overrides.dl_gain_override) { + usrp_dev->set_tx_gain(cfg->overrides.dl_gain, 0); + tx_gains[0] = usrp_dev->get_tx_gain(0); + LOGCHAN(0, DDEV, INFO) << " OVERRIDE TX gain:" << tx_gains[0] << std::endl; + } + if (iface == MULTI_ARFCN) return MULTI_ARFCN; @@ -978,6 +1010,9 @@ uhd::tune_result_t tres; std::string str_dir = tx ? "Tx" : "Rx"; + if (cfg->overrides.dl_freq_override || cfg->overrides.ul_freq_override) + return true; + if (!update_band_from_freq(freq, chan, tx)) return false; -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/32764 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I3c1b9a067cafc6d696b9aa2da8ee0480ec1e094f Gerrit-Change-Number: 32764 Gerrit-PatchSet: 1 Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bsc[master]: ctrl: Add setting SI5 neighbor list
by matanp 17 May '23

17 May '23
matanp has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/32761 ) Change subject: ctrl: Add setting SI5 neighbor list ...................................................................... ctrl: Add setting SI5 neighbor list Change-Id: I1bab242cdbd0d7b39636d69027bf75794a5d5ba7 --- M src/osmo-bsc/bts_ctrl.c 1 file changed, 60 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/61/32761/1 diff --git a/src/osmo-bsc/bts_ctrl.c b/src/osmo-bsc/bts_ctrl.c index b6a2396..353af7f 100644 --- a/src/osmo-bsc/bts_ctrl.c +++ b/src/osmo-bsc/bts_ctrl.c @@ -568,10 +568,8 @@ return 0; } -static int set_bts_neighbor_list_add_del(struct ctrl_cmd *cmd, void *data, bool add) +static int set_bts_neighbor_list_add_del(struct ctrl_cmd *cmd, void *data, bool add, struct bitvec *neigh_list) { - struct gsm_bts *bts = cmd->node; - struct bitvec *bv = &bts->si_common.neigh_list; int arfcn_int; uint16_t arfcn; enum gsm_band unused; @@ -582,20 +580,15 @@ } arfcn = (uint16_t) arfcn_int; - if (bts->neigh_list_manual_mode == NL_MODE_AUTOMATIC) { - cmd->reply = "Neighbor list not in manual mode"; - return CTRL_CMD_ERROR; - } - if (gsm_arfcn2band_rc(arfcn, &unused) < 0) { cmd->reply = "Invalid arfcn detected"; return CTRL_CMD_ERROR; } if (add) - bitvec_set_bit_pos(bv, arfcn, 1); + bitvec_set_bit_pos(neigh_list, arfcn, 1); else - bitvec_set_bit_pos(bv, arfcn, 0); + bitvec_set_bit_pos(neigh_list, arfcn, 0); cmd->reply = "OK"; return CTRL_CMD_REPLY; @@ -608,7 +601,12 @@ static int set_bts_neighbor_list_add(struct ctrl_cmd *cmd, void *data) { - return set_bts_neighbor_list_add_del(cmd, data, true); + struct gsm_bts *bts = cmd->node; + if (bts->neigh_list_manual_mode == NL_MODE_AUTOMATIC) { + cmd->reply = "Neighbor list not in manual mode"; + return CTRL_CMD_ERROR; + } + return set_bts_neighbor_list_add_del(cmd, data, true, &bts->si_common.neigh_list); } CTRL_CMD_DEFINE_WO(bts_neighbor_list_add, "neighbor-list add"); @@ -620,11 +618,50 @@ static int set_bts_neighbor_list_del(struct ctrl_cmd *cmd, void *data) { - return set_bts_neighbor_list_add_del(cmd, data, false); + struct gsm_bts *bts = cmd->node; + if (bts->neigh_list_manual_mode == NL_MODE_AUTOMATIC) { + cmd->reply = "Neighbor list not in manual mode"; + return CTRL_CMD_ERROR; + } + return set_bts_neighbor_list_add_del(cmd, data, false, &bts->si_common.neigh_list); } CTRL_CMD_DEFINE_WO(bts_neighbor_list_del, "neighbor-list del"); +static int verify_bts_neighbor_list_si5_add(struct ctrl_cmd *cmd, const char *value, void *_data) +{ + return verify_bts_neighbor_list_add_del(cmd, value, _data); +} + +static int set_bts_neighbor_list_si5_add(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + if (bts->neigh_list_manual_mode != NL_MODE_MANUAL_SI5SEP) { + cmd->reply = "Neighbor list not in manual mode with separate SI5"; + return CTRL_CMD_ERROR; + } + return set_bts_neighbor_list_add_del(cmd, data, true, &bts->si_common.si5_neigh_list); +} + +CTRL_CMD_DEFINE_WO(bts_neighbor_list_si5_add, "neighbor-list si5-add"); + +static int verify_bts_neighbor_list_si5_del(struct ctrl_cmd *cmd, const char *value, void *_data) +{ + return verify_bts_neighbor_list_add_del(cmd, value, _data); +} + +static int set_bts_neighbor_list_si5_del(struct ctrl_cmd *cmd, void *data) +{ + struct gsm_bts *bts = cmd->node; + if (bts->neigh_list_manual_mode != NL_MODE_MANUAL_SI5SEP) { + cmd->reply = "Neighbor list not in manual mode with separate SI5"; + return CTRL_CMD_ERROR; + } + return set_bts_neighbor_list_add_del(cmd, data, false, &bts->si_common.si5_neigh_list); +} + +CTRL_CMD_DEFINE_WO(bts_neighbor_list_si5_del, "neighbor-list si5-del"); + static int verify_bts_neighbor_list_mode(struct ctrl_cmd *cmd, const char *value, void *_data) { if (!strcmp(value, "automatic")) @@ -1022,6 +1059,8 @@ rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_si5); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_add); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_del); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_si5_add); + rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_si5_del); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_neighbor_list_mode); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_si2quater_neighbor_list_del_earfcn); rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_si2quater_neighbor_list_del_uarfcn); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/32761 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I1bab242cdbd0d7b39636d69027bf75794a5d5ba7 Gerrit-Change-Number: 32761 Gerrit-PatchSet: 1 Gerrit-Owner: matanp <matan1008(a)gmail.com> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (Settable)
by dexter 17 May '23

17 May '23
Attention is currently required from: osmith, laforge, fixeria. dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/32532 ) Change subject: pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (Settable) ...................................................................... Patch Set 17: (1 comment) File pySim-shell.py: https://gerrit.osmocom.org/c/pysim/+/32532/comment/dc985d37_f9254538 PS14, Line 154: \ > yes. but I'd not block the patch on this. https://osmocom. […] Ok, that is sad. The current pylint is clearly not happy when the \ are missing. -- To view, visit https://gerrit.osmocom.org/c/pysim/+/32532 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I38efe4702277ee092a5542d7d659df08cb0adeff Gerrit-Change-Number: 32532 Gerrit-PatchSet: 17 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Wed, 17 May 2023 15:37:47 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: [WIP] osmo_io: Support detecting connect
by pespin 17 May '23

17 May '23
Attention is currently required from: daniel. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32759 ) Change subject: [WIP] osmo_io: Support detecting connect ...................................................................... Patch Set 1: (2 comments) Commit Message: https://gerrit.osmocom.org/c/libosmocore/+/32759/comment/4a9c9031_8cdb0a8f PS1, Line 13: osmo_iofd_write_enable() so that if called and the write queue is empty please rephrease this, I don't understand. File src/core/osmo_io_poll.c: https://gerrit.osmocom.org/c/libosmocore/+/32759/comment/26236227_9432b01a PS1, Line 114: if (iofd->mode == OSMO_IO_FD_MODE_READ_WRITE) some comment like: /* socket becomes writeable butno message to be sent. This happens usually during async connect()) */ -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32759 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I893cbc3becd5e125f2f06b3654578aed0aacadf3 Gerrit-Change-Number: 32759 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Wed, 17 May 2023 15:32:12 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in pysim[master]: pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (Settable)
by dexter 17 May '23

17 May '23
Attention is currently required from: laforge, fixeria, dexter. Hello Jenkins Builder, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/32532 to look at the new patch set (#17). Change subject: pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (Settable) ...................................................................... pySim-shell: fix compatibility problem with cmd2 >= 2.0.0 (Settable) In cmd2 relase 2.0.0 the constructor of Settable adds a settable_object parameter, which apparantly was optional at first, but then became mandatory. Older versions must not have the settable_object parameter but versions from 2.0.0 on require it. Let's add a version check so that we stay compatible to cmd2 versions below and above 2.0.0. See also: https://github.com/python-cmd2/cmd2 Commit 486734e85988d0d0160147b0b44a37759c833e8a Author: Eric Lin <anselor(a)gmail.com> Date: 2020-08-19 20:01:50 and Commit 8f981f37eddcccc919329245b85fd44d5975a6a7 Author: Eric Lin <anselor(a)gmail.com> Date: 2021-03-16 17:25:34 This commit is based on pySim gerrit change: Ifce40410587c85ae932774144b9548b154ee8ad0 Change-Id: I38efe4702277ee092a5542d7d659df08cb0adeff --- M README.md M pySim-shell.py M requirements.txt M setup.py 4 files changed, 50 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/32/32532/17 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/32532 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I38efe4702277ee092a5542d7d659df08cb0adeff Gerrit-Change-Number: 32532 Gerrit-PatchSet: 17 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[L] Change in osmocom-bb[master]: layer23: subscriber: Move generic APIs to the top section
by pespin 17 May '23

17 May '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/32760 ) Change subject: layer23: subscriber: Move generic APIs to the top section ...................................................................... layer23: subscriber: Move generic APIs to the top section This way we end up with the generic section on top, followed by each backend section clearly delimited. As a result, it is now much clearer the separation between the generic code and each backend specific implementation. Change-Id: Ice8ada52f227ee4da90ba37ec6b3eb8070621f85 --- M src/host/layer23/src/common/subscriber.c 1 file changed, 206 insertions(+), 191 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/60/32760/1 diff --git a/src/host/layer23/src/common/subscriber.c b/src/host/layer23/src/common/subscriber.c index bdd6b62..c1f9806 100644 --- a/src/host/layer23/src/common/subscriber.c +++ b/src/host/layer23/src/common/subscriber.c @@ -92,9 +92,9 @@ return result; } -/* - * init/exit - */ +/************************************** + * Generic backend-agnostic API + **************************************/ int gsm_subscr_init(struct osmocom_ms *ms) { @@ -328,9 +328,188 @@ } } -/* - * test card - */ +/* del forbidden PLMN. if MCC==0, flush complete list */ +int gsm_subscr_del_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc, + uint16_t mnc) +{ + struct gsm_sub_plmn_na *na, *na2; + int deleted = 0; + + llist_for_each_entry_safe(na, na2, &subscr->plmn_na, entry) { + if (!mcc || (na->mcc == mcc && na->mnc == mnc)) { + LOGP(DPLMN, LOGL_INFO, "Delete from list of forbidden " + "PLMNs (mcc=%s, mnc=%s)\n", + gsm_print_mcc(mcc), gsm_print_mnc(mnc)); + llist_del(&na->entry); + talloc_free(na); + deleted = 1; + if (mcc) + break; + } + } + + if (deleted) { + /* update plmn not allowed list on SIM */ + subscr_write_plmn_na(subscr->ms); + } + + return -EINVAL; +} + +/* add forbidden PLMN */ +int gsm_subscr_add_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc, + uint16_t mnc, uint8_t cause) +{ + struct gsm_sub_plmn_na *na; + + /* if already in the list, remove and add to tail */ + gsm_subscr_del_forbidden_plmn(subscr, mcc, mnc); + + LOGP(DPLMN, LOGL_INFO, "Add to list of forbidden PLMNs " + "(mcc=%s, mnc=%s)\n", gsm_print_mcc(mcc), gsm_print_mnc(mnc)); + na = talloc_zero(subscr->ms, struct gsm_sub_plmn_na); + if (!na) + return -ENOMEM; + na->mcc = mcc; + na->mnc = mnc; + na->cause = cause ? : -1; /* cause 0 is not allowed */ + llist_add_tail(&na->entry, &subscr->plmn_na); + + /* don't add Home PLMN to SIM */ + if (subscr->sim_valid && gsm_match_mnc(mcc, mnc, subscr->imsi)) + return -EINVAL; + + /* update plmn not allowed list on SIM */ + subscr_write_plmn_na(subscr->ms); + + return 0; +} + +/* search forbidden PLMN */ +int gsm_subscr_is_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc, + uint16_t mnc) +{ + struct gsm_sub_plmn_na *na; + + llist_for_each_entry(na, &subscr->plmn_na, entry) { + if (na->mcc == mcc && na->mnc == mnc) + return 1; + } + + return 0; +} + +int gsm_subscr_get_key_seq(struct osmocom_ms *ms, struct gsm_subscriber *subscr) +{ + if (ms->settings.force_rekey) + return 7; + else + return subscr->key_seq; +} + +int gsm_subscr_dump_forbidden_plmn(struct osmocom_ms *ms, + void (*print)(void *, const char *, ...), void *priv) +{ + struct gsm_subscriber *subscr = &ms->subscr; + struct gsm_sub_plmn_na *temp; + + print(priv, "MCC |MNC |cause\n"); + print(priv, "-------+-------+-------\n"); + llist_for_each_entry(temp, &subscr->plmn_na, entry) + print(priv, "%s |%s%s |#%d\n", + gsm_print_mcc(temp->mcc), gsm_print_mnc(temp->mnc), + ((temp->mnc & 0x00f) == 0x00f) ? " ":"", temp->cause); + + return 0; +} + +/* dump subscriber */ +void gsm_subscr_dump(struct gsm_subscriber *subscr, + void (*print)(void *, const char *, ...), void *priv) +{ + int i; + struct gsm_sub_plmn_list *plmn_list; + struct gsm_sub_plmn_na *plmn_na; + + print(priv, "Mobile Subscriber of MS '%s':\n", subscr->ms->name); + + if (!subscr->sim_valid) { + print(priv, " No SIM present.\n"); + return; + } + + print(priv, " IMSI: %s\n", subscr->imsi); + if (subscr->iccid[0]) + print(priv, " ICCID: %s\n", subscr->iccid); + if (subscr->sim_spn[0]) + print(priv, " Service Provider Name: %s\n", subscr->sim_spn); + if (subscr->msisdn[0]) + print(priv, " MSISDN: %s\n", subscr->msisdn); + if (subscr->sms_sca[0]) + print(priv, " SMS Service Center Address: %s\n", + subscr->sms_sca); + print(priv, " Status: %s IMSI %s", gsm_sub_sim_ustate_name(subscr->ustate), + (subscr->imsi_attached) ? "attached" : "detached"); + if (subscr->tmsi != GSM_RESERVED_TMSI) + print(priv, " TMSI 0x%08x", subscr->tmsi); + if (subscr->ptmsi != GSM_RESERVED_TMSI) + print(priv, " P-TMSI 0x%08x", subscr->ptmsi); + if (subscr->lac > 0x0000 && subscr->lac < 0xfffe) { + print(priv, "\n"); + print(priv, " LAI: MCC %s MNC %s LAC 0x%04x " + "(%s, %s)\n", gsm_print_mcc(subscr->mcc), + gsm_print_mnc(subscr->mnc), subscr->lac, + gsm_get_mcc(subscr->mcc), + gsm_get_mnc(subscr->mcc, subscr->mnc)); + } else + print(priv, " LAI: invalid\n"); + if (subscr->key_seq != 7) { + print(priv, " Key: sequence %d ", subscr->key_seq); + for (i = 0; i < sizeof(subscr->key); i++) + print(priv, " %02x", subscr->key[i]); + print(priv, "\n"); + } + if (subscr->plmn_valid) + print(priv, " Registered PLMN: MCC %s MNC %s (%s, %s)\n", + gsm_print_mcc(subscr->plmn_mcc), + gsm_print_mnc(subscr->plmn_mnc), + gsm_get_mcc(subscr->plmn_mcc), + gsm_get_mnc(subscr->plmn_mcc, subscr->plmn_mnc)); + print(priv, " Access barred cells: %s\n", + (subscr->acc_barr) ? "yes" : "no"); + print(priv, " Access classes:"); + for (i = 0; i < 16; i++) + if ((subscr->acc_class & (1 << i))) + print(priv, " C%d", i); + print(priv, "\n"); + if (!llist_empty(&subscr->plmn_list)) { + print(priv, " List of preferred PLMNs:\n"); + print(priv, " MCC |MNC\n"); + print(priv, " -------+-------\n"); + llist_for_each_entry(plmn_list, &subscr->plmn_list, entry) + print(priv, " %s |%s (%s, %s)\n", + gsm_print_mcc(plmn_list->mcc), + gsm_print_mnc(plmn_list->mnc), + gsm_get_mcc(plmn_list->mcc), + gsm_get_mnc(plmn_list->mcc, plmn_list->mnc)); + } + if (!llist_empty(&subscr->plmn_na)) { + print(priv, " List of forbidden PLMNs:\n"); + print(priv, " MCC |MNC |cause\n"); + print(priv, " -------+-------+-------\n"); + llist_for_each_entry(plmn_na, &subscr->plmn_na, entry) + print(priv, " %s |%s%s |#%d " + "(%s, %s)\n", gsm_print_mcc(plmn_na->mcc), + gsm_print_mnc(plmn_na->mnc), + ((plmn_na->mnc & 0x00f) == 0x00f) ? " ":"", + plmn_na->cause, gsm_get_mcc(plmn_na->mcc), + gsm_get_mnc(plmn_na->mcc, plmn_na->mnc)); + } +} + +/******************* + * testcard backend + *******************/ /* Attach test card, no SIM must be currently attached */ int gsm_subscr_insert_testcard(struct osmocom_ms *ms) @@ -415,9 +594,9 @@ return 0; } -/* - * sim card - */ +/******************** + * simcard backend + ********************/ static int subscr_sim_iccid(struct osmocom_ms *ms, uint8_t *data, uint8_t length) @@ -1144,188 +1323,10 @@ msgb_free(msg); } -/* del forbidden PLMN. if MCC==0, flush complete list */ -int gsm_subscr_del_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc, - uint16_t mnc) -{ - struct gsm_sub_plmn_na *na, *na2; - int deleted = 0; - - llist_for_each_entry_safe(na, na2, &subscr->plmn_na, entry) { - if (!mcc || (na->mcc == mcc && na->mnc == mnc)) { - LOGP(DPLMN, LOGL_INFO, "Delete from list of forbidden " - "PLMNs (mcc=%s, mnc=%s)\n", - gsm_print_mcc(mcc), gsm_print_mnc(mnc)); - llist_del(&na->entry); - talloc_free(na); - deleted = 1; - if (mcc) - break; - } - } - - if (deleted) { - /* update plmn not allowed list on SIM */ - subscr_write_plmn_na(subscr->ms); - } - - return -EINVAL; -} - -/* add forbidden PLMN */ -int gsm_subscr_add_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc, - uint16_t mnc, uint8_t cause) -{ - struct gsm_sub_plmn_na *na; - - /* if already in the list, remove and add to tail */ - gsm_subscr_del_forbidden_plmn(subscr, mcc, mnc); - - LOGP(DPLMN, LOGL_INFO, "Add to list of forbidden PLMNs " - "(mcc=%s, mnc=%s)\n", gsm_print_mcc(mcc), gsm_print_mnc(mnc)); - na = talloc_zero(subscr->ms, struct gsm_sub_plmn_na); - if (!na) - return -ENOMEM; - na->mcc = mcc; - na->mnc = mnc; - na->cause = cause ? : -1; /* cause 0 is not allowed */ - llist_add_tail(&na->entry, &subscr->plmn_na); - - /* don't add Home PLMN to SIM */ - if (subscr->sim_valid && gsm_match_mnc(mcc, mnc, subscr->imsi)) - return -EINVAL; - - /* update plmn not allowed list on SIM */ - subscr_write_plmn_na(subscr->ms); - - return 0; -} - -/* search forbidden PLMN */ -int gsm_subscr_is_forbidden_plmn(struct gsm_subscriber *subscr, uint16_t mcc, - uint16_t mnc) -{ - struct gsm_sub_plmn_na *na; - - llist_for_each_entry(na, &subscr->plmn_na, entry) { - if (na->mcc == mcc && na->mnc == mnc) - return 1; - } - - return 0; -} - -int gsm_subscr_get_key_seq(struct osmocom_ms *ms, struct gsm_subscriber *subscr) -{ - if (ms->settings.force_rekey) - return 7; - else - return subscr->key_seq; -} - -int gsm_subscr_dump_forbidden_plmn(struct osmocom_ms *ms, - void (*print)(void *, const char *, ...), void *priv) -{ - struct gsm_subscriber *subscr = &ms->subscr; - struct gsm_sub_plmn_na *temp; - - print(priv, "MCC |MNC |cause\n"); - print(priv, "-------+-------+-------\n"); - llist_for_each_entry(temp, &subscr->plmn_na, entry) - print(priv, "%s |%s%s |#%d\n", - gsm_print_mcc(temp->mcc), gsm_print_mnc(temp->mnc), - ((temp->mnc & 0x00f) == 0x00f) ? " ":"", temp->cause); - - return 0; -} - -/* dump subscriber */ -void gsm_subscr_dump(struct gsm_subscriber *subscr, - void (*print)(void *, const char *, ...), void *priv) -{ - int i; - struct gsm_sub_plmn_list *plmn_list; - struct gsm_sub_plmn_na *plmn_na; - - print(priv, "Mobile Subscriber of MS '%s':\n", subscr->ms->name); - - if (!subscr->sim_valid) { - print(priv, " No SIM present.\n"); - return; - } - - print(priv, " IMSI: %s\n", subscr->imsi); - if (subscr->iccid[0]) - print(priv, " ICCID: %s\n", subscr->iccid); - if (subscr->sim_spn[0]) - print(priv, " Service Provider Name: %s\n", subscr->sim_spn); - if (subscr->msisdn[0]) - print(priv, " MSISDN: %s\n", subscr->msisdn); - if (subscr->sms_sca[0]) - print(priv, " SMS Service Center Address: %s\n", - subscr->sms_sca); - print(priv, " Status: %s IMSI %s", gsm_sub_sim_ustate_name(subscr->ustate), - (subscr->imsi_attached) ? "attached" : "detached"); - if (subscr->tmsi != GSM_RESERVED_TMSI) - print(priv, " TMSI 0x%08x", subscr->tmsi); - if (subscr->ptmsi != GSM_RESERVED_TMSI) - print(priv, " P-TMSI 0x%08x", subscr->ptmsi); - if (subscr->lac > 0x0000 && subscr->lac < 0xfffe) { - print(priv, "\n"); - print(priv, " LAI: MCC %s MNC %s LAC 0x%04x " - "(%s, %s)\n", gsm_print_mcc(subscr->mcc), - gsm_print_mnc(subscr->mnc), subscr->lac, - gsm_get_mcc(subscr->mcc), - gsm_get_mnc(subscr->mcc, subscr->mnc)); - } else - print(priv, " LAI: invalid\n"); - if (subscr->key_seq != 7) { - print(priv, " Key: sequence %d ", subscr->key_seq); - for (i = 0; i < sizeof(subscr->key); i++) - print(priv, " %02x", subscr->key[i]); - print(priv, "\n"); - } - if (subscr->plmn_valid) - print(priv, " Registered PLMN: MCC %s MNC %s (%s, %s)\n", - gsm_print_mcc(subscr->plmn_mcc), - gsm_print_mnc(subscr->plmn_mnc), - gsm_get_mcc(subscr->plmn_mcc), - gsm_get_mnc(subscr->plmn_mcc, subscr->plmn_mnc)); - print(priv, " Access barred cells: %s\n", - (subscr->acc_barr) ? "yes" : "no"); - print(priv, " Access classes:"); - for (i = 0; i < 16; i++) - if ((subscr->acc_class & (1 << i))) - print(priv, " C%d", i); - print(priv, "\n"); - if (!llist_empty(&subscr->plmn_list)) { - print(priv, " List of preferred PLMNs:\n"); - print(priv, " MCC |MNC\n"); - print(priv, " -------+-------\n"); - llist_for_each_entry(plmn_list, &subscr->plmn_list, entry) - print(priv, " %s |%s (%s, %s)\n", - gsm_print_mcc(plmn_list->mcc), - gsm_print_mnc(plmn_list->mnc), - gsm_get_mcc(plmn_list->mcc), - gsm_get_mnc(plmn_list->mcc, plmn_list->mnc)); - } - if (!llist_empty(&subscr->plmn_na)) { - print(priv, " List of forbidden PLMNs:\n"); - print(priv, " MCC |MNC |cause\n"); - print(priv, " -------+-------+-------\n"); - llist_for_each_entry(plmn_na, &subscr->plmn_na, entry) - print(priv, " %s |%s%s |#%d " - "(%s, %s)\n", gsm_print_mcc(plmn_na->mcc), - gsm_print_mnc(plmn_na->mnc), - ((plmn_na->mnc & 0x00f) == 0x00f) ? " ":"", - plmn_na->cause, gsm_get_mcc(plmn_na->mcc), - gsm_get_mnc(plmn_na->mcc, plmn_na->mnc)); - } -} - -/* - * SAP interface integration - */ +/*********************************************** + * sapcard backend + * (SAP interface integration, reuses some parts of simcard backend) + ***********************************************/ /* Attach SIM card over SAP */ int gsm_subscr_insert_sapcard(struct osmocom_ms *ms) -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/32760 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ice8ada52f227ee4da90ba37ec6b3eb8070621f85 Gerrit-Change-Number: 32760 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: osmo_io: Improve handling of segmentation_cb
by Jenkins Builder 17 May '23

17 May '23
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32758 ) Change subject: osmo_io: Improve handling of segmentation_cb ...................................................................... Patch Set 1: (1 comment) File src/core/osmo_io.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-7060): https://gerrit.osmocom.org/c/libosmocore/+/32758/comment/719ce667_e1e685b6 PS1, Line 239: LOGPIO(iofd, LOGL_ERROR, "segmentation_cb returned error (%i), skipping msg of size %i\n", len, msg_len); Use %d instead of %i -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32758 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I6a0eebb8d4490f09a3cc6eb97d4ff47b4a8fd377 Gerrit-Change-Number: 32758 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Wed, 17 May 2023 15:27:22 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[L] Change in osmo-mgw[master]: mgcp_codec: fix codec decision
by Jenkins Builder 17 May '23

17 May '23
Attention is currently required from: neels, fixeria, pespin. Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/32218 ) Change subject: mgcp_codec: fix codec decision ...................................................................... Patch Set 12: (1 comment) File src/libosmo-mgcp/mgcp_codec.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-7058): https://gerrit.osmocom.org/c/osmo-mgw/+/32218/comment/43953580_41a45991 PS12, Line 361: return &rtp_end->codecs[i]; code indent should use tabs where possible -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/32218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6c3291f825488e5d8ce136aeb18450156794aeb5 Gerrit-Change-Number: 32218 Gerrit-PatchSet: 12 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Wed, 17 May 2023 15:26:55 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bts[master]: TCH DL, FR & EFR: reshape SIDs per 06.31/06.81 section 5.1.2
by falconia 17 May '23

17 May '23
Attention is currently required from: pespin, dexter. falconia has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/32714 ) Change subject: TCH DL, FR & EFR: reshape SIDs per 06.31/06.81 section 5.1.2 ...................................................................... Patch Set 4: (2 comments) File src/common/l1sap.c: https://gerrit.osmocom.org/c/osmo-bts/+/32714/comment/143d3069_e4e06b00 PS3, Line 1441: if (!resp_msg && lchan->tch.dtx_fr_efr.last_rtp_input_was_sid && > maybe just putting the whole code path in a static function would already improve the readability of […] @dexter - sure, let's factor it out. I shall prepare another patchset with two static functions factored out: one for SID analysis of just-received RTP frames, and the other for the decision & transformation logic. File src/common/l1sap.c: https://gerrit.osmocom.org/c/osmo-bts/+/32714/comment/6d9e7c6b_0d7e4c76 PS4, Line 1393: * until OS#5688 is resolved. */ > I guess the problem is that you do not know which of the two payload formats you will see here. […] It looks like I need to change that comment and include a longer explanation of why I am not supporting HR1 yet. OS#5688 is one part of the problem, but the other (big) part of the problem is that we don't have a function like osmo_{fr,efr}_sid_classify() for HR1. For FR and EFR I am able to make care-free use of simple osmo_{fr,efr}_check_sid() functions only because in an earlier commit we added calls to osmo_{fr,efr}_sid_preen() into the code path that happens just before the present step, and after these preening functions the codec frame can only be either non-SID speech or a perfect error-free SID - the preening functions clean up other possibilities. And those preening functions are in turn based on osmo_{fr,efr}_sid_classify(). Why can't we simply add a SID classification function for HR1 just like I did for FR and EFR? The fundamental problem is that unlike 06.31 and 06.81, the GSM 06.41 spec for HR DTX does NOT prescribe a fixed set of rules for valid and invalid SID classification - instead it is left up to the discretion of channel decoder (!) implementors. In the original E1 Abis architecture the "SID class" ternary flag would travel (as two out-of-band control bits) along with the data bits in TRAU frames, hence only the entity that does the lowest-level channel decoding gets to decide exactly which rules to apply - and all downstream entities follow what those two out-of-band bits say. In the case of TFO calls the TFO block in the downstream TRAU would look at the SID class bits passed inside TFO frames from the upstream TRAU - but with our RTP-based TrFO taking the place of T1/E1 TFO, those original SID class bits are lost. I plan on covering this topic in June OsmoDevCall. Until then we can either merge the patch adding proper FR & EFR handling while leaving HR1 as a FIXME for other/later developers, or we could postpone merging of this patch until we thoroughly talk about this entire topic in June. -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/32714 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I924ab21952dcf8bb03ba7ccef790474bf66fc9e5 Gerrit-Change-Number: 32714 Gerrit-PatchSet: 4 Gerrit-Owner: falconia <falcon(a)freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Wed, 17 May 2023 15:26:51 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: falconia <falcon(a)freecalypso.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • ...
  • 259
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.