aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac19
-rwxr-xr-xcontrib/jenkins_bts_trx.sh1
-rwxr-xr-xcontrib/jenkins_oct_and_bts_trx.sh1
-rwxr-xr-xcontrib/jenkins_sysmobts.sh1
-rw-r--r--debian/control1
-rw-r--r--include/osmo-bts/abis.h15
-rw-r--r--include/osmo-bts/bts.h9
-rw-r--r--include/osmo-bts/bts_trx.h1
-rw-r--r--include/osmo-bts/gsm_data.h39
-rw-r--r--include/osmo-bts/power_control.h3
-rw-r--r--include/osmo-bts/ta_control.h2
-rw-r--r--src/common/abis.c270
-rw-r--r--src/common/bts.c9
-rw-r--r--src/common/gsm_data.c145
-rw-r--r--src/common/handover.c6
-rw-r--r--src/common/l1sap.c52
-rw-r--r--src/common/lchan.c55
-rw-r--r--src/common/main.c28
-rw-r--r--src/common/measurement.c39
-rw-r--r--src/common/power_control.c263
-rw-r--r--src/common/rsl.c111
-rw-r--r--src/common/ta_control.c88
-rw-r--r--src/common/vty.c104
-rw-r--r--src/osmo-bts-octphy/l1_oml.c2
-rw-r--r--src/osmo-bts-omldummy/main.c12
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchf.c26
-rw-r--r--src/osmo-bts-trx/sched_lchan_tchh.c32
-rw-r--r--src/osmo-bts-trx/sched_utils.h76
-rw-r--r--src/osmo-bts-virtual/l1_if.c6
-rw-r--r--tests/Makefile.am30
-rw-r--r--tests/amr/Makefile.am11
-rw-r--r--tests/amr/amr_test.c151
-rw-r--r--tests/amr/amr_test.ok152
-rw-r--r--tests/meas/meas_testcases.h2
-rw-r--r--tests/osmo-bts.vty297
-rw-r--r--tests/power/bs_power_loop_test.c11
-rw-r--r--tests/power/bs_power_loop_test.err187
-rw-r--r--tests/power/ms_power_loop_test.c234
-rw-r--r--tests/power/ms_power_loop_test.err111
-rw-r--r--tests/power/ms_power_loop_test.ok34
-rw-r--r--tests/ta_control/ta_control_test.c19
-rw-r--r--tests/ta_control/ta_control_test.ok784
-rw-r--r--tests/testsuite.at6
43 files changed, 2512 insertions, 933 deletions
diff --git a/configure.ac b/configure.ac
index 2b5a3169..4f2e889f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -349,6 +349,24 @@ then
AC_SUBST([OSMO_GSM_MANUALS_DIR])
fi
+AC_ARG_ENABLE([external_tests],
+ AC_HELP_STRING([--enable-external-tests],
+ [Include the VTY/CTRL tests in make check [default=no]]),
+ [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
+if test "x$enable_ext_tests" = "xyes" ; then
+ AC_CHECK_PROG(PYTHON3_AVAIL,python3,yes)
+ if test "x$PYTHON3_AVAIL" != "xyes" ; then
+ AC_MSG_ERROR([Please install python3 to run the VTY/CTRL tests.])
+ fi
+ AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
+ if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
+ AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
+ fi
+fi
+AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
+AC_MSG_RESULT([$enable_ext_tests])
+AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
+
# https://www.freedesktop.org/software/systemd/man/daemon.html
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
@@ -393,6 +411,7 @@ AC_OUTPUT(
tests/tx_power/Makefile
tests/power/Makefile
tests/meas/Makefile
+ tests/amr/Makefile
doc/Makefile
doc/examples/Makefile
doc/manuals/Makefile
diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh
index 54efa56f..cb041a58 100755
--- a/contrib/jenkins_bts_trx.sh
+++ b/contrib/jenkins_bts_trx.sh
@@ -17,6 +17,7 @@ configure_flags="\
--enable-sanitize \
--enable-werror \
--enable-trx \
+ --enable-external-tests \
"
build_bts "osmo-bts-trx" "$configure_flags"
diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh
index 67f67aa4..ead2f567 100755
--- a/contrib/jenkins_oct_and_bts_trx.sh
+++ b/contrib/jenkins_oct_and_bts_trx.sh
@@ -20,6 +20,7 @@ configure_flags="\
--with-octsdr-2g=$deps/layer1-headers/ \
--enable-octphy \
--enable-trx \
+ --enable-external-tests \
"
build_bts "osmo-bts-octphy+trx" "$configure_flags"
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index d0d05ae6..6376e922 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -21,6 +21,7 @@ configure_flags="\
--enable-werror \
--enable-sysmocom-bts \
--with-sysmobts=$inst/include/ \
+ --enable-external-tests \
"
# This will not work for the femtobts
diff --git a/debian/control b/debian/control
index 5a42d194..3b8098b4 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,6 @@ Priority: optional
Build-Depends: debhelper (>= 9),
pkg-config,
dh-autoreconf,
- dh-systemd (>= 1.5),
autotools-dev,
pkg-config,
libosmocore-dev (>= 1.5.0),
diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.h
index 62407ece..b05461b4 100644
--- a/include/osmo-bts/abis.h
+++ b/include/osmo-bts/abis.h
@@ -6,19 +6,14 @@
#include <osmo-bts/gsm_data.h>
-#define OML_RETRY_TIMER 5
-#define OML_PING_TIMER 20
-
-enum {
- LINK_STATE_IDLE = 0,
- LINK_STATE_RETRYING,
- LINK_STATE_CONNECTING,
- LINK_STATE_CONNECT,
+enum abis_link_fsm_event {
+ ABIS_LINK_EV_SIGN_LINK_DOWN,
+ ABIS_LINK_EV_VTY_RM_ADDR,
};
void abis_init(struct gsm_bts *bts);
-struct e1inp_line *abis_open(struct gsm_bts *bts, char *dst_host,
- char *model_name);
+int abis_open(struct gsm_bts *bts, char *model_name);
+
int abis_oml_sendmsg(struct msgb *msg);
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index 6a61d015..6e0e47b1 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -133,6 +133,12 @@ struct gsm_bts_sm {
struct gsm_abis_mo mo;
};
+/* Struct that holds one OML-Address (Address of the BSC) */
+struct bsc_oml_host {
+ struct llist_head list;
+ char *addr;
+};
+
/* One BTS */
struct gsm_bts {
/* list header in net->bts_list */
@@ -295,7 +301,7 @@ struct gsm_bts {
} etws;
struct paging_state *paging_state;
- char *bsc_oml_host;
+ struct llist_head bsc_oml_hosts;
struct llist_head oml_queue;
unsigned int rtp_jitter_buf_ms;
bool rtp_jitter_adaptive;
@@ -363,6 +369,7 @@ struct gsm_bts {
} gsmtap;
struct osmo_fsm_inst *shutdown_fi; /* FSM instance to manage shutdown procedure during process exit */
+ struct osmo_fsm_inst *abis_link_fi; /* FSM instance to manage abis connection during process startup and link failure */
struct osmo_tdef *T_defs; /* Timer defines */
void *model_priv; /* Allocated by bts_model, contains model specific data pointer */
diff --git a/include/osmo-bts/bts_trx.h b/include/osmo-bts/bts_trx.h
index f033573f..e1959c86 100644
--- a/include/osmo-bts/bts_trx.h
+++ b/include/osmo-bts/bts_trx.h
@@ -30,6 +30,7 @@ struct gsm_bts_trx {
uint8_t max_power_backoff_8psk; /* in actual dB OC-2G only */
uint8_t c0_idle_power_red; /* in actual dB OC-2G only */
+ uint8_t ta_ctrl_interval; /* 1 step is 2 SACCH periods */
struct trx_power_params power_params;
struct gsm_power_ctrl_params *bs_dpc_params; /* BS Dynamic Power Control */
diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 0ed63612..9fe68d63 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -9,6 +9,7 @@
#include <osmocom/core/statistics.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/tdef.h>
#include <osmocom/codec/ecu.h>
#include <osmocom/gsm/lapdm.h>
#include <osmocom/gsm/gsm23003.h>
@@ -92,7 +93,6 @@ enum gsm_lchan_state {
LCHAN_S_REL_REQ, /* channel release has been requested */
LCHAN_S_REL_ERR, /* channel is in an error state */
LCHAN_S_BROKEN, /* channel is somehow unusable */
- LCHAN_S_INACTIVE, /* channel is set inactive */
};
#define MAX_NUM_UL_MEAS 104
@@ -105,8 +105,8 @@ struct bts_ul_meas {
uint16_t ber10k;
/* timing advance offset (in 1/256 bits) */
int16_t ta_offs_256bits;
- /* C/I ratio in dB */
- float c_i;
+ /* C/I ratio in cB */
+ int16_t c_i;
/* flags */
uint8_t is_sub:1;
/* RSSI in dBm * -1 */
@@ -211,6 +211,14 @@ struct gsm_power_ctrl_params {
/* Measurement averaging parameters for RxLev & RxQual */
struct gsm_power_ctrl_meas_params rxqual_meas;
struct gsm_power_ctrl_meas_params rxlev_meas;
+
+ /* Measurement averaging parameters for C/I, per chan type */
+ struct gsm_power_ctrl_meas_params ci_fr_meas;
+ struct gsm_power_ctrl_meas_params ci_hr_meas;
+ struct gsm_power_ctrl_meas_params ci_amr_fr_meas;
+ struct gsm_power_ctrl_meas_params ci_amr_hr_meas;
+ struct gsm_power_ctrl_meas_params ci_sdcch_meas;
+ struct gsm_power_ctrl_meas_params ci_gprs_meas;
};
/* Default MS/BS Power Control parameters */
@@ -234,6 +242,8 @@ struct lchan_power_ctrl_state {
const struct gsm_power_ctrl_params *dpc_params;
/* Measurement pre-processing state (for dynamic mode) */
struct gsm_power_ctrl_meas_proc_state rxlev_meas_proc;
+ struct gsm_power_ctrl_meas_proc_state rxqual_meas_proc;
+ struct gsm_power_ctrl_meas_proc_state ci_meas_proc;
/* Number of SACCH blocks to skip (for dynamic mode) */
int skip_block_num;
@@ -244,6 +254,13 @@ struct lchan_power_ctrl_state {
uint8_t max;
};
+struct lchan_ta_ctrl_state {
+ /* Number of SACCH blocks to skip */
+ int skip_block_num;
+ /* Currently requested TA */
+ uint8_t current;
+};
+
struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;
@@ -278,8 +295,6 @@ struct gsm_lchan {
struct osmo_rtp_socket *rtp_socket;
} abis_ip;
- uint8_t rqd_ta;
-
char *name;
/* For handover, activation is described in 3GPP TS 48.058 4.1.3 and 4.1.4:
@@ -326,6 +341,8 @@ struct gsm_lchan {
struct rsl_l1_info l1_info;
struct gsm_meas_rep_unidir ul_res;
int16_t ms_toa256;
+ int16_t ul_ci_cb_full;
+ int16_t ul_ci_cb_sub;
/* Frame number of the last measurement indication receceived */
uint32_t last_fn;
/* Osmocom extended measurement results, see LC_UL_M_F_EXTD_VALID */
@@ -393,6 +410,9 @@ struct gsm_lchan {
/* RTP header Marker bit to indicate beginning of speech after pause */
bool rtp_tx_marker;
+ /* TA Control Loop */
+ struct lchan_ta_ctrl_state ta_ctrl;
+
/* MS/BS power control state */
struct lchan_power_ctrl_state ms_power_ctrl;
struct lchan_power_ctrl_state bs_power_ctrl;
@@ -413,6 +433,12 @@ struct gsm_lchan {
/* Message buffer to store DL-SACCH repeation candidate */
struct msgb *rep_sacch;
+
+ /* Cached early Immediate Assignment message: if the Immediate Assignment arrives before the channel is
+ * confirmed active, then cache it here and send it once the channel is confirmed to be active. This is related
+ * to the Early IA feature, see OsmoBSC config option 'immediate-assignment pre-chan-ack'. */
+ struct msgb *early_rr_ia;
+ struct osmo_timer_list early_rr_ia_delay;
};
extern const struct value_string lchan_ciph_state_names[];
@@ -517,6 +543,9 @@ enum gprs_cs {
* OML connection will cause a special warning to be logged. */
#define OSMO_BTS_OML_CONN_EARLY_DISCONNECT 10 /* in seconds */
+extern struct osmo_tdef_group bts_tdef_groups[];
+extern struct osmo_tdef bts_T_defs[];
+extern struct osmo_tdef abis_T_defs[];
extern const struct value_string gsm_pchant_names[13];
extern const struct value_string gsm_pchant_descs[13];
diff --git a/include/osmo-bts/power_control.h b/include/osmo-bts/power_control.h
index f2e14cfe..ed9f8919 100644
--- a/include/osmo-bts/power_control.h
+++ b/include/osmo-bts/power_control.h
@@ -5,7 +5,8 @@
int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan,
const uint8_t ms_power_lvl,
- const int8_t ul_rssi_dbm);
+ const int8_t ul_rssi_dbm,
+ const int16_t ul_lqual_cb);
int lchan_bs_pwr_ctrl(struct gsm_lchan *lchan,
const struct gsm48_hdr *gh);
diff --git a/include/osmo-bts/ta_control.h b/include/osmo-bts/ta_control.h
index 168f14a7..bf993319 100644
--- a/include/osmo-bts/ta_control.h
+++ b/include/osmo-bts/ta_control.h
@@ -2,4 +2,4 @@
#include <osmo-bts/gsm_data.h>
-void lchan_ms_ta_ctrl(struct gsm_lchan *lchan);
+void lchan_ms_ta_ctrl(struct gsm_lchan *lchan, uint8_t ms_tx_ta, int16_t toa256);
diff --git a/src/common/abis.c b/src/common/abis.c
index abef8264..e82ac963 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -38,11 +38,13 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/signal.h>
#include <osmocom/core/macaddr.h>
+#include <osmocom/core/fsm.h>
#include <osmocom/abis/abis.h>
#include <osmocom/abis/e1_input.h>
#include <osmocom/abis/ipaccess.h>
#include <osmocom/gsm/ipa.h>
+#include <osmo-bts/abis.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/bts.h>
@@ -54,6 +56,197 @@
static struct gsm_bts *g_bts;
+static struct e1inp_line_ops line_ops;
+
+static struct ipaccess_unit bts_dev_info;
+
+#define S(x) (1 << (x))
+
+enum abis_link_fsm_state {
+ ABIS_LINK_ST_CONNECTING,
+ ABIS_LINK_ST_CONNECTED,
+ ABIS_LINK_ST_FAILED,
+};
+
+static const struct value_string abis_link_fsm_event_names[] = {
+ OSMO_VALUE_STRING(ABIS_LINK_EV_SIGN_LINK_DOWN),
+ OSMO_VALUE_STRING(ABIS_LINK_EV_VTY_RM_ADDR),
+ {}
+};
+
+struct abis_link_fsm_priv {
+ struct llist_head *bsc_oml_host;
+ struct gsm_bts *bts;
+ char *model_name;
+ int line_ctr;
+};
+
+static void abis_link_connecting_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+ struct e1inp_line *line;
+ struct abis_link_fsm_priv *priv = fi->priv;
+ struct gsm_bts *bts = priv->bts;
+ struct bsc_oml_host *bsc_oml_host;
+
+ if (priv->bsc_oml_host) {
+ /* Get a BSC host from the list and move the list head one position forward. */
+ bsc_oml_host = (struct bsc_oml_host *)priv->bsc_oml_host;
+ if (priv->bsc_oml_host == llist_last(&bts->bsc_oml_hosts))
+ priv->bsc_oml_host = NULL;
+ else
+ priv->bsc_oml_host = priv->bsc_oml_host->next;
+ } else {
+ LOGP(DABIS, LOGL_FATAL, "No BSC available, A-bis connection establishment failed\n");
+ osmo_fsm_inst_state_chg(fi, ABIS_LINK_ST_FAILED, 0, 0);
+ return;
+ }
+
+ LOGP(DABIS, LOGL_NOTICE, "A-bis connection establishment to BSC (%s) in progress...\n", bsc_oml_host->addr);
+
+ /* patch in various data from VTY and other sources */
+ line_ops.cfg.ipa.addr = bsc_oml_host->addr;
+ osmo_get_macaddr(bts_dev_info.mac_addr, "eth0");
+ bts_dev_info.site_id = bts->ip_access.site_id;
+ bts_dev_info.bts_id = bts->ip_access.bts_id;
+ bts_dev_info.unit_name = priv->model_name;
+ if (bts->description)
+ bts_dev_info.unit_name = bts->description;
+ bts_dev_info.location2 = priv->model_name;
+
+ line = e1inp_line_find(priv->line_ctr);
+ if (line) {
+ e1inp_line_get2(line, __FILE__); /* We want a new reference for returned line */
+ } else
+ line = e1inp_line_create(priv->line_ctr, "ipa"); /* already comes with a reference */
+
+ /* The abis connection may fail and we may have to try again with a different BSC (if configured). The next
+ * attempt must happen on a different line. */
+ priv->line_ctr++;
+
+ if (!line) {
+ osmo_fsm_inst_state_chg(fi, ABIS_LINK_ST_FAILED, 0, 0);
+ return;
+ }
+ e1inp_line_bind_ops(line, &line_ops);
+
+ /* This will open the OML connection now */
+ if (e1inp_line_update(line) < 0) {
+ osmo_fsm_inst_state_chg(fi, ABIS_LINK_ST_FAILED, 0, 0);
+ return;
+ }
+
+ /* The TCP connection to the BSC is now in progress. */
+ osmo_fsm_inst_state_chg(fi, ABIS_LINK_ST_CONNECTED, 0, 0);
+}
+
+static void abis_link_connected(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+ struct abis_link_fsm_priv *priv = fi->priv;
+ struct gsm_bts *bts = priv->bts;
+ struct gsm_bts_trx *trx;
+ bool oml_rsl_was_connected = false;
+
+ OSMO_ASSERT(event == ABIS_LINK_EV_SIGN_LINK_DOWN);
+
+ /* First remove the OML signalling link */
+ if (bts->oml_link) {
+ struct timespec now;
+
+ e1inp_sign_link_destroy(bts->oml_link);
+
+ /* Log a special notice if the OML connection was dropped relatively quickly. */
+ if (bts->oml_conn_established_timestamp.tv_sec != 0 && clock_gettime(CLOCK_MONOTONIC, &now) == 0 &&
+ bts->oml_conn_established_timestamp.tv_sec + OSMO_BTS_OML_CONN_EARLY_DISCONNECT >= now.tv_sec) {
+ LOGP(DABIS, LOGL_FATAL, "OML link was closed early within %" PRIu64 " seconds. "
+ "If this situation persists, please check your BTS and BSC configuration files for errors. "
+ "A common error is a mismatch between unit_id configuration parameters of BTS and BSC.\n",
+ (uint64_t) (now.tv_sec - bts->oml_conn_established_timestamp.tv_sec));
+ }
+ bts->oml_link = NULL;
+ oml_rsl_was_connected = true;
+ }
+ memset(&bts->oml_conn_established_timestamp, 0, sizeof(bts->oml_conn_established_timestamp));
+
+ /* Then iterate over the RSL signalling links */
+ llist_for_each_entry(trx, &bts->trx_list, list) {
+ if (trx->rsl_link) {
+ e1inp_sign_link_destroy(trx->rsl_link);
+ trx->rsl_link = NULL;
+ oml_rsl_was_connected = true;
+ }
+ }
+
+ /* Note: if there was an OML or RSL connection present (the BTS was connected to a BSC). Then we will not try
+ * to connect to an alternate BSC. Instead we will shut down the BTS process. This will ensure that all states
+ * in the BTS (hardware and software) are reset properly. It is then up to the process management of the host
+ * to restart osmo-bts. */
+ if (oml_rsl_was_connected)
+ osmo_fsm_inst_state_chg(fi, ABIS_LINK_ST_FAILED, 0, 0);
+ else
+ osmo_fsm_inst_state_chg(fi, ABIS_LINK_ST_CONNECTING, 0, 0);
+}
+
+static void abis_link_failed_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+ struct abis_link_fsm_priv *priv = fi->priv;
+ struct gsm_bts *bts = priv->bts;
+
+ /* None of the configured BSCs was reachable or there was an existing
+ * OML/RSL connection that broke. Initiate BTS process shut down now. */
+ bts_model_abis_close(bts);
+}
+
+static void abis_link_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+ struct abis_link_fsm_priv *priv = fi->priv;
+ struct gsm_bts *bts = priv->bts;
+
+ OSMO_ASSERT(event == ABIS_LINK_EV_VTY_RM_ADDR);
+
+ if (priv->bsc_oml_host == data) {
+ if (llist_count(&bts->bsc_oml_hosts) <= 1)
+ priv->bsc_oml_host = NULL;
+ else if (priv->bsc_oml_host == llist_last(&bts->bsc_oml_hosts))
+ priv->bsc_oml_host = priv->bsc_oml_host->prev;
+ else
+ priv->bsc_oml_host = priv->bsc_oml_host->next;
+ }
+}
+
+static struct osmo_fsm_state abis_link_fsm_states[] = {
+ [ABIS_LINK_ST_CONNECTING] = {
+ .name = "CONNECTING",
+ .out_state_mask =
+ S(ABIS_LINK_ST_CONNECTING) |
+ S(ABIS_LINK_ST_CONNECTED) |
+ S(ABIS_LINK_ST_FAILED),
+ .onenter = abis_link_connecting_onenter,
+ },
+ [ABIS_LINK_ST_CONNECTED] = {
+ .name = "CONNECTED",
+ .in_event_mask =
+ S(ABIS_LINK_EV_SIGN_LINK_DOWN),
+ .out_state_mask =
+ S(ABIS_LINK_ST_CONNECTING) |
+ S(ABIS_LINK_ST_FAILED),
+ .action = abis_link_connected,
+ },
+ [ABIS_LINK_ST_FAILED] = {
+ .name = "FAILED",
+ .onenter = abis_link_failed_onenter,
+ },
+};
+
+static struct osmo_fsm abis_link_fsm = {
+ .name = "abis_link",
+ .states = abis_link_fsm_states,
+ .num_states = ARRAY_SIZE(abis_link_fsm_states),
+ .log_subsys = DABIS,
+ .event_names = abis_link_fsm_event_names,
+ .allstate_action = abis_link_allstate,
+ .allstate_event_mask = S(ABIS_LINK_EV_VTY_RM_ADDR),
+};
+
int abis_oml_sendmsg(struct msgb *msg)
{
struct gsm_bts *bts = msg->trx->bts;
@@ -144,41 +337,8 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line,
static void sign_link_down(struct e1inp_line *line)
{
- struct gsm_bts_trx *trx;
LOGPIL(line, DABIS, LOGL_ERROR, "Signalling link down\n");
-
- /* First remove the OML signalling link */
- if (g_bts->oml_link) {
- struct timespec now;
-
- e1inp_sign_link_destroy(g_bts->oml_link);
-
- /* Log a special notice if the OML connection was dropped relatively quickly. */
- if (g_bts->oml_conn_established_timestamp.tv_sec != 0 && clock_gettime(CLOCK_MONOTONIC, &now) == 0 &&
- g_bts->oml_conn_established_timestamp.tv_sec + OSMO_BTS_OML_CONN_EARLY_DISCONNECT >= now.tv_sec) {
- LOGP(DABIS, LOGL_FATAL, "OML link was closed early within %" PRIu64 " seconds. "
- "If this situation persists, please check your BTS and BSC configuration files for errors. "
- "A common error is a mismatch between unit_id configuration parameters of BTS and BSC.\n",
- (uint64_t)(now.tv_sec - g_bts->oml_conn_established_timestamp.tv_sec));
- }
- g_bts->oml_link = NULL;
- }
- memset(&g_bts->oml_conn_established_timestamp, 0, sizeof(g_bts->oml_conn_established_timestamp));
-
- if (g_bts->osmo_link) {
- e1inp_sign_link_destroy(g_bts->osmo_link);
- g_bts->osmo_link = NULL;
- }
-
- /* Then iterate over the RSL signalling links */
- llist_for_each_entry(trx, &g_bts->trx_list, list) {
- if (trx->rsl_link) {
- e1inp_sign_link_destroy(trx->rsl_link);
- trx->rsl_link = NULL;
- }
- }
-
- bts_model_abis_close(g_bts);
+ osmo_fsm_inst_dispatch(g_bts->abis_link_fi, ABIS_LINK_EV_SIGN_LINK_DOWN, NULL);
}
@@ -277,33 +437,27 @@ void abis_init(struct gsm_bts *bts)
osmo_signal_register_handler(SS_L_INPUT, &inp_s_cbfn, bts);
}
-struct e1inp_line *abis_open(struct gsm_bts *bts, char *dst_host,
- char *model_name)
+int abis_open(struct gsm_bts *bts, char *model_name)
{
- struct e1inp_line *line;
+ struct abis_link_fsm_priv *abis_link_fsm_priv;
- /* patch in various data from VTY and other sources */
- line_ops.cfg.ipa.addr = dst_host;
- osmo_get_macaddr(bts_dev_info.mac_addr, "eth0");
- bts_dev_info.site_id = bts->ip_access.site_id;
- bts_dev_info.bts_id = bts->ip_access.bts_id;
- bts_dev_info.unit_name = model_name;
- if (bts->description)
- bts_dev_info.unit_name = bts->description;
- bts_dev_info.location2 = model_name;
+ if (llist_empty(&bts->bsc_oml_hosts)) {
+ LOGP(DABIS, LOGL_FATAL, "No BSC configured, cannot start BTS without knowing BSC OML IP\n");
+ return -EINVAL;
+ }
- line = e1inp_line_find(0);
- if (line) {
- e1inp_line_get2(line, __FILE__); /* We want a new reference for returned line */
- } else
- line = e1inp_line_create(0, "ipa"); /* already comes with a reference */
- if (!line)
- return NULL;
- e1inp_line_bind_ops(line, &line_ops);
+ OSMO_ASSERT(osmo_fsm_register(&abis_link_fsm) == 0);
+ bts->abis_link_fi = osmo_fsm_inst_alloc(&abis_link_fsm, bts, NULL, LOGL_DEBUG, "abis_link");
+ OSMO_ASSERT(bts->abis_link_fi);
- /* This will open the OML connection now */
- if (e1inp_line_update(line) < 0)
- return NULL;
+ abis_link_fsm_priv = talloc_zero(bts->abis_link_fi, struct abis_link_fsm_priv);
+ OSMO_ASSERT(abis_link_fsm_priv);
+ abis_link_fsm_priv->bsc_oml_host = bts->bsc_oml_hosts.next;
+ abis_link_fsm_priv->bts = bts;
+ abis_link_fsm_priv->model_name = model_name;
+ bts->abis_link_fi->priv = abis_link_fsm_priv;
+
+ osmo_fsm_inst_state_chg_ms(bts->abis_link_fi, ABIS_LINK_ST_CONNECTING, 1, 0);
- return line;
+ return 0;
}
diff --git a/src/common/bts.c b/src/common/bts.c
index 27c7f74c..05584aa3 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -128,7 +128,7 @@ static const struct rate_ctr_group_desc cbch_ctrg_desc = {
cbch_ctr_desc
};
-static struct osmo_tdef bts_T_defs[] = {
+struct osmo_tdef bts_T_defs[] = {
/* T-1: FIXME: Ideally should be dynamically calculated per trx at
* shutdown start based on params below, and highest trx value taken:
* + VTY's power-ramp step-interval.
@@ -143,6 +143,11 @@ static struct osmo_tdef bts_T_defs[] = {
{}
};
+struct osmo_tdef abis_T_defs[] = {
+ { .T=-15, .default_val=0, .unit=OSMO_TDEF_MS, .desc="Time to wait between Channel Activation and dispatching a cached early Immediate Assignment" },
+ {}
+};
+
static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 };
static const uint8_t bts_cell_timer_default[] =
{ 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 };
@@ -234,6 +239,7 @@ struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num)
bts->T_defs = bts_T_defs;
osmo_tdefs_reset(bts->T_defs);
+ osmo_tdefs_reset(abis_T_defs);
bts->shutdown_fi = osmo_fsm_inst_alloc(&bts_shutdown_fsm, bts, bts,
LOGL_INFO, NULL);
osmo_fsm_inst_update_id_f(bts->shutdown_fi, "bts%d", bts->nr);
@@ -402,6 +408,7 @@ int bts_init(struct gsm_bts *bts)
bts->smscb_queue_hyst = 2;
INIT_LLIST_HEAD(&bts->oml_queue);
+ INIT_LLIST_HEAD(&bts->bsc_oml_hosts);
/* register DTX DL FSM */
rc = osmo_fsm_register(&dtx_dl_amr_fsm);
diff --git a/src/common/gsm_data.c b/src/common/gsm_data.c
index 36a57115..ee6e6930 100644
--- a/src/common/gsm_data.c
+++ b/src/common/gsm_data.c
@@ -40,6 +40,12 @@
#include <osmo-bts/bts_trx.h>
#include <osmo-bts/logging.h>
+struct osmo_tdef_group bts_tdef_groups[] = {
+ { .name = "bts", .tdefs = bts_T_defs, .desc = "BTS process timers" },
+ { .name = "abis", .tdefs = abis_T_defs, .desc = "Abis (RSL) related timers" },
+ {}
+};
+
const struct value_string gsm_pchant_names[13] = {
{ GSM_PCHAN_NONE, "NONE" },
{ GSM_PCHAN_CCCH, "CCCH" },
@@ -88,7 +94,6 @@ static const struct value_string lchan_s_names[] = {
{ LCHAN_S_NONE, "NONE" },
{ LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" },
{ LCHAN_S_ACTIVE, "ACTIVE" },
- { LCHAN_S_INACTIVE, "INACTIVE" },
{ LCHAN_S_REL_REQ, "RELEASE REQUESTED" },
{ LCHAN_S_REL_ERR, "RELEASE DUE ERROR" },
{ LCHAN_S_BROKEN, "BROKEN UNUSABLE" },
@@ -499,6 +504,9 @@ int lchan2ecu_codec(const struct gsm_lchan *lchan)
/* Default MS/BS Power Control parameters (see 3GPP TS 45.008, table A.1) */
const struct gsm_power_ctrl_params power_ctrl_params_def = {
+
+ .ctrl_interval = 1, /* Trigger loop every second SACCH block. TS 45.008 sec 4.7.1 */
+
/* Power increasing/reducing step size (optimal defaults) */
.inc_step_size_db = 4, /* quickly increase MS/BS power */
.red_step_size_db = 2, /* slowly decrease MS/BS power */
@@ -520,7 +528,140 @@ const struct gsm_power_ctrl_params power_ctrl_params_def = {
.lower_thresh = 3, /* L_RXQUAL_XX_P (0.8% <= BER < 1.6%) */
.upper_thresh = 0, /* U_RXQUAL_XX_P (BER < 0.2%) */
- /* FIXME: RxQual averaging is not yet implemented */
+ /* No averaging (filtering) by default.
+ * NOTE: only Osmocom specific EWMA is supported */
+ .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE,
+ },
+
+ /* C/I measurement parameters.
+ * Target C/I retrieved from "GSM/EDGE: Evolution and Performance" Table 10.3.
+ * Set lower and upper so that (lower + upper) / 2 is equal or slightly
+ * above the target.
+ */
+ .ci_fr_meas = { /* FR: Target C/I = 15 dB, Soft blocking threshold = 10 dB */
+ .lower_thresh = 13,
+ .upper_thresh = 17,
+
+ /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages
+ * out of LOWER_CMP_N averages are lower than L_CI_FR_XX_P */
+ .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages
+ * out of UPPER_CMP_N averages are greater than L_CI_FR_XX_P */
+ .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+ .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+
+ /* No averaging (filtering) by default */
+ .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE,
+
+ /* Hreqave: the period over which an average is produced */
+ .h_reqave = 4, /* TODO: investigate a reasonable default value */
+ /* Hreqt: the number of averaged results maintained */
+ .h_reqt = 6, /* TODO: investigate a reasonable default value */
+ },
+ .ci_hr_meas = { /* HR: Target C/I = 18 dB, Soft blocking threshold = 13 dB */
+ .lower_thresh = 16,
+ .upper_thresh = 21,
+
+ /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages
+ * out of LOWER_CMP_N averages are lower than L_CI_HR_XX_P */
+ .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages
+ * out of UPPER_CMP_N averages are greater than L_CI_HR_XX_P */
+ .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+ .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+
+ /* No averaging (filtering) by default */
+ .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE,
+
+ /* Hreqave: the period over which an average is produced */
+ .h_reqave = 4, /* TODO: investigate a reasonable default value */
+ /* Hreqt: the number of averaged results maintained */
+ .h_reqt = 6, /* TODO: investigate a reasonable default value */
+ },
+ .ci_amr_fr_meas = { /* AMR-FR: Target C/I = 9 dB, Soft blocking threshold = 4 dB */
+ .lower_thresh = 7,
+ .upper_thresh = 11,
+
+ /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages
+ * out of LOWER_CMP_N averages are lower than L_CI_AMR_FR_XX_P */
+ .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages
+ * out of UPPER_CMP_N averages are greater than L_CI_AMR_FR_XX_P */
+ .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+ .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+
+ /* No averaging (filtering) by default */
+ .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE,
+
+ /* Hreqave: the period over which an average is produced */
+ .h_reqave = 4, /* TODO: investigate a reasonable default value */
+ /* Hreqt: the number of averaged results maintained */
+ .h_reqt = 6, /* TODO: investigate a reasonable default value */
+ },
+ .ci_amr_hr_meas = { /* AMR-HR: Target C/I = 15 dB, Soft blocking threshold = 10 dB */
+ .lower_thresh = 13,
+ .upper_thresh = 17,
+
+ /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages
+ * out of LOWER_CMP_N averages are lower than L_CI_AMR_HR_XX_P */
+ .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages
+ * out of UPPER_CMP_N averages are greater than L_CI_AMR_HR_XX_P */
+ .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+ .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+
+ /* No averaging (filtering) by default */
+ .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE,
+
+ /* Hreqave: the period over which an average is produced */
+ .h_reqave = 4, /* TODO: investigate a reasonable default value */
+ /* Hreqt: the number of averaged results maintained */
+ .h_reqt = 6, /* TODO: investigate a reasonable default value */
+ },
+ .ci_sdcch_meas = { /* SDCCH: Target C/I = 14 dB, Soft blocking threshold = 9 dB */
+ .lower_thresh = 12,
+ .upper_thresh = 16,
+
+ /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages
+ * out of LOWER_CMP_N averages are lower than L_CI_SDCCH_XX_P */
+ .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages
+ * out of UPPER_CMP_N averages are greater than L_CI_SDCCH_XX_P */
+ .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+ .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+
+ /* No averaging (filtering) by default */
+ .algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE,
+
+ /* Hreqave: the period over which an average is produced */
+ .h_reqave = 4, /* TODO: investigate a reasonable default value */
+ /* Hreqt: the number of averaged results maintained */
+ .h_reqt = 6, /* TODO: investigate a reasonable default value */
+ },
+ .ci_gprs_meas = { /* GPRS: Target C/I = 20 dB, Soft blocking threshold = 15 dB */
+ .lower_thresh = 18,
+ .upper_thresh = 24,
+
+ /* Increase {UL,DL}_TXPWR if at least LOWER_CMP_P averages
+ * out of LOWER_CMP_N averages are lower than L_CI_GPRS_XX_P */
+ .lower_cmp_p = 5, /* P3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ .lower_cmp_n = 7, /* N3 as in 3GPP TS 45.008, A.3.2.1 (case c) */
+ /* Decrease {UL,DL}_TXPWR if at least UPPER_CMP_P averages
+ * out of UPPER_CMP_N averages are greater than L_CI_GPRS_XX_P */
+ .upper_cmp_p = 15, /* P4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+ .upper_cmp_n = 18, /* N4 as in 3GPP TS 45.008, A.3.2.1 (case d) */
+
+ /* No averaging (filtering) by default */
.algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE,
+
+ /* Hreqave: the period over which an average is produced */
+ .h_reqave = 4, /* TODO: investigate a reasonable default value */
+ /* Hreqt: the number of averaged results maintained */
+ .h_reqt = 6, /* TODO: investigate a reasonable default value */
},
};
diff --git a/src/common/handover.c b/src/common/handover.c
index 888649db..922c5140 100644
--- a/src/common/handover.c
+++ b/src/common/handover.c
@@ -51,7 +51,7 @@ static int ho_tx_phys_info(struct gsm_lchan *lchan)
gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
gh->proto_discr = GSM48_PDISC_RR;
gh->msg_type = GSM48_MT_RR_HANDO_INFO;
- msgb_put_u8(msg, lchan->rqd_ta);
+ msgb_put_u8(msg, lchan->ta_ctrl.current);
rsl_rll_push_l3(msg, RSL_MT_UNIT_DATA_REQ, gsm_lchan2chan_nr(lchan),
0x00, 0);
@@ -111,7 +111,7 @@ void handover_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay)
"TA=%u, ref=%u\n", gsm_lchant_name(lchan->type), acc_delay, ra);
/* Set timing advance */
- lchan->rqd_ta = acc_delay;
+ lchan->ta_ctrl.current = acc_delay;
lchan->want_dl_sacch_active = true;
/* Stop handover detection, wait for valid frame */
@@ -123,7 +123,7 @@ void handover_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay)
}
/* Send HANDover DETect to BSC */
- rsl_tx_hando_det(lchan, &lchan->rqd_ta);
+ rsl_tx_hando_det(lchan, &lchan->ta_ctrl.current);
/* Send PHYS INFO */
lchan->ho.phys_info_count = 1;
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index c028a2c7..8aa80e75 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -53,6 +53,7 @@
#include <osmo-bts/bts_model.h>
#include <osmo-bts/handover.h>
#include <osmo-bts/power_control.h>
+#include <osmo-bts/ta_control.h>
#include <osmo-bts/msg_utils.h>
#include <osmo-bts/pcuif_proto.h>
#include <osmo-bts/cbch.h>
@@ -474,6 +475,9 @@ static bool is_fill_frame(uint8_t chan_type, const uint8_t *data, unsigned int l
switch (chan_type) {
case GSMTAP_CHANNEL_AGCH:
+ case GSMTAP_CHANNEL_SDCCH:
+ case GSMTAP_CHANNEL_TCH_F:
+ case GSMTAP_CHANNEL_TCH_H:
if (!memcmp(data, fill_frame, GSM_MACBLOCK_LEN))
return true;
break;
@@ -481,6 +485,7 @@ static bool is_fill_frame(uint8_t chan_type, const uint8_t *data, unsigned int l
if (!memcmp(data, paging_fill, GSM_MACBLOCK_LEN))
return true;
break;
+ /* FIXME: implement the same for GSMTAP_CHANNEL_PDTCH from/to PCU */
/* don't use 'default' case here as the above only conditionally return true */
}
return false;
@@ -676,6 +681,7 @@ static void process_l1sap_meas_data(struct gsm_bts_trx *trx,
uint8_t is_sub;
int16_t ta_offs_256bits;
uint16_t ber10k;
+ int16_t ci_cb;
const char *ind_name;
switch (ind_type) {
@@ -688,6 +694,7 @@ static void process_l1sap_meas_data(struct gsm_bts_trx *trx,
is_sub = info_meas_ind->is_sub;
ta_offs_256bits = info_meas_ind->ta_offs_256bits;
ber10k = info_meas_ind->ber10k;
+ ci_cb = info_meas_ind->c_i_cb;
ind_name = "MPH INFO";
break;
case PRIM_TCH:
@@ -700,6 +707,7 @@ static void process_l1sap_meas_data(struct gsm_bts_trx *trx,
is_sub = ph_tch_ind->is_sub;
ta_offs_256bits = ph_tch_ind->ta_offs_256bits;
ber10k = ph_tch_ind->ber10k;
+ ci_cb = ph_tch_ind->lqual_cb;
ind_name = "TCH";
break;
case PRIM_PH_DATA:
@@ -712,6 +720,7 @@ static void process_l1sap_meas_data(struct gsm_bts_trx *trx,
is_sub = ph_data_ind->is_sub;
ta_offs_256bits = ph_data_ind->ta_offs_256bits;
ber10k = ph_data_ind->ber10k;
+ ci_cb = ph_data_ind->lqual_cb;
ind_name = "DATA";
break;
default:
@@ -727,9 +736,9 @@ static void process_l1sap_meas_data(struct gsm_bts_trx *trx,
}
DEBUGPFN(DL1P, fn,
- "%s %s meas ind, ta_offs_256bits=%d, ber10k=%d, inv_rssi=%u\n",
+ "%s %s meas ind, ta_offs_256bits=%d, ber10k=%d, inv_rssi=%u, C/I=%d cB\n",
gsm_lchan_name(lchan), ind_name, ta_offs_256bits, ber10k,
- inv_rssi);
+ inv_rssi, ci_cb);
/* in the GPRS case we are not interested in measurement
* processing. The PCU will take care of it */
@@ -739,6 +748,7 @@ static void process_l1sap_meas_data(struct gsm_bts_trx *trx,
memset(&ulm, 0, sizeof(ulm));
ulm.ta_offs_256bits = ta_offs_256bits;
ulm.ber10k = ber10k;
+ ulm.c_i = ci_cb;
ulm.inv_rssi = inv_rssi;
ulm.is_sub = is_sub;
@@ -1181,7 +1191,7 @@ static int l1sap_ph_rts_ind(struct gsm_bts_trx *trx,
p[0] = lchan->ms_power_ctrl.current;
if (lchan->repeated_ul_sacch_active)
p[0] |= 0x40; /* See also: 3GPP TS 44.004, section 7.1 */
- p[1] = lchan->rqd_ta;
+ p[1] = lchan->ta_ctrl.current;
le = &lchan->lapdm_ch.lapdm_acch;
if (lchan->repeated_acch_capability.dl_sacch) {
/* Check if MS requests SACCH repetition and update state accordingly */
@@ -1521,11 +1531,11 @@ static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
uint8_t chan_nr, link_id;
uint8_t tn;
uint32_t fn;
- int8_t rssi;
enum osmo_ph_pres_info_type pr_info = data_ind->pdch_presence_info;
struct gsm_sacch_l1_hdr *l1_hdr;
+ int8_t ul_rssi;
+ int16_t ul_ci_cb;
- rssi = data_ind->rssi;
chan_nr = data_ind->chan_nr;
link_id = data_ind->link_id;
fn = data_ind->fn;
@@ -1573,7 +1583,7 @@ static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
/* PDTCH / PACCH frame handling */
pcu_tx_data_ind(&trx->ts[tn], PCU_IF_SAPI_PDTCH, fn, trx->arfcn,
- L1SAP_FN2MACBLOCK(fn), data, len, rssi, data_ind->ber10k,
+ L1SAP_FN2MACBLOCK(fn), data, len, data_ind->rssi, data_ind->ber10k,
data_ind->ta_offs_256bits/64, data_ind->lqual_cb);
return 0;
}
@@ -1600,7 +1610,16 @@ static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
rsl_tx_meas_res(lchan, NULL, 0, le);
radio_link_timeout(lchan, true);
- lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, data_ind->rssi);
+ lchan_ms_ta_ctrl(lchan, lchan->ta_ctrl.current, lchan->meas.ms_toa256);
+ /* If DTx is active on Downlink, use the '-SUB', otherwise '-FULL': */
+ if (lchan->tch.dtx.dl_active) {
+ ul_rssi = rxlev2dbm(lchan->meas.ul_res.sub.rx_lev);
+ ul_ci_cb = lchan->meas.ul_ci_cb_sub;
+ } else {
+ ul_rssi = rxlev2dbm(lchan->meas.ul_res.full.rx_lev);
+ ul_ci_cb = lchan->meas.ul_ci_cb_full;
+ }
+ lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, ul_rssi, ul_ci_cb);
}
return -EINVAL;
}
@@ -1628,7 +1647,24 @@ static int l1sap_ph_data_ind(struct gsm_bts_trx *trx,
lchan->meas.l1_info.ta = l1_hdr->ta;
lchan->meas.flags |= LC_UL_M_F_L1_VALID;
- lchan_ms_pwr_ctrl(lchan, data[0] & 0x1f, data_ind->rssi);
+ /* 3GPP TS 45.008 sec 4.2: UL L1 SACCH Header contains TA and
+ * MS_PWR used "for the last burst of the previous SACCH
+ * period". Since MS must use the values provided in DL SACCH
+ * starting at next meas period, the value of the "last burst"
+ * is actually the value used in the entire meas period. Since
+ * it contains info about the previous meas period, we want to
+ * feed the Control Loop with the measurements for the same
+ * period (the previous one), which is stored in lchan->meas(.ul_res): */
+ lchan_ms_ta_ctrl(lchan, l1_hdr->ta, lchan->meas.ms_toa256);
+ /* If DTx is active on Downlink, use the '-SUB', otherwise '-FULL': */
+ if (lchan->tch.dtx.dl_active) {
+ ul_rssi = rxlev2dbm(lchan->meas.ul_res.sub.rx_lev);
+ ul_ci_cb = lchan->meas.ul_ci_cb_sub;
+ } else {
+ ul_rssi = rxlev2dbm(lchan->meas.ul_res.full.rx_lev);
+ ul_ci_cb = lchan->meas.ul_ci_cb_full;
+ }
+ lchan_ms_pwr_ctrl(lchan, l1_hdr->ms_pwr, ul_rssi, ul_ci_cb);
lchan_bs_pwr_ctrl(lchan, (const struct gsm48_hdr *) &data[5]);
} else
le = &lchan->lapdm_ch.lapdm_dcch;
diff --git a/src/common/lchan.c b/src/common/lchan.c
index 5a3f539a..dcec0a31 100644
--- a/src/common/lchan.c
+++ b/src/common/lchan.c
@@ -22,6 +22,35 @@
#include <osmocom/core/logging.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/gsm_data.h>
+#include <osmo-bts/bts.h>
+#include <osmo-bts/rsl.h>
+
+void early_rr_ia_delay_cb(void *data)
+{
+ struct gsm_lchan *lchan = data;
+ struct gsm_bts *bts = lchan->ts->trx->bts;
+
+ if (!lchan->early_rr_ia) {
+ /* The IA message has disappeared since the timer was started. */
+ return;
+ }
+
+ if (lchan->state != LCHAN_S_ACTIVE) {
+ /* Release has happened since the timer was started. */
+ msgb_free(lchan->early_rr_ia);
+ lchan->early_rr_ia = NULL;
+ return;
+ }
+
+ /* Activation is done, send the RR IA now. Put RR IA msg into the AGCH queue of the BTS. */
+ if (bts_agch_enqueue(bts, lchan->early_rr_ia) < 0) {
+ /* if there is no space in the queue: send DELETE IND */
+ rsl_tx_delete_ind(bts, lchan->early_rr_ia->data, lchan->early_rr_ia->len);
+ rate_ctr_inc2(bts->ctrs, BTS_CTR_AGCH_DELETED);
+ msgb_free(lchan->early_rr_ia);
+ }
+ lchan->early_rr_ia = NULL;
+}
void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state)
{
@@ -30,6 +59,32 @@ void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state)
gsm_lchans_name(lchan->state),
gsm_lchans_name(state));
lchan->state = state;
+
+ /* Early Immediate Assignment: if we have a cached early IA pending, send it upon becoming active, or discard it
+ * when releasing. */
+ if (lchan->early_rr_ia) {
+ switch (lchan->state) {
+ case LCHAN_S_ACT_REQ:
+ /* Activation is requested, keep the early IA until active. This allows the BSC to send the IA
+ * even before a dynamic timeslot is done switching to a different pchan kind (experimental). */
+ break;
+ case LCHAN_S_ACTIVE:
+ /* Activation is done, send the RR IA now. Delay a bit more to give Um time to let the lchan
+ * light up for the MS */
+ osmo_timer_del(&lchan->early_rr_ia_delay);
+ osmo_timer_setup(&lchan->early_rr_ia_delay, early_rr_ia_delay_cb, lchan);
+ osmo_timer_schedule(&lchan->early_rr_ia_delay, 0,
+ osmo_tdef_get(abis_T_defs, -15, OSMO_TDEF_US, -1));
+ break;
+ default:
+ /* Transition to any other state means whatever IA the BSC has sent shall now not be relevant
+ * anymore. */
+ osmo_timer_del(&lchan->early_rr_ia_delay);
+ msgb_free(lchan->early_rr_ia);
+ lchan->early_rr_ia = NULL;
+ break;
+ }
+ }
}
bool ts_is_pdch(const struct gsm_bts_trx_ts *ts)
diff --git a/src/common/main.c b/src/common/main.c
index 0b7d3fb7..b5ba21b8 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -65,6 +65,7 @@ static int daemonize = 0;
static int rt_prio = -1;
static char *gsmtap_ip = 0;
extern int g_vty_port_num;
+static bool vty_test_mode = false;
static void print_help()
{
@@ -80,6 +81,8 @@ static void print_help()
"\nVTY reference generation:\n"
" --vty-ref-mode MODE VTY reference generation mode (e.g. 'expert').\n"
" --vty-ref-xml Generate the VTY reference XML output and exit.\n"
+ "\nRegression testing:\n"
+ " --vty-test VTY test mode. Do not connect to BSC, do not exit.\n"
);
bts_model_print_help();
}
@@ -103,6 +106,9 @@ static void handle_long_options(const char *prog_name, const int long_option)
get_value_string(vty_ref_gen_mode_desc, vty_ref_mode));
vty_dump_xml_ref_mode(stdout, (enum vty_ref_gen_mode) vty_ref_mode);
exit(0);
+ case 3:
+ vty_test_mode = true;
+ break;
default:
fprintf(stderr, "%s: error parsing cmdline options\n", prog_name);
exit(2);
@@ -140,6 +146,7 @@ static void handle_options(int argc, char **argv)
{ "realtime", 1, 0, 'r' },
{ "vty-ref-mode", 1, &long_option, 1 },
{ "vty-ref-xml", 0, &long_option, 2 },
+ { "vty-test", 0, &long_option, 3 },
{ 0, 0, 0, 0 }
};
@@ -272,7 +279,6 @@ static int write_pid_file(char *procname)
int bts_main(int argc, char **argv)
{
struct gsm_bts_trx *trx;
- struct e1inp_line *line;
int rc;
/* Track the use of talloc NULL memory contexts */
@@ -300,6 +306,8 @@ int bts_main(int argc, char **argv)
handle_options(argc, argv);
fprintf(stderr, "((*))\n |\n / \\ OsmoBTS\n");
+ if (vty_test_mode)
+ fprintf(stderr, "--- VTY test mode: not connecting to BSC, not exiting ---\n");
g_bts = gsm_bts_alloc(tall_bts_ctx, 0);
if (!g_bts) {
@@ -397,16 +405,18 @@ int bts_main(int argc, char **argv)
signal(SIGUSR2, &signal_handler);
osmo_init_ignore_signals();
- if (!g_bts->bsc_oml_host) {
- fprintf(stderr, "Cannot start BTS without knowing BSC OML IP\n");
- exit(1);
+ if (vty_test_mode) {
+ /* Just select-loop without connecting to the BSC, don't exit. This allows running tests on the VTY
+ * telnet port. */
+ while (!quit) {
+ log_reset_context();
+ osmo_select_main(0);
+ }
+ return EXIT_SUCCESS;
}
- line = abis_open(g_bts, g_bts->bsc_oml_host, "osmo-bts");
- if (!line) {
- fprintf(stderr, "unable to connect to BSC\n");
- exit(2);
- }
+ if (abis_open(g_bts, "osmo-bts") != 0)
+ exit(1);
rc = phy_links_open();
if (rc < 0) {
diff --git a/src/common/measurement.c b/src/common/measurement.c
index b5869872..a1c91a9d 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -10,7 +10,6 @@
#include <osmo-bts/measurement.h>
#include <osmo-bts/scheduler.h>
#include <osmo-bts/rsl.h>
-#include <osmo-bts/ta_control.h>
/* Tables as per TS 45.008 Section 8.3 */
static const uint8_t ts45008_83_tch_f[] = { 52, 53, 54, 55, 56, 57, 58, 59 };
@@ -342,7 +341,7 @@ int lchan_new_ul_meas(struct gsm_lchan *lchan,
if (!ulm->is_sub)
dest->is_sub = ts45008_83_is_sub(lchan, fn);
- DEBUGPFN(DMEAS, fn, "%s adding measurement (ber10k=%u, ta_offs=%d, ci=%0.2f, is_sub=%u, rssi=-%u), num_ul_meas=%d, fn_mod=%u\n",
+ DEBUGPFN(DMEAS, fn, "%s adding measurement (ber10k=%u, ta_offs=%d, ci_cB=%d, is_sub=%u, rssi=-%u), num_ul_meas=%d, fn_mod=%u\n",
gsm_lchan_name(lchan), ulm->ber10k, ulm->ta_offs_256bits,
ulm->c_i, dest->is_sub, ulm->inv_rssi, lchan->meas.num_ul_meas,
fn_mod);
@@ -556,8 +555,10 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
struct gsm_meas_rep_unidir *mru;
uint32_t ber_full_sum = 0;
uint32_t irssi_full_sum = 0;
+ int32_t ci_full_sum = 0;
uint32_t ber_sub_sum = 0;
uint32_t irssi_sub_sum = 0;
+ int32_t ci_sub_sum = 0;
int32_t ta256b_sum = 0;
unsigned int num_meas_sub = 0;
unsigned int num_meas_sub_actual = 0;
@@ -589,7 +590,7 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
/* When AMR is used, we expect at least one SUB frame, since
* the SACCH will always be SUB frame. There may occur more
* SUB frames but since DTX periods in AMR are dynamic, we
- * can not know how much exactly. */
+ * can not know how many exactly. */
num_meas_sub_expect = 1;
}
@@ -625,11 +626,13 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
m = &lchan->meas.uplink[i + num_ul_meas_excess];
if (m->is_sub) {
irssi_sub_sum += m->inv_rssi;
+ ci_sub_sum += m->c_i;
num_meas_sub_actual++;
is_sub = true;
}
irssi_full_sum += m->inv_rssi;
ta256b_sum += m->ta_offs_256bits;
+ ci_full_sum += m->c_i;
num_ul_meas_actual++;
} else {
@@ -698,27 +701,32 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
else
irssi_full_sum = irssi_full_sum / num_ul_meas_actual;
- if (!num_ul_meas_actual)
+ if (!num_ul_meas_actual) {
ta256b_sum = lchan->meas.ms_toa256;
- else
+ ci_full_sum = lchan->meas.ul_ci_cb_full;
+ } else {
ta256b_sum = ta256b_sum / (signed)num_ul_meas_actual;
+ ci_full_sum = ci_full_sum / (signed)num_ul_meas_actual;
+ }
if (!num_meas_sub)
ber_sub_sum = MEASUREMENT_DUMMY_BER;
else
ber_sub_sum = ber_sub_sum / num_meas_sub;
- if (!num_meas_sub_actual)
+ if (!num_meas_sub_actual) {
irssi_sub_sum = MEASUREMENT_DUMMY_IRSSI;
- else
+ ci_sub_sum = lchan->meas.ul_ci_cb_sub;
+ } else {
irssi_sub_sum = irssi_sub_sum / num_meas_sub_actual;
+ ci_sub_sum = ci_sub_sum / (signed)num_meas_sub_actual;
+ }
LOGPLCHAN(lchan, DMEAS, LOGL_INFO,
- "Computed TA256(% 4d) BER-FULL(%2u.%02u%%), RSSI-FULL(-%3udBm), "
- "BER-SUB(%2u.%02u%%), RSSI-SUB(-%3udBm)\n",
- ta256b_sum, ber_full_sum / 100, ber_full_sum % 100,
- irssi_full_sum, ber_sub_sum / 100, ber_sub_sum % 100,
- irssi_sub_sum);
+ "Computed TA256(% 4d), BER-FULL(%2u.%02u%%), RSSI-FULL(-%3udBm), C/I-FULL(% 4d cB), "
+ "BER-SUB(%2u.%02u%%), RSSI-SUB(-%3udBm), C/I-SUB(% 4d cB)\n",
+ ta256b_sum, ber_full_sum / 100, ber_full_sum % 100, irssi_full_sum, ci_full_sum,
+ ber_sub_sum / 100, ber_sub_sum % 100, irssi_sub_sum, ci_sub_sum);
/* store results */
mru = &lchan->meas.ul_res;
@@ -727,6 +735,8 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
mru->full.rx_qual = ber10k_to_rxqual(ber_full_sum);
mru->sub.rx_qual = ber10k_to_rxqual(ber_sub_sum);
lchan->meas.ms_toa256 = ta256b_sum;
+ lchan->meas.ul_ci_cb_full = ci_full_sum;
+ lchan->meas.ul_ci_cb_sub = ci_sub_sum;
LOGPLCHAN(lchan, DMEAS, LOGL_INFO,
"UL MEAS RXLEV_FULL(%u), RXLEV_SUB(%u), RXQUAL_FULL(%u), RXQUAL_SUB(%u), "
@@ -739,11 +749,6 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
lchan_meas_compute_extended(lchan);
- /* Compute new ta_req value. This has to be done here since the value
- * in lchan->meas.num_ul_meas together with lchan->meas.ms_toa256
- * is needed for the computation. */
- lchan_ms_ta_ctrl(lchan);
-
lchan->meas.num_ul_meas = 0;
/* return 1 to indicate that the computation has been done and the next
diff --git a/src/common/power_control.c b/src/common/power_control.c
index 4f5d15e3..d57c28d5 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -36,6 +36,8 @@
/* We don't want to deal with floating point, so we scale up */
#define EWMA_SCALE_FACTOR 100
+/* EWMA_SCALE_FACTOR/2 = +50: Round to nearest value when downscaling, otherwise floor() is applied. */
+#define EWMA_ROUND_FACTOR (EWMA_SCALE_FACTOR / 2)
/* Base Low-Pass Single-Pole IIR Filter (EWMA) formula:
*
@@ -84,49 +86,47 @@ static int do_pf_ewma(const struct gsm_power_ctrl_meas_params *mp,
return Val;
}
- *Avg100 += A * (Val - *Avg100 / EWMA_SCALE_FACTOR);
- return *Avg100 / EWMA_SCALE_FACTOR;
+ *Avg100 += A * (Val - (*Avg100 + EWMA_ROUND_FACTOR) / EWMA_SCALE_FACTOR);
+ return (*Avg100 + EWMA_ROUND_FACTOR) / EWMA_SCALE_FACTOR;
}
/* Calculate target RxLev value from lower/upper thresholds */
#define CALC_TARGET(mp) \
- (mp.lower_thresh + mp.upper_thresh) / 2
+ ((mp).lower_thresh + (mp).upper_thresh) / 2
-/* Calculate a 'delta' value (for the given MS/BS power control state and parameters)
- * to be applied to the current Tx power level to approach the target level. */
-static int calc_delta(const struct gsm_power_ctrl_params *params,
- struct lchan_power_ctrl_state *state,
- const int rxlev_dbm)
+static int do_avg_algo(const struct gsm_power_ctrl_meas_params *mp,
+ struct gsm_power_ctrl_meas_proc_state *mps,
+ const int val)
{
- int rxlev_dbm_avg;
- uint8_t rxlev_avg;
- int delta;
-
- /* Filter RxLev value to reduce unnecessary Tx power oscillations */
- switch (params->rxlev_meas.algo) {
+ int val_avg;
+ switch (mp->algo) {
case GSM_PWR_CTRL_MEAS_AVG_ALGO_OSMO_EWMA:
- rxlev_dbm_avg = do_pf_ewma(&params->rxlev_meas,
- &state->rxlev_meas_proc,
- rxlev_dbm);
+ val_avg = do_pf_ewma(mp, mps, val);
break;
/* TODO: implement other pre-processing methods */
case GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE:
default:
/* No filtering (pass through) */
- rxlev_dbm_avg = rxlev_dbm;
+ val_avg = val;
}
-
- /* FIXME: avoid this conversion, accept RxLev as-is */
- rxlev_avg = dbm2rxlev(rxlev_dbm_avg);
+ return val_avg;
+}
+/* Calculate a 'delta' value (for the given MS/BS power control state and parameters)
+ * to be applied to the current Tx power level to approach the target level. */
+static int calc_delta_rxlev(const struct gsm_power_ctrl_params *params,
+ struct lchan_power_ctrl_state *state,
+ const uint8_t rxlev)
+{
+ int delta;
/* Check if RxLev is within the threshold window */
- if (rxlev_avg >= params->rxlev_meas.lower_thresh &&
- rxlev_avg <= params->rxlev_meas.upper_thresh)
+ if (rxlev >= params->rxlev_meas.lower_thresh &&
+ rxlev <= params->rxlev_meas.upper_thresh)
return 0;
/* How many dBs measured power should be increased (+) or decreased (-)
* to reach expected power. */
- delta = CALC_TARGET(params->rxlev_meas) - rxlev_avg;
+ delta = CALC_TARGET(params->rxlev_meas) - rxlev;
/* Don't ever change more than PWR_{LOWER,RAISE}_MAX_DBM during one loop
* iteration, i.e. reduce the speed at which the MS transmit power can
@@ -139,14 +139,57 @@ static int calc_delta(const struct gsm_power_ctrl_params *params,
return delta;
}
+/* Shall we skip current block based on configured interval? */
+static bool ctrl_interval_skip_block(const struct gsm_power_ctrl_params *params,
+ struct lchan_power_ctrl_state *state)
+{
+ /* Power control interval: how many blocks do we skip? */
+ if (state->skip_block_num-- > 0)
+ return true;
+
+ /* Reset the number of SACCH blocks to be skipped:
+ * ctrl_interval=0 => 0 blocks to skip,
+ * ctrl_interval=1 => 1 blocks to skip,
+ * ctrl_interval=2 => 3 blocks to skip,
+ * so basically ctrl_interval * 2 - 1. */
+ state->skip_block_num = params->ctrl_interval * 2 - 1;
+ return false;
+}
+
+static const struct gsm_power_ctrl_meas_params *lchan_get_ci_thresholds(const struct gsm_lchan *lchan)
+{
+ const struct gsm_power_ctrl_params *params = lchan->ms_power_ctrl.dpc_params;
+
+ switch (lchan->type) {
+ case GSM_LCHAN_SDCCH:
+ return &params->ci_sdcch_meas;
+ case GSM_LCHAN_PDTCH:
+ return &params->ci_gprs_meas;
+ case GSM_LCHAN_TCH_F:
+ if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR)
+ return &params->ci_amr_fr_meas;
+ else
+ return &params->ci_fr_meas;
+ case GSM_LCHAN_TCH_H:
+ if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR)
+ return &params->ci_amr_hr_meas;
+ else
+ return &params->ci_hr_meas;
+ default:
+ OSMO_ASSERT(0);
+ }
+}
+
/*! compute the new MS POWER LEVEL communicated to the MS and store it in lchan.
* \param lchan logical channel for which to compute (and in which to store) new power value.
* \param[in] ms_power_lvl MS Power Level received from Uplink L1 SACCH Header in SACCH block.
* \param[in] ul_rssi_dbm Signal level of the received SACCH block, in dBm.
+ * \param[in] ul_lqual_cb C/I of the received SACCH block, in dB.
*/
int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan,
const uint8_t ms_power_lvl,
- const int8_t ul_rssi_dbm)
+ const int8_t ul_rssi_dbm,
+ const int16_t ul_lqual_cb)
{
struct lchan_power_ctrl_state *state = &lchan->ms_power_ctrl;
const struct gsm_power_ctrl_params *params = state->dpc_params;
@@ -155,23 +198,19 @@ int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan,
enum gsm_band band = bts->band;
int8_t new_power_lvl; /* TS 05.05 power level */
int8_t ms_dbm, new_dbm, current_dbm, bsc_max_dbm;
+ uint8_t rxlev_avg;
+ int16_t ul_lqual_cb_avg;
+ const struct gsm_power_ctrl_meas_params *ci_meas;
if (!trx_ms_pwr_ctrl_is_osmo(trx))
return 0;
if (params == NULL)
return 0;
- /* Power control interval: how many blocks do we skip? */
- if (state->skip_block_num-- > 0)
+ /* Shall we skip current block based on configured interval? */
+ if (ctrl_interval_skip_block(params, state))
return 0;
- /* Reset the number of SACCH blocks to be skipped:
- * ctrl_interval=0 => 0 blocks to skip,
- * ctrl_interval=1 => 1 blocks to skip,
- * ctrl_interval=2 => 3 blocks to skip,
- * so basically ctrl_interval * 2 - 1. */
- state->skip_block_num = params->ctrl_interval * 2 - 1;
-
ms_dbm = ms_pwr_dbm(band, ms_power_lvl);
if (ms_dbm < 0) {
LOGPLCHAN(lchan, DLOOP, LOGL_NOTICE,
@@ -187,8 +226,18 @@ int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan,
return 0;
}
- /* Calculate the new Tx power value (in dBm) */
- new_dbm = ms_dbm + calc_delta(params, state, ul_rssi_dbm);
+ /* If computed C/I is out of acceptable thresholds: */
+ ci_meas = lchan_get_ci_thresholds(lchan);
+ ul_lqual_cb_avg = do_avg_algo(ci_meas, &state->ci_meas_proc, ul_lqual_cb);
+ rxlev_avg = do_avg_algo(&params->rxlev_meas, &state->rxlev_meas_proc, dbm2rxlev(ul_rssi_dbm));
+ if (ul_lqual_cb_avg < ci_meas->lower_thresh * 10) {
+ new_dbm = ms_dbm + params->inc_step_size_db;
+ } else if (ul_lqual_cb_avg > ci_meas->upper_thresh * 10) {
+ new_dbm = ms_dbm - params->red_step_size_db;
+ } else {
+ /* Calculate the new Tx power value (in dBm) */
+ new_dbm = ms_dbm + calc_delta_rxlev(params, state, rxlev_avg);
+ }
/* Make sure new_dbm is never negative. ms_pwr_ctl_lvl() can later on
cope with any unsigned dbm value, regardless of band minimal value. */
@@ -207,23 +256,25 @@ int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan,
return 0;
}
- /* FIXME: this is only needed for logging, print thresholds instead */
- int target_dbm = rxlev2dbm(CALC_TARGET(params->rxlev_meas));
-
if (state->current == new_power_lvl) {
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Keeping MS power at control level %d, %d dBm "
- "(rx-ms-pwr-lvl %" PRIu8 ", max-ms-pwr-lvl %" PRIu8 ", rx-current %d dBm, rx-target %d dBm)\n",
- new_power_lvl, new_dbm, ms_power_lvl, state->max,
- ul_rssi_dbm, target_dbm);
+ LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Keeping MS power at control level %d (%d dBm): "
+ "ms-pwr-lvl[curr %" PRIu8 ", max %" PRIu8 "], RSSI[curr %d, avg %d, thresh %d..%d] dBm,"
+ " C/I[curr %d, avg %d, thresh %d..%d] dB\n",
+ new_power_lvl, new_dbm, ms_power_lvl, state->max, ul_rssi_dbm, rxlev2dbm(rxlev_avg),
+ rxlev2dbm(params->rxlev_meas.lower_thresh), rxlev2dbm(params->rxlev_meas.upper_thresh),
+ ul_lqual_cb/10, ul_lqual_cb_avg/10, ci_meas->lower_thresh, ci_meas->upper_thresh);
return 0;
}
current_dbm = ms_pwr_dbm(band, state->current);
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "%s MS power from control level %d (%d dBm) to %d, %d dBm "
- "(rx-ms-pwr-lvl %" PRIu8 ", max-ms-pwr-lvl %" PRIu8 ", rx-current %d dBm, rx-target %d dBm)\n",
+ LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "%s MS power control level %d (%d dBm) => %d (%d dBm): "
+ "ms-pwr-lvl[curr %" PRIu8 ", max %" PRIu8 "], RSSI[curr %d, avg %d, thresh %d..%d] dBm,"
+ " C/I[curr %d, avg %d, thresh %d..%d] dB\n",
(new_dbm > current_dbm) ? "Raising" : "Lowering",
- state->current, current_dbm, new_power_lvl, new_dbm,
- ms_power_lvl, state->max, ul_rssi_dbm, target_dbm);
+ state->current, current_dbm, new_power_lvl, new_dbm, ms_power_lvl,
+ state->max, ul_rssi_dbm, rxlev2dbm(rxlev_avg),
+ rxlev2dbm(params->rxlev_meas.lower_thresh), rxlev2dbm(params->rxlev_meas.upper_thresh),
+ ul_lqual_cb/10, ul_lqual_cb_avg/10, ci_meas->lower_thresh, ci_meas->upper_thresh);
/* store the resulting new MS power level in the lchan */
state->current = new_power_lvl;
@@ -243,8 +294,8 @@ int lchan_bs_pwr_ctrl(struct gsm_lchan *lchan,
const struct gsm_power_ctrl_params *params = state->dpc_params;
uint8_t rxqual_full, rxqual_sub;
uint8_t rxlev_full, rxlev_sub;
- uint8_t rxqual, rxlev;
- int delta, new;
+ uint8_t rxqual, rxqual_avg, rxlev, rxlev_avg;
+ int new_att;
/* Check if dynamic BS Power Control is enabled */
if (params == NULL)
@@ -277,17 +328,10 @@ int lchan_bs_pwr_ctrl(struct gsm_lchan *lchan,
lchan->tch.dtx.dl_active ? "enabled" : "disabled",
lchan->tch.dtx.dl_active ? "SUB" : "FULL");
- /* Power control interval: how many blocks do we skip? */
- if (state->skip_block_num-- > 0)
+ /* Shall we skip current block based on configured interval? */
+ if (ctrl_interval_skip_block(params, state))
return 0;
- /* Reset the number of SACCH blocks to be skipped:
- * ctrl_interval=0 => 0 blocks to skip,
- * ctrl_interval=1 => 1 blocks to skip,
- * ctrl_interval=2 => 3 blocks to skip,
- * so basically ctrl_interval * 2 - 1. */
- state->skip_block_num = params->ctrl_interval * 2 - 1;
-
/* If DTx is active on Downlink, use the '-SUB' */
if (lchan->tch.dtx.dl_active) {
rxqual = rxqual_sub;
@@ -297,66 +341,57 @@ int lchan_bs_pwr_ctrl(struct gsm_lchan *lchan,
rxlev = rxlev_full;
}
+ rxlev_avg = do_avg_algo(&params->rxlev_meas, &state->rxlev_meas_proc, rxlev);
+ rxqual_avg = do_avg_algo(&params->rxqual_meas, &state->rxqual_meas_proc, rxqual);
/* If RxQual > L_RXQUAL_XX_P, try to increase Tx power */
- if (rxqual > params->rxqual_meas.lower_thresh) {
- uint8_t old = state->current;
-
- /* Tx power has reached the maximum, nothing to do */
- if (state->current == 0)
- return 0;
-
+ if (rxqual_avg > params->rxqual_meas.lower_thresh) {
/* Increase Tx power by reducing Tx attenuation */
- if (state->current >= params->inc_step_size_db)
- state->current -= params->inc_step_size_db;
- else
- state->current = 0;
-
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Reducing Downlink attenuation: "
- "%u -> %d dB due to RxQual %u worse than L_RXQUAL_XX_P %u\n",
- old, state->current, rxqual, params->rxqual_meas.lower_thresh);
- return 1;
+ new_att = state->current - params->inc_step_size_db;
+ } else if (rxqual_avg < params->rxqual_meas.upper_thresh) {
+ /* Increase Tx power by Increasing Tx attenuation */
+ new_att = state->current + params->red_step_size_db;
+ } else {
+ /* Basic signal transmission / reception formula:
+ *
+ * RxLev = TxPwr - (PathLoss + TxAtt)
+ *
+ * Here we want to change RxLev at the MS side, so:
+ *
+ * RxLev + Delta = TxPwr - (PathLoss + TxAtt) + Delta
+ *
+ * The only parameter we can change here is TxAtt, so:
+ *
+ * RxLev + Delta = TxPwr - PathLoss - TxAtt + Delta
+ * RxLev + Delta = TxPwr - PathLoss - (TxAtt - Delta)
+ */
+ new_att = state->current - calc_delta_rxlev(params, state, rxlev_avg);
}
- /* Calculate a 'delta' for the current attenuation level */
- delta = calc_delta(params, state, rxlev2dbm(rxlev));
-
- /* Basic signal transmission / reception formula:
- *
- * RxLev = TxPwr - (PathLoss + TxAtt)
- *
- * Here we want to change RxLev at the MS side, so:
- *
- * RxLev + Delta = TxPwr - (PathLoss + TxAtt) + Delta
- *
- * The only parameter we can change here is TxAtt, so:
- *
- * RxLev + Delta = TxPwr - PathLoss - TxAtt + Delta
- * RxLev + Delta = TxPwr - PathLoss - (TxAtt - Delta)
- */
- new = state->current - delta;
- if (new > state->max)
- new = state->max;
- if (new < 0)
- new = 0;
-
- if (state->current != new) {
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Changing Downlink attenuation: "
- "%u -> %u dB (maximum %u dB, suggested delta %d dB, "
- "RxLev current %u (%d dBm), thresholds %u .. %u)\n",
- state->current, new, state->max,
- -delta, rxlev, rxlev2dbm(rxlev),
- params->rxlev_meas.lower_thresh,
- params->rxlev_meas.upper_thresh);
- state->current = new;
- return 1;
- } else {
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Keeping Downlink attenuation "
- "at %u dB (maximum %u dB, suggested delta %d dB, "
- "RxLev current %u (%d dBm), thresholds %u .. %u)\n",
- state->current, state->max,
- -delta, rxlev, rxlev2dbm(rxlev),
- params->rxlev_meas.lower_thresh,
- params->rxlev_meas.upper_thresh);
+ /* Make sure new TxAtt is never negative: */
+ if (new_att < 0)
+ new_att = 0;
+
+ /* Don't ask for higher TxAtt than permitted: */
+ if (new_att > state->max)
+ new_att = state->max;
+
+ if (state->current == new_att) {
+ LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Keeping DL attenuation at %u dB: "
+ "max %u dB, RSSI[curr %d, avg %d, thresh %d..%d] dBm, "
+ "RxQual[curr %d, avg %d, thresh %d..%d]\n",
+ state->current, state->max, rxlev2dbm(rxlev), rxlev2dbm(rxlev_avg),
+ rxlev2dbm(params->rxlev_meas.lower_thresh), rxlev2dbm(params->rxlev_meas.upper_thresh),
+ rxqual, rxqual_avg, params->rxqual_meas.lower_thresh, params->rxqual_meas.upper_thresh);
return 0;
}
+
+ LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "%s DL attenuation %u dB => %u dB:"
+ "max %u dB, RSSI[curr %d, avg %d, thresh %d..%d] dBm, "
+ "RxQual[curr %d, avg %d, thresh %d..%d]\n",
+ (new_att > state->current) ? "Raising" : "Lowering",
+ state->current, new_att, state->max, rxlev2dbm(rxlev), rxlev2dbm(rxlev_avg),
+ rxlev2dbm(params->rxlev_meas.lower_thresh), rxlev2dbm(params->rxlev_meas.upper_thresh),
+ rxqual, rxqual_avg, params->rxqual_meas.lower_thresh, params->rxqual_meas.upper_thresh);
+ state->current = new_att;
+ return 1;
}
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 18c03491..ca40e499 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -909,7 +909,7 @@ static int parse_power_ctrl_params(struct gsm_power_ctrl_params *params,
const uint8_t *data, size_t data_len)
{
const struct tlv_p_entry *ie;
- struct tlv_parsed tp[2];
+ struct tlv_parsed tp[3];
unsigned int i;
int rc;
@@ -938,6 +938,30 @@ static int parse_power_ctrl_params(struct gsm_power_ctrl_params *params,
params->rxqual_meas.upper_thresh = thresh->u_rxqual;
}
+ /* Osmocom extension, C/I related thresholds: */
+ if (TLVP_PRES_LEN(&tp[0], RSL_IPAC_EIE_OSMO_MS_PWR_CTL, sizeof(struct osmo_preproc_pc_thresh))) {
+ const struct osmo_preproc_pc_thresh *osmo_thresh;
+ ie = TLVP_GET(&tp[0], RSL_IPAC_EIE_OSMO_MS_PWR_CTL);
+ osmo_thresh = (const struct osmo_preproc_pc_thresh *) ie->val;
+ params->ci_fr_meas.lower_thresh = osmo_thresh->l_ci_fr;
+ params->ci_fr_meas.upper_thresh = osmo_thresh->u_ci_fr;
+
+ params->ci_hr_meas.lower_thresh = osmo_thresh->l_ci_hr;
+ params->ci_hr_meas.upper_thresh = osmo_thresh->u_ci_hr;
+
+ params->ci_amr_fr_meas.lower_thresh = osmo_thresh->l_ci_amr_fr;
+ params->ci_amr_fr_meas.upper_thresh = osmo_thresh->u_ci_amr_fr;
+
+ params->ci_amr_hr_meas.lower_thresh = osmo_thresh->l_ci_amr_hr;
+ params->ci_amr_hr_meas.upper_thresh = osmo_thresh->u_ci_amr_hr;
+
+ params->ci_sdcch_meas.lower_thresh = osmo_thresh->l_ci_sdcch;
+ params->ci_sdcch_meas.upper_thresh = osmo_thresh->u_ci_sdcch;
+
+ params->ci_gprs_meas.lower_thresh = osmo_thresh->l_ci_gprs;
+ params->ci_gprs_meas.upper_thresh = osmo_thresh->u_ci_gprs;
+ }
+
/* (TV) PC Threshold Comparators */
if ((ie = TLVP_GET(&tp[0], RSL_IPAC_EIE_PC_THRESH_COMP)) != NULL) {
const struct ipac_preproc_pc_comp *thresh_comp;
@@ -964,12 +988,31 @@ static int parse_power_ctrl_params(struct gsm_power_ctrl_params *params,
params->red_step_size_db = thresh_comp->red_step_size;
}
+ /* Osmocom extension, C/I related thresholds: */
+ if (TLVP_PRES_LEN(&tp[0], RSL_IPAC_EIE_OSMO_PC_THRESH_COMP, sizeof(struct osmo_preproc_pc_thresh))) {
+ const struct osmo_preproc_pc_comp *osmo_thresh_comp;
+ ie = TLVP_GET(&tp[0], RSL_IPAC_EIE_OSMO_PC_THRESH_COMP);
+ osmo_thresh_comp = (const struct osmo_preproc_pc_comp *) ie->val;
+ #define SET_PREPROC_PC(PARAMS, FROM, TYPE) \
+ (PARAMS)->TYPE##_meas.lower_cmp_p = (FROM)->TYPE.lower_p; \
+ (PARAMS)->TYPE##_meas.lower_cmp_n = (FROM)->TYPE.lower_n; \
+ (PARAMS)->TYPE##_meas.upper_cmp_p = (FROM)->TYPE.upper_p; \
+ (PARAMS)->TYPE##_meas.upper_cmp_n = (FROM)->TYPE.upper_n
+ SET_PREPROC_PC(params, osmo_thresh_comp, ci_fr);
+ SET_PREPROC_PC(params, osmo_thresh_comp, ci_hr);
+ SET_PREPROC_PC(params, osmo_thresh_comp, ci_amr_fr);
+ SET_PREPROC_PC(params, osmo_thresh_comp, ci_amr_hr);
+ SET_PREPROC_PC(params, osmo_thresh_comp, ci_sdcch);
+ SET_PREPROC_PC(params, osmo_thresh_comp, ci_gprs);
+ #undef SET_PREPROC_PC
+ }
+
/* (TLV) Measurement Averaging parameters for RxLev/RxQual */
for (i = 0; i < ARRAY_SIZE(tp); i++) {
const struct ipac_preproc_ave_cfg *ave_cfg;
struct gsm_power_ctrl_meas_params *mp;
- ie = TLVP_GET(&tp[0], RSL_IPAC_EIE_MEAS_AVG_CFG);
+ ie = TLVP_GET(&tp[i], RSL_IPAC_EIE_MEAS_AVG_CFG);
if (ie == NULL)
break;
@@ -1008,6 +1051,42 @@ static int parse_power_ctrl_params(struct gsm_power_ctrl_params *params,
}
}
+ /* (TLV) Measurement Averaging parameters for C/I (Osmocom extension)*/
+ if (TLVP_PRES_LEN(&tp[0], RSL_IPAC_EIE_OSMO_MEAS_AVG_CFG, sizeof(struct osmo_preproc_ave_cfg))) {
+ ie = TLVP_GET(&tp[0], RSL_IPAC_EIE_OSMO_MEAS_AVG_CFG);
+ const struct osmo_preproc_ave_cfg *cfg = (const struct osmo_preproc_ave_cfg *) ie->val;
+ unsigned params_offset = 0;
+ #define SET_AVE_CFG(PARAMS, FROM, TYPE, PARAM_OFFSET) do {\
+ if ((FROM)->TYPE.ave_enabled) { \
+ (PARAMS)->TYPE##_meas.h_reqave = (FROM)->TYPE.h_reqave; \
+ (PARAMS)->TYPE##_meas.h_reqt = (FROM)->TYPE.h_reqt; \
+ (PARAMS)->TYPE##_meas.algo = (FROM)->TYPE.ave_method + 1; \
+ switch ((FROM)->TYPE.ave_method) { \
+ case IPAC_OSMO_EWMA_AVE: \
+ if (ie->len > sizeof(*cfg) + (PARAM_OFFSET)) { \
+ (PARAMS)->TYPE##_meas.ewma.alpha = (FROM)->params[PARAM_OFFSET]; \
+ (PARAM_OFFSET)++; \
+ } \
+ break; \
+ /* FIXME: not implemented */ \
+ case IPAC_UNWEIGHTED_AVE: \
+ case IPAC_WEIGHTED_AVE: \
+ case IPAC_MEDIAN_AVE: \
+ break; \
+ } \
+ } else { \
+ (PARAMS)->TYPE##_meas.algo = GSM_PWR_CTRL_MEAS_AVG_ALGO_NONE; \
+ } \
+ } while(0)
+ SET_AVE_CFG(params, cfg, ci_fr, params_offset);
+ SET_AVE_CFG(params, cfg, ci_hr, params_offset);
+ SET_AVE_CFG(params, cfg, ci_amr_fr, params_offset);
+ SET_AVE_CFG(params, cfg, ci_amr_hr, params_offset);
+ SET_AVE_CFG(params, cfg, ci_sdcch, params_offset);
+ SET_AVE_CFG(params, cfg, ci_gprs, params_offset);
+ #undef SET_AVE_CFG
+ }
+
return 0;
}
@@ -1085,6 +1164,30 @@ static int rsl_rx_imm_ass(struct gsm_bts_trx *trx, struct msgb *msg)
msg->l2h = NULL;
msg->len = TLVP_LEN(&tp, RSL_IE_FULL_IMM_ASS_INFO);
+ /* Early Immediate Assignment: when there is a lot of latency on Abis, the Abis roundtrip of Chan Activ -> Chan
+ * Activ ACK -> Immediate Assignment may take so long that each MS sends a second RACH for Chan Rqd, reserving
+ * two SDCCH for each request but using only one. To help with that, the Early IA feature in osmo-bsc sends the
+ * Immediate Assignment without waiting for the Channel Activation ACK. This may then be too early, and the MS
+ * may not be able to establish a channel. So to help with Early IA, look up whether the target lchan is already
+ * active. If not, then hold back the RR Immediate Assignment message, and send it once L1 has confirmed that
+ * the channel is active. Hence we still wait for the activation, but don't need the Abis roundtrip of Activ ACK
+ * -> Immediate Assignment via the BSC.
+ * If anything is wrong with the sizes or the lchan lookup, behave normally, i.e. do not do the RR IA caching,
+ * but just send the RR message to the MS as-is. */
+ if (msg->len >= sizeof(struct gsm48_imm_ass)) {
+ struct gsm48_imm_ass *rr_ia = (void*)msg->data;
+ struct gsm_lchan *ia_target_lchan = lchan_lookup(trx, rr_ia->chan_desc.chan_nr, "Early IA check: ");
+ if (ia_target_lchan && ia_target_lchan->state != LCHAN_S_ACTIVE) {
+ /* Target lchan is not yet active. Cache the IA.
+ * If a previous IA is still lingering, free it. */
+ msgb_free(ia_target_lchan->early_rr_ia);
+ ia_target_lchan->early_rr_ia = msg;
+
+ /* return 1 means: don't msgb_free() the msg */
+ return 1;
+ }
+ }
+
/* put into the AGCH queue of the BTS */
if (bts_agch_enqueue(trx->bts, msg) < 0) {
/* if there is no space in the queue: send DELETE IND */
@@ -1409,7 +1512,7 @@ static void clear_lchan_for_pdch_activ(struct gsm_lchan *lchan)
memset(&lchan->ho, 0, sizeof(lchan->ho));
memset(&lchan->ms_power_ctrl, 0, sizeof(lchan->ms_power_ctrl));
memset(&lchan->bs_power_ctrl, 0, sizeof(lchan->bs_power_ctrl));
- lchan->rqd_ta = 0;
+ lchan->ta_ctrl.current = 0;
copy_sacch_si_to_lchan(lchan);
memset(&lchan->tch, 0, sizeof(lchan->tch));
}
@@ -1618,7 +1721,7 @@ static int rsl_rx_chan_activ(struct msgb *msg)
}
/* 9.3.24 Timing Advance */
if (TLVP_PRES_LEN(&tp, RSL_IE_TIMING_ADVANCE, 1))
- lchan->rqd_ta = *TLVP_VAL(&tp, RSL_IE_TIMING_ADVANCE);
+ lchan->ta_ctrl.current = *TLVP_VAL(&tp, RSL_IE_TIMING_ADVANCE);
/* 9.3.31 (TLV) MS Power Parameters IE (vendor specific) */
if ((ie = TLVP_GET(&tp, RSL_IE_MS_POWER_PARAM)) != NULL) {
diff --git a/src/common/ta_control.c b/src/common/ta_control.c
index ccb60e2b..025699ce 100644
--- a/src/common/ta_control.c
+++ b/src/common/ta_control.c
@@ -1,6 +1,7 @@
/* Loop control for Timing Advance */
/* (C) 2013 by Andreas Eversberg <jolly@eversberg.eu>
+ * (C) 2021 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de>
*
* All Rights Reserved
*
@@ -19,32 +20,83 @@
*
*/
+/* Related specs: 3GPP TS 45.010 sections 5.5, 5.6 */
+
#include <osmo-bts/gsm_data.h>
+#include <osmo-bts/bts_trx.h>
#include <osmo-bts/logging.h>
-/* 90% of one bit duration in 1/256 symbols: 256*0.9 */
-#define TOA256_9OPERCENT 230
+/* 3GPP TS 45.010 sec 5.6.3 Delay assessment error:
+ * 75% of one bit duration in 1/256 symbols: 256*0.75 */
+#define TOA256_THRESH 192
/* rqd_ta value range */
#define TA_MIN 0
#define TA_MAX 63
-void lchan_ms_ta_ctrl(struct gsm_lchan *lchan)
+/* TODO: make configurable over osmo-bts VTY? Pass it BSC->BTS? */
+#define TA_MAX_INC_STEP 2
+#define TA_MAX_DEC_STEP 2
+
+
+/*! compute the new "Ordered Timing Advance" communicated to the MS and store it in lchan.
+ * \param lchan logical channel for which to compute (and in which to store) new power value.
+ * \param[in] ms_tx_ta The TA used by the MS and reported in L1SACCH, see struct gsm_sacch_l1_hdr field "ta".
+ * \param[in] toa256 Time of Arrival (in 1/256th bits) computed at Rx side
+ */
+void lchan_ms_ta_ctrl(struct gsm_lchan *lchan, uint8_t ms_tx_ta, int16_t toa256)
{
- int16_t toa256 = lchan->meas.ms_toa256;
-
- if (toa256 < -TOA256_9OPERCENT && lchan->rqd_ta > TA_MIN) {
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO,
- "TOA is too early (%d), now lowering TA from %d to %d\n",
- toa256, lchan->rqd_ta, lchan->rqd_ta - 1);
- lchan->rqd_ta--;
- } else if (toa256 > TOA256_9OPERCENT && lchan->rqd_ta < TA_MAX) {
- LOGPLCHAN(lchan, DLOOP, LOGL_INFO,
- "TOA is too late (%d), now raising TA from %d to %d\n",
- toa256, lchan->rqd_ta, lchan->rqd_ta + 1);
- lchan->rqd_ta++;
- } else
+ int16_t new_ta;
+ /* Shall we skip current block based on configured interval? */
+
+ /* TA control interval: how many blocks do we skip? */
+ if (lchan->ta_ctrl.skip_block_num-- > 0)
+ return;
+
+ /* Reset the number of SACCH blocks to be skipped:
+ * ctrl_interval=0 => 0 blocks to skip,
+ * ctrl_interval=1 => 1 blocks to skip,
+ * ctrl_interval=2 => 3 blocks to skip,
+ * so basically ctrl_interval * 2 - 1. */
+ lchan->ta_ctrl.skip_block_num = lchan->ts->trx->ta_ctrl_interval * 2 - 1;
+
+ int16_t delta_ta = toa256/256;
+ if (toa256 >= 0) {
+ if ((toa256 - (256 * delta_ta)) > TOA256_THRESH)
+ delta_ta++;
+ if (delta_ta > TA_MAX_INC_STEP)
+ delta_ta = TA_MAX_INC_STEP;
+ } else {
+ if ((toa256 - (256 * delta_ta)) < -TOA256_THRESH)
+ delta_ta--;
+ if (delta_ta < -TA_MAX_DEC_STEP)
+ delta_ta = -TA_MAX_DEC_STEP;
+ }
+
+ new_ta = ms_tx_ta + delta_ta;
+
+ /* Make sure new_ta is never negative: */
+ if (new_ta < TA_MIN)
+ new_ta = TA_MIN;
+
+ /* Don't ask for out of range TA: */
+ if (new_ta > TA_MAX)
+ new_ta = TA_MAX;
+
+ if (lchan->ta_ctrl.current == (uint8_t)new_ta) {
LOGPLCHAN(lchan, DLOOP, LOGL_DEBUG,
- "TOA is correct (%d), keeping current TA of %d\n",
- toa256, lchan->rqd_ta);
+ "Keeping current TA at %u: TOA was %d\n",
+ lchan->ta_ctrl.current, toa256);
+ return;
+ }
+
+ LOGPLCHAN(lchan, DLOOP, LOGL_INFO,
+ "%s TA %u => %u: TOA was too %s (%d)\n",
+ (uint8_t)new_ta > lchan->ta_ctrl.current ? "Raising" : "Lowering",
+ lchan->ta_ctrl.current, (uint8_t)new_ta,
+ (uint8_t)new_ta > lchan->ta_ctrl.current ? "late" : "early",
+ toa256);
+
+ /* store the resulting new TA in the lchan */
+ lchan->ta_ctrl.current = (uint8_t)new_ta;
}
diff --git a/src/common/vty.c b/src/common/vty.c
index a7d1e845..f99881a4 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -37,11 +37,12 @@
#include <osmocom/vty/logging.h>
#include <osmocom/vty/misc.h>
#include <osmocom/vty/ports.h>
+#include <osmocom/vty/tdef_vty.h>
#include <osmocom/core/gsmtap.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/sockaddr_str.h>
#include <osmocom/trau/osmo_ortp.h>
-
+#include <osmocom/core/fsm.h>
#include <osmo-bts/logging.h>
#include <osmo-bts/gsm_data.h>
@@ -282,6 +283,7 @@ static void config_write_bts_single(struct vty *vty, const struct gsm_bts *bts)
const struct gsm_bts_trx *trx;
const char *sapi_buf;
int i;
+ struct bsc_oml_host *bsc_oml_host;
vty_out(vty, "bts %u%s", bts->nr, VTY_NEWLINE);
if (bts->description)
@@ -291,7 +293,8 @@ static void config_write_bts_single(struct vty *vty, const struct gsm_bts *bts)
vty_out(vty, " auto-band%s", VTY_NEWLINE);
vty_out(vty, " ipa unit-id %u %u%s",
bts->ip_access.site_id, bts->ip_access.bts_id, VTY_NEWLINE);
- vty_out(vty, " oml remote-ip %s%s", bts->bsc_oml_host, VTY_NEWLINE);
+ llist_for_each_entry(bsc_oml_host, &bts->bsc_oml_hosts, list)
+ vty_out(vty, " oml remote-ip %s%s", bsc_oml_host->addr, VTY_NEWLINE);
vty_out(vty, " rtp jitter-buffer %u", bts->rtp_jitter_buf_ms);
if (bts->rtp_jitter_adaptive)
vty_out(vty, " adaptive");
@@ -367,6 +370,8 @@ static void config_write_bts_single(struct vty *vty, const struct gsm_bts *bts)
vty_out(vty, " ms-power-control %s%s",
trx->ms_pwr_ctl_soft ? "osmo" : "dsp",
VTY_NEWLINE);
+ vty_out(vty, " ta-control interval %u%s",
+ trx->ta_ctrl_interval, VTY_NEWLINE);
vty_out(vty, " phy %u instance %u%s", pinst->phy_link->num,
pinst->num, VTY_NEWLINE);
@@ -382,6 +387,7 @@ static int config_write_bts(struct vty *vty)
llist_for_each_entry(bts, &net->bts_list, list)
config_write_bts_single(vty, bts);
+ osmo_tdef_vty_groups_write(vty, "");
return CMD_SUCCESS;
}
@@ -507,11 +513,51 @@ DEFUN(cfg_bts_oml_ip,
"OML Parameters\n" "OML IP Address\n" "OML IP Address\n")
{
struct gsm_bts *bts = vty->index;
+ struct bsc_oml_host *bsc_oml_host;
+
+ /* stop when the address is already in the list */
+ llist_for_each_entry(bsc_oml_host, &bts->bsc_oml_hosts, list) {
+ if (strcmp(argv[0], bsc_oml_host->addr) == 0) {
+ vty_out(vty, "%% duplicate BSC (A-Bis/OML) ip address configured ('%s')%s",
+ argv[0], VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ }
- if (bts->bsc_oml_host)
- talloc_free(bts->bsc_oml_host);
+ bsc_oml_host = talloc_zero(bts, struct bsc_oml_host);
+ OSMO_ASSERT(bsc_oml_host);
+ bsc_oml_host->addr = talloc_strdup(bsc_oml_host, argv[0]);
+ OSMO_ASSERT(bsc_oml_host->addr);
+ llist_add_tail(&bsc_oml_host->list, &bts->bsc_oml_hosts);
- bts->bsc_oml_host = talloc_strdup(bts, argv[0]);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_no_oml_ip,
+ cfg_bts_no_oml_ip_cmd,
+ "no oml remote-ip A.B.C.D",
+ NO_STR "OML Parameters\n" "OML IP Address\n" "OML IP Address\n")
+{
+ struct gsm_bts *bts = vty->index;
+ struct bsc_oml_host *bsc_oml_host;
+ struct bsc_oml_host *bsc_oml_host_del = NULL;
+
+ llist_for_each_entry(bsc_oml_host, &bts->bsc_oml_hosts, list) {
+ if (strcmp(argv[0], bsc_oml_host->addr) == 0)
+ bsc_oml_host_del = bsc_oml_host;
+ }
+
+ if (bsc_oml_host_del) {
+ if (bts->abis_link_fi) {
+ osmo_fsm_inst_dispatch(bts->abis_link_fi, ABIS_LINK_EV_VTY_RM_ADDR, bsc_oml_host_del);
+ llist_del(&bsc_oml_host_del->list);
+ talloc_free(bsc_oml_host_del);
+ }
+ } else {
+ vty_out(vty, "%% no such BSC (A-Bis/OML) ip address configured ('%s')%s",
+ argv[0], VTY_NEWLINE);
+ return CMD_WARNING;
+ }
return CMD_SUCCESS;
}
@@ -965,6 +1011,19 @@ DEFUN(cfg_trx_ms_power_control, cfg_trx_ms_power_control_cmd,
return CMD_SUCCESS;
}
+DEFUN(cfg_ta_ctrl_interval, cfg_ta_ctrl_interval_cmd,
+ "ta-control interval <0-31>",
+ "Timing Advance Control Parameters\n"
+ "Set TA control loop interval\n"
+ "As in P_CON_INTERVAL, in units of 2 SACCH periods (0.96 seconds) (default=0, every SACCH block)\n")
+{
+ struct gsm_bts_trx *trx = vty->index;
+
+ trx->ta_ctrl_interval = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
DEFUN(cfg_trx_phy, cfg_trx_phy_cmd,
"phy <0-255> instance <0-255>",
"Configure PHY Link+Instance for this TRX\n"
@@ -1347,7 +1406,7 @@ static void dump_dpc_meas_params(struct vty *vty, const unsigned int indent,
}
static void dump_dpc_params(struct vty *vty, const unsigned int indent,
- const struct gsm_power_ctrl_params *cp)
+ const struct gsm_power_ctrl_params *cp, bool uplink)
{
cfg_out(vty, "Power control interval: %u ms (every %u SACCH block(s))%s",
cp->ctrl_interval ? cp->ctrl_interval * 2 * 480 : 480,
@@ -1364,6 +1423,26 @@ static void dump_dpc_params(struct vty *vty, const unsigned int indent,
cfg_out(vty, "RxQual measurement processing:%s", VTY_NEWLINE);
dump_dpc_meas_params(vty, indent + 2, &cp->rxqual_meas, "RXQUAL", 3);
+
+ if (uplink) {
+ cfg_out(vty, "C/I measurement processing (FR/EFR):%s", VTY_NEWLINE);
+ dump_dpc_meas_params(vty, indent + 2, &cp->ci_fr_meas, "CI_FR", 0);
+
+ cfg_out(vty, "C/I measurement processing (HR):%s", VTY_NEWLINE);
+ dump_dpc_meas_params(vty, indent + 2, &cp->ci_hr_meas, "CI_HR", 0);
+
+ cfg_out(vty, "C/I measurement processing (AMR-FR):%s", VTY_NEWLINE);
+ dump_dpc_meas_params(vty, indent + 2, &cp->ci_amr_fr_meas, "CI_AMR_FR", 0);
+
+ cfg_out(vty, "C/I measurement processing (AMR-HR):%s", VTY_NEWLINE);
+ dump_dpc_meas_params(vty, indent + 2, &cp->ci_amr_hr_meas, "CI_AMR_HR", 0);
+
+ cfg_out(vty, "C/I measurement processing (SDCCH):%s", VTY_NEWLINE);
+ dump_dpc_meas_params(vty, indent + 2, &cp->ci_sdcch_meas, "CI_SDCCH", 0);
+
+ cfg_out(vty, "C/I measurement processing (GPRS):%s", VTY_NEWLINE);
+ dump_dpc_meas_params(vty, indent + 2, &cp->ci_gprs_meas, "CI_GPRS", 0);
+ }
}
static void trx_dump_vty(struct vty *vty, const struct gsm_bts_trx *trx)
@@ -1381,13 +1460,13 @@ static void trx_dump_vty(struct vty *vty, const struct gsm_bts_trx *trx)
trx->bs_dpc_params == &trx->bts->bs_dpc_params ?
"fall-back" : "from BSC",
VTY_NEWLINE);
- dump_dpc_params(vty, 4, trx->bs_dpc_params);
+ dump_dpc_params(vty, 4, trx->bs_dpc_params, false);
vty_out(vty, " MS Power control parameters (%s):%s",
trx->ms_dpc_params == &trx->bts->ms_dpc_params ?
"fall-back" : "from BSC",
VTY_NEWLINE);
- dump_dpc_params(vty, 4, trx->ms_dpc_params);
+ dump_dpc_params(vty, 4, trx->ms_dpc_params, true);
vty_out(vty, " NM State: ");
net_dump_nmstate(vty, &trx->mo.nm_state);
@@ -1594,7 +1673,7 @@ static void lchan_bs_power_ctrl_state_dump(struct vty *vty, unsigned int indent,
return;
cfg_out(vty, "Power Control parameters:%s", VTY_NEWLINE);
- dump_dpc_params(vty, indent + 2, st->dpc_params);
+ dump_dpc_params(vty, indent + 2, st->dpc_params, false);
}
static void lchan_ms_power_ctrl_state_dump(struct vty *vty, unsigned int indent,
@@ -1620,7 +1699,7 @@ static void lchan_ms_power_ctrl_state_dump(struct vty *vty, unsigned int indent,
return;
cfg_out(vty, "Power Control parameters:%s", VTY_NEWLINE);
- dump_dpc_params(vty, indent + 2, st->dpc_params);
+ dump_dpc_params(vty, indent + 2, st->dpc_params, true);
}
static void lchan_acch_rep_state_dump(struct vty *vty, unsigned int indent,
@@ -2376,8 +2455,12 @@ int bts_vty_init(void *ctx)
install_node(&bts_node, config_write_bts);
install_element(CONFIG_NODE, &cfg_bts_cmd);
install_element(CONFIG_NODE, &cfg_vty_telnet_port_cmd);
+
+ osmo_tdef_vty_groups_init(CONFIG_NODE, bts_tdef_groups);
+
install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
install_element(BTS_NODE, &cfg_bts_oml_ip_cmd);
+ install_element(BTS_NODE, &cfg_bts_no_oml_ip_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_bind_ip_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_jitbuf_cmd);
install_element(BTS_NODE, &cfg_bts_rtp_port_range_cmd);
@@ -2419,6 +2502,7 @@ int bts_vty_init(void *ctx)
install_element(TRX_NODE, &cfg_trx_pr_step_size_cmd);
install_element(TRX_NODE, &cfg_trx_pr_step_interval_cmd);
install_element(TRX_NODE, &cfg_trx_ms_power_control_cmd);
+ install_element(TRX_NODE, &cfg_ta_ctrl_interval_cmd);
install_element(TRX_NODE, &cfg_trx_phy_cmd);
install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd);
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 5b48b2e6..1e2f89dd 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -459,7 +459,7 @@ static int mph_send_activate_req(struct gsm_lchan *lchan, struct sapi_cmd *cmd)
lac->LchId.bySAPI = cmd->sapi;
lac->LchId.byDirection = cmd->dir;
- lac->Config.byTimingAdvance = lchan->rqd_ta;
+ lac->Config.byTimingAdvance = lchan->ta_ctrl.current;
lac->Config.byBSIC = lchan->ts->trx->bts->bsic;
if ((rc = lchan2lch_par(lchan, &lac->Config)) != 0) {
talloc_free(msg);
diff --git a/src/osmo-bts-omldummy/main.c b/src/osmo-bts-omldummy/main.c
index a36e0db5..c74af745 100644
--- a/src/osmo-bts-omldummy/main.c
+++ b/src/osmo-bts-omldummy/main.c
@@ -107,7 +107,7 @@ int main(int argc, char **argv)
{
struct gsm_bts *bts;
struct gsm_bts_trx *trx;
- struct e1inp_line *line;
+ struct bsc_oml_host *bsc_oml_host;
int i;
parse_cmdline(argc, argv);
@@ -144,9 +144,13 @@ int main(int argc, char **argv)
//btsb = bts_role_bts(bts);
abis_init(bts);
- line = abis_open(bts, cmdline.dst_host, "OMLdummy");
- if (!line)
- exit(2);
+ bsc_oml_host = talloc_zero(bts, struct bsc_oml_host);
+ OSMO_ASSERT(bsc_oml_host);
+ bsc_oml_host->addr = talloc_strdup(bsc_oml_host, cmdline.dst_host);
+ OSMO_ASSERT(bsc_oml_host->addr);
+ llist_add_tail(&bsc_oml_host->list, &bts->bsc_oml_hosts);
+ if (abis_open(bts, "OMLdummy") != 0)
+ exit(1);
while (1) {
osmo_select_main(0);
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 689925fb..4bd07564 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -65,6 +65,7 @@ int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
uint16_t ber10k;
uint8_t is_sub = 0;
uint8_t ft;
+ bool amr_is_cmr;
/* If handover RACH detection is turned on, treat this burst as an Access Burst.
* Handle NOPE.ind as usually to ensure proper Uplink measurement reporting. */
@@ -129,6 +130,8 @@ int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
* the first FN 4,13,21 defines that CMR is included in frame.
* NOTE: A frame ends 7 FN after start.
*/
+ fn_begin = gsm0502_fn_remap(bi->fn, FN_REMAP_TCH_F);
+ amr_is_cmr = !ul_amr_fn_is_cmi(fn_begin);
/* The AFS_ONSET frame itself does not result into an RTP frame
* since it only contains a recognition pattern that marks the
@@ -144,8 +147,7 @@ int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
* know this before we actually decode the frame) */
amr = 2;
rc = gsm0503_tch_afs_decode_dtx(tch_data + amr, *bursts_p,
- (((bi->fn + 26 - 7) % 26) >> 2) & 1, chan_state->codec,
- chan_state->codecs, &chan_state->ul_ft,
+ amr_is_cmr, chan_state->codec, chan_state->codecs, &chan_state->ul_ft,
&chan_state->ul_cmr, &n_errors, &n_bits_total, &chan_state->amr_last_dtx);
/* Tag all frames that are not regular AMR voice frames as
@@ -186,7 +188,7 @@ int rx_tchf_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
/* only good speech frames get rtp header */
if (rc != GSM_MACBLOCK_LEN && rc >= 4) {
if (chan_state->amr_last_dtx == AMR_OTHER) {
- ft = chan_state->codec[chan_state->ul_cmr];
+ ft = chan_state->codec[chan_state->ul_ft];
} else {
/* SID frames will always get Frame Type Index 8 (AMR_SID) */
ft = AMR_SID;
@@ -274,8 +276,8 @@ bfi:
break;
case GSM48_CMODE_SPEECH_AMR: /* AMR */
rc = osmo_amr_rtp_enc(tch_data,
- chan_state->codec[chan_state->dl_cmr],
- chan_state->codec[chan_state->dl_ft],
+ chan_state->codec[chan_state->ul_cmr],
+ chan_state->codec[chan_state->ul_ft],
AMR_BAD);
if (rc < 2) {
LOGL1SB(DL1P, LOGL_ERROR, l1ts, bi,
@@ -419,6 +421,7 @@ inval_mode1:
enum osmo_amr_type ft_codec;
enum osmo_amr_quality bfi;
int8_t sti, cmi;
+ bool amr_is_cmr = !dl_amr_fn_is_cmi(br->fn);
if (rsl_cmode != RSL_CMOD_SPD_SPEECH) {
LOGL1SB(DL1P, LOGL_NOTICE, l1ts, br, "Dropping speech frame, "
@@ -463,7 +466,7 @@ inval_mode1:
"Codec (FT = %d) of RTP frame not in list\n", ft_codec);
goto free_bad_msg;
}
- if (fn_is_codec_mode_request(br->fn) && chan_state->dl_ft != ft) {
+ if (amr_is_cmr && chan_state->dl_ft != ft) {
LOGL1SB(DL1P, LOGL_NOTICE, l1ts, br, "Codec (FT = %d) "
" of RTP cannot be changed now, but in next frame\n", ft_codec);
goto free_bad_msg;
@@ -530,9 +533,16 @@ int tx_tchf_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br)
memset(*bursts_p + 464, 0, 464);
}
- /* no message at all */
+ /* no message at all, send a dummy L2 frame on FACCH */
if (!msg_tch && !msg_facch) {
+ static const uint8_t dummy[GSM_MACBLOCK_LEN] = {
+ 0x03, 0x03, 0x01, /* TODO: use randomized padding */
+ 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+ 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+ };
+
LOGL1SB(DL1P, LOGL_INFO, l1ts, br, "No TCH or FACCH prim for transmit.\n");
+ gsm0503_tch_fr_encode(*bursts_p, dummy, sizeof(dummy), 1);
goto send_burst;
}
@@ -545,7 +555,7 @@ int tx_tchf_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br)
* the first FN 0,8,17 defines that CMR is included in frame.
*/
gsm0503_tch_afs_encode(*bursts_p, msg_tch->l2h + 2,
- msgb_l2len(msg_tch) - 2, fn_is_codec_mode_request(br->fn),
+ msgb_l2len(msg_tch) - 2, !dl_amr_fn_is_cmi(br->fn),
chan_state->codec, chan_state->codecs,
chan_state->dl_ft,
chan_state->dl_cmr);
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 4f03bd12..a582f922 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -72,6 +72,7 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
uint8_t is_sub = 0;
uint8_t ft;
bool mask_stolen_tch_block = false;
+ bool fn_is_cmi;
/* If handover RACH detection is turned on, treat this burst as an Access Burst.
* Handle NOPE.ind as usually to ensure proper Uplink measurement reporting. */
@@ -164,10 +165,21 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
break;
}
+ /* Calculate the frame number where the block begins */
+ if (bi->fn % 13 < 4)
+ fn_tch_end = GSM_TDMA_FN_SUB(bi->fn, 5);
+ else
+ fn_tch_end = GSM_TDMA_FN_SUB(bi->fn, 4);
+ if (lchan->nr == 0)
+ fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H0);
+ else
+ fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H1);
+ fn_is_cmi = ul_amr_fn_is_cmi(fn_begin);
+
/* See comment in function rx_tchf_fn() */
amr = 2;
rc = gsm0503_tch_ahs_decode_dtx(tch_data + amr, *bursts_p,
- fn_is_odd, fn_is_odd, chan_state->codec,
+ fn_is_odd, !fn_is_cmi, chan_state->codec,
chan_state->codecs, &chan_state->ul_ft,
&chan_state->ul_cmr, &n_errors, &n_bits_total, &chan_state->amr_last_dtx);
@@ -210,7 +222,7 @@ int rx_tchh_fn(struct l1sched_ts *l1ts, const struct trx_ul_burst_ind *bi)
/* only good speech frames get rtp header */
if (rc != GSM_MACBLOCK_LEN && rc >= 4) {
if (chan_state->amr_last_dtx == AMR_OTHER) {
- ft = chan_state->codec[chan_state->ul_cmr];
+ ft = chan_state->codec[chan_state->ul_ft];
} else {
/* SID frames will always get Frame Type Index 8 (AMR_SID) */
ft = AMR_SID;
@@ -305,8 +317,8 @@ bfi:
break;
case GSM48_CMODE_SPEECH_AMR: /* AMR */
rc = osmo_amr_rtp_enc(tch_data,
- chan_state->codec[chan_state->dl_cmr],
- chan_state->codec[chan_state->dl_ft],
+ chan_state->codec[chan_state->ul_cmr],
+ chan_state->codec[chan_state->ul_ft],
AMR_BAD);
if (rc < 2) {
LOGL1SB(DL1P, LOGL_ERROR, l1ts, bi,
@@ -343,7 +355,6 @@ compose_l1sap:
fn_tch_end = GSM_TDMA_FN_SUB(bi->fn, 5);
else
fn_tch_end = GSM_TDMA_FN_SUB(bi->fn, 4);
-
if (lchan->nr == 0)
fn_begin = gsm0502_fn_remap(fn_tch_end, FN_REMAP_TCH_H0);
else
@@ -417,9 +428,16 @@ int tx_tchh_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br)
}
}
- /* no message at all */
+ /* no message at all, send a dummy L2 frame on FACCH */
if (!msg_tch && !msg_facch && !chan_state->dl_ongoing_facch) {
+ static const uint8_t dummy[GSM_MACBLOCK_LEN] = {
+ 0x03, 0x03, 0x01, /* TODO: use randomized padding */
+ 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+ 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
+ };
+
LOGL1SB(DL1P, LOGL_INFO, l1ts, br, "No TCH or FACCH prim for transmit.\n");
+ gsm0503_tch_hr_encode(*bursts_p, dummy, sizeof(dummy));
goto send_burst;
}
@@ -434,7 +452,7 @@ int tx_tchh_fn(struct l1sched_ts *l1ts, struct trx_dl_burst_req *br)
* in frame, the first FN 0,8,17 or 1,9,18 defines that CMR is
* included in frame. */
gsm0503_tch_ahs_encode(*bursts_p, msg_tch->l2h + 2,
- msgb_l2len(msg_tch) - 2, fn_is_codec_mode_request(br->fn),
+ msgb_l2len(msg_tch) - 2, !dl_amr_fn_is_cmi(br->fn),
chan_state->codec, chan_state->codecs,
chan_state->dl_ft,
chan_state->dl_cmr);
diff --git a/src/osmo-bts-trx/sched_utils.h b/src/osmo-bts-trx/sched_utils.h
index 4a1aaf5f..f76e49bb 100644
--- a/src/osmo-bts-trx/sched_utils.h
+++ b/src/osmo-bts-trx/sched_utils.h
@@ -23,6 +23,8 @@
#include <stdint.h>
#include <errno.h>
+#include <stdbool.h>
+#include <osmo-bts/scheduler.h>
extern void *tall_bts_ctx;
@@ -35,8 +37,76 @@ static inline uint16_t compute_ber10k(int n_bits_total, int n_errors)
return 10000 * n_errors / n_bits_total;
}
-/* determine if the FN is transmitting a CMR (1) or not (0) */
-static inline int fn_is_codec_mode_request(uint32_t fn)
+/*! determine whether an uplink AMR block is CMI according to 3GPP TS 45.009.
+ * \param[in] fn_begin frame number of the beginning of the block.
+ * \returns true in case of CMI; false otherwise. */
+static inline bool ul_amr_fn_is_cmi(uint32_t fn_begin)
{
- return (((fn + 4) % 26) >> 2) & 1;
+ switch (fn_begin % 26) {
+ /*! See also: 3GPP TS 45.009, section 3.2.1.3 Transmitter/Receiver Synchronisation */
+ /* valid for AHS subslot 0 and AFS: */
+ case 0:
+ case 8:
+ case 17:
+ /* valid for AHS subslot 1: */
+ case 1:
+ case 9:
+ case 18:
+ return true;
+ break;
+ /* Complementary values for sanity check */
+ /* valid for AHS subslot 0 and AFS: */
+ case 4:
+ case 13:
+ case 21:
+ /* valid for AHS subslot 1: */
+ case 5:
+ case 14:
+ case 22:
+ return false;
+ break;
+ default:
+ LOGP(DL1P, LOGL_DEBUG,
+ "uplink frame number fn_begin=%u does not mark the beginning of a voice block!\n", fn_begin);
+ OSMO_ASSERT(false);
+ return false;
+ break;
+ }
+}
+
+/*! determine the whether a downlink AMR block is CMI according to 3GPP TS 45.009.
+ * \param[in] fn_begin frame number of the beginning of the block.
+ * \returns true in case of CMI; false otherwise. */
+static inline bool dl_amr_fn_is_cmi(uint32_t fn_begin)
+{
+ switch (fn_begin % 26) {
+ /*! See also: 3GPP TS 45.009, section 3.2.1.3 Transmitter/Receiver Synchronisation */
+ /* valid for AHS subslot 0 and AFS: */
+ case 4:
+ case 13:
+ case 21:
+ /* valid for AHS subslot 1: */
+ case 5:
+ case 14:
+ case 22:
+ return true;
+ break;
+ /* Complementary values for sanity check */
+ /* valid for AHS subslot 0 and AFS: */
+ case 0:
+ case 8:
+ case 17:
+ /* valid for AHS subslot 1: */
+ case 1:
+ case 9:
+ case 18:
+ return false;
+ break;
+ default:
+ LOGP(DL1P, LOGL_DEBUG,
+ "downlink frame number fn_begin=%u does not mark the beginning of a voice block!\n", fn_begin);
+ OSMO_ASSERT(false);
+ return false;
+ break;
+ }
}
diff --git a/src/osmo-bts-virtual/l1_if.c b/src/osmo-bts-virtual/l1_if.c
index 444d6ad2..a4a81bd7 100644
--- a/src/osmo-bts-virtual/l1_if.c
+++ b/src/osmo-bts-virtual/l1_if.c
@@ -320,11 +320,11 @@ static int l1if_process_meas_res(struct gsm_bts_trx *trx, uint8_t tn, uint32_t f
float ber = n_bits_total==0 ? 1.0 : (float)n_errors / (float)n_bits_total;
DEBUGPFN(DMEAS, fn, "RX L1 frame %s chan_nr=0x%02x MS pwr=%ddBm rssi=%.1f dBFS "
- "ber=%.2f%% (%d/%d bits) L1_ta=%d rqd_ta=%d toa=%.2f\n",
+ "ber=%.2f%% (%d/%d bits) L1_ta=%d ta_ctrl.current=%d toa=%.2f\n",
gsm_lchan_name(lchan), chan_nr, ms_pwr_dbm(lchan->ts->trx->bts->band, lchan->ms_power_ctrl.max),
- rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info.ta, lchan->rqd_ta, toa);
+ rssi, ber*100, n_errors, n_bits_total, lchan->meas.l1_info.ta, lchan->ta_ctrl.current, toa);
- l1if_fill_meas_res(&l1sap, chan_nr, lchan->rqd_ta + toa, ber, rssi, fn);
+ l1if_fill_meas_res(&l1sap, chan_nr, lchan->ta_ctrl.current + toa, ber, rssi, fn);
return l1sap_up(trx, &l1sap);
}
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 57687eef..a1d04a77 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = paging cipher agch misc handover tx_power power meas ta_control
+SUBDIRS = paging cipher agch misc handover tx_power power meas ta_control amr
if ENABLE_SYSMOBTS
SUBDIRS += sysmobts
@@ -22,12 +22,38 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
echo ' [$(PACKAGE_URL)])'; \
} >'$(srcdir)/package.m4'
-EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE)
+EXTRA_DIST = \
+ testsuite.at \
+ $(srcdir)/package.m4 \
+ $(TESTSUITE) \
+ osmo-bts.vty \
+ $(NULL)
TESTSUITE = $(srcdir)/testsuite
DISTCLEANFILES = atconfig
+if ENABLE_EXT_TESTS
+python-tests: $(BUILT_SOURCES)
+ $(MAKE) vty-test
+else
+python-tests: $(BUILT_SOURCES)
+ echo "Not running python-based tests (determined at configure-time)"
+endif
+
+# Run a specific test with: 'make vty-test VTY_TEST=foo.vty'
+VTY_TEST ?= *.vty
+
+# To update the VTY script from current application behavior,
+# pass -u to vty_script_runner.py by doing:
+# make vty-test U=-u
+vty-test:
+ osmo_verify_transcript_vty.py -v \
+ -n OsmoBTS -p 4241 \
+ -r "$(top_builddir)/src/osmo-bts-virtual/osmo-bts-virtual --vty-test -c $(top_srcdir)/doc/examples/virtual/osmo-bts-virtual.cfg" \
+ $(U) $(srcdir)/$(VTY_TEST)
+
check-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
+ $(MAKE) $(AM_MAKEFLAGS) python-tests
installcheck-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
diff --git a/tests/amr/Makefile.am b/tests/amr/Makefile.am
new file mode 100644
index 00000000..dc0f1b81
--- /dev/null
+++ b/tests/amr/Makefile.am
@@ -0,0 +1,11 @@
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) \
+ $(LIBOSMOABIS_CFLAGS) $(LIBOSMOTRAU_CFLAGS)
+LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) \
+ $(LIBOSMOABIS_LIBS) $(LIBOSMOTRAU_LIBS)
+noinst_PROGRAMS = amr_test
+EXTRA_DIST = amr_test.ok
+
+misc_test_SOURCES = amr_test.c
+misc_test_LDADD = $(top_builddir)/src/common/libbts.a \
+ $(LDADD)
diff --git a/tests/amr/amr_test.c b/tests/amr/amr_test.c
new file mode 100644
index 00000000..4efbf402
--- /dev/null
+++ b/tests/amr/amr_test.c
@@ -0,0 +1,151 @@
+/* (C) 2021 by sysmocom s.f.m.c. GmbH
+ * All Rights Reserved
+ *
+ * Author: Philipp Maier
+ *
+ * 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 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 <osmo-bts/logging.h>
+#include <osmocom/core/utils.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "../../src/osmo-bts-trx/sched_utils.h"
+
+struct amr_cmi_test_data {
+ /* Frame number that marks the beginning of the voice block */
+ uint32_t gsm_fn;
+ /* In uplink: True, when the voice block is a CMI block, false otherwise. */
+ /* In downlink: False, when the voice block is a CMI block, true otherwise. */
+ bool is_cmi;
+};
+
+/* The behavior of AHS in subslot 0 and AFS is the same */
+static const struct amr_cmi_test_data testvec_ahs_h0_and_afs[] = {
+ { 0, true },
+ { 4, false },
+ { 8, true },
+ { 13, false },
+ { 17, true },
+ { 21, false },
+ { 26, true },
+ { 30, false },
+ { 34, true },
+ { 39, false },
+ { 43, true },
+ { 47, false },
+ { 52, true },
+ { 56, false },
+ { 60, true },
+ { 65, false },
+ { 69, true },
+ { 73, false },
+ { 78, true },
+ { 82, false },
+ { 86, true },
+ { 91, false },
+ { 95, true },
+ { 99, false },
+};
+
+static const struct amr_cmi_test_data testvec_ahs_h1[] = {
+ { 1, true },
+ { 5, false },
+ { 9, true },
+ { 14, false },
+ { 18, true },
+ { 22, false },
+ { 27, true },
+ { 31, false },
+ { 35, true },
+ { 40, false },
+ { 44, true },
+ { 48, false },
+ { 53, true },
+ { 57, false },
+ { 61, true },
+ { 66, false },
+ { 70, true },
+ { 74, false },
+ { 79, true },
+ { 83, false },
+ { 87, true },
+ { 92, false },
+ { 96, true },
+ { 100, false },
+};
+
+static void test_amr_cmi_sched(void)
+{
+ unsigned int i;
+ bool res;
+
+ printf("AMR transmission phase (CMI) in relation to GSM FN:\n");
+
+ for (i = 0; i < ARRAY_SIZE(testvec_ahs_h0_and_afs); i++) {
+ res = ul_amr_fn_is_cmi(testvec_ahs_h0_and_afs[i].gsm_fn);
+ printf("Uplink, AMR AHS on HR subslot 0: fn_begin=%u, CMI=%u\n", testvec_ahs_h0_and_afs[i].gsm_fn, res);
+ OSMO_ASSERT(res == testvec_ahs_h0_and_afs[i].is_cmi);
+ }
+
+ printf("\n");
+
+ for (i = 0; i < ARRAY_SIZE(testvec_ahs_h0_and_afs); i++) {
+ res = dl_amr_fn_is_cmi(testvec_ahs_h0_and_afs[i].gsm_fn);
+ printf("Downlink, AMR AHS on HR subslot 0: fn_begin=%u, CMI=%u\n", testvec_ahs_h0_and_afs[i].gsm_fn, res);
+ OSMO_ASSERT(res == !testvec_ahs_h0_and_afs[i].is_cmi);
+ }
+
+ printf("\n");
+ printf("\n");
+
+ for (i = 0; i < ARRAY_SIZE(testvec_ahs_h1); i++) {
+ res = ul_amr_fn_is_cmi(testvec_ahs_h1[i].gsm_fn);
+ printf("Uplink, AMR AHS on HR subslot 1: fn_begin=%u, CMI=%u\n", testvec_ahs_h1[i].gsm_fn, res);
+ OSMO_ASSERT(res == testvec_ahs_h1[i].is_cmi);
+ }
+
+ printf("\n");
+
+ for (i = 0; i < ARRAY_SIZE(testvec_ahs_h1); i++) {
+ res = dl_amr_fn_is_cmi(testvec_ahs_h1[i].gsm_fn);
+ printf("Downlink, AMR AHS on HR subslot 1: fn_begin=%u, CMI=%u\n", testvec_ahs_h1[i].gsm_fn, res);
+ OSMO_ASSERT(res == !testvec_ahs_h1[i].is_cmi);
+ }
+
+ printf("\n");
+ printf("\n");
+
+ for (i = 0; i < ARRAY_SIZE(testvec_ahs_h0_and_afs); i++) {
+ res = ul_amr_fn_is_cmi(testvec_ahs_h0_and_afs[i].gsm_fn);
+ printf("Uplink, AMR AFS: fn_begin=%u, CMI=%u\n", testvec_ahs_h0_and_afs[i].gsm_fn, res);
+ OSMO_ASSERT(res == testvec_ahs_h0_and_afs[i].is_cmi);
+ }
+
+ printf("\n");
+
+ for (i = 0; i < ARRAY_SIZE(testvec_ahs_h0_and_afs); i++) {
+ res = dl_amr_fn_is_cmi(testvec_ahs_h0_and_afs[i].gsm_fn);
+ printf("Downlink, AMR AFS: fn_begin=%u, CMI=%u\n", testvec_ahs_h0_and_afs[i].gsm_fn, res);
+ OSMO_ASSERT(res == !testvec_ahs_h0_and_afs[i].is_cmi);
+ }
+}
+
+int main(int argc, char **argv)
+{
+
+ test_amr_cmi_sched();
+ return EXIT_SUCCESS;
+}
diff --git a/tests/amr/amr_test.ok b/tests/amr/amr_test.ok
new file mode 100644
index 00000000..ec1d1a08
--- /dev/null
+++ b/tests/amr/amr_test.ok
@@ -0,0 +1,152 @@
+AMR transmission phase (CMI) in relation to GSM FN:
+Uplink, AMR AHS on HR subslot 0: fn_begin=0, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=4, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=8, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=13, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=17, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=21, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=26, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=30, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=34, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=39, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=43, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=47, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=52, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=56, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=60, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=65, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=69, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=73, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=78, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=82, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=86, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=91, CMI=0
+Uplink, AMR AHS on HR subslot 0: fn_begin=95, CMI=1
+Uplink, AMR AHS on HR subslot 0: fn_begin=99, CMI=0
+
+Downlink, AMR AHS on HR subslot 0: fn_begin=0, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=4, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=8, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=13, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=17, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=21, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=26, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=30, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=34, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=39, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=43, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=47, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=52, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=56, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=60, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=65, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=69, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=73, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=78, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=82, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=86, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=91, CMI=1
+Downlink, AMR AHS on HR subslot 0: fn_begin=95, CMI=0
+Downlink, AMR AHS on HR subslot 0: fn_begin=99, CMI=1
+
+
+Uplink, AMR AHS on HR subslot 1: fn_begin=1, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=5, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=9, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=14, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=18, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=22, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=27, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=31, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=35, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=40, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=44, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=48, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=53, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=57, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=61, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=66, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=70, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=74, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=79, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=83, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=87, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=92, CMI=0
+Uplink, AMR AHS on HR subslot 1: fn_begin=96, CMI=1
+Uplink, AMR AHS on HR subslot 1: fn_begin=100, CMI=0
+
+Downlink, AMR AHS on HR subslot 1: fn_begin=1, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=5, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=9, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=14, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=18, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=22, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=27, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=31, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=35, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=40, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=44, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=48, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=53, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=57, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=61, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=66, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=70, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=74, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=79, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=83, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=87, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=92, CMI=1
+Downlink, AMR AHS on HR subslot 1: fn_begin=96, CMI=0
+Downlink, AMR AHS on HR subslot 1: fn_begin=100, CMI=1
+
+
+Uplink, AMR AFS: fn_begin=0, CMI=1
+Uplink, AMR AFS: fn_begin=4, CMI=0
+Uplink, AMR AFS: fn_begin=8, CMI=1
+Uplink, AMR AFS: fn_begin=13, CMI=0
+Uplink, AMR AFS: fn_begin=17, CMI=1
+Uplink, AMR AFS: fn_begin=21, CMI=0
+Uplink, AMR AFS: fn_begin=26, CMI=1
+Uplink, AMR AFS: fn_begin=30, CMI=0
+Uplink, AMR AFS: fn_begin=34, CMI=1
+Uplink, AMR AFS: fn_begin=39, CMI=0
+Uplink, AMR AFS: fn_begin=43, CMI=1
+Uplink, AMR AFS: fn_begin=47, CMI=0
+Uplink, AMR AFS: fn_begin=52, CMI=1
+Uplink, AMR AFS: fn_begin=56, CMI=0
+Uplink, AMR AFS: fn_begin=60, CMI=1
+Uplink, AMR AFS: fn_begin=65, CMI=0
+Uplink, AMR AFS: fn_begin=69, CMI=1
+Uplink, AMR AFS: fn_begin=73, CMI=0
+Uplink, AMR AFS: fn_begin=78, CMI=1
+Uplink, AMR AFS: fn_begin=82, CMI=0
+Uplink, AMR AFS: fn_begin=86, CMI=1
+Uplink, AMR AFS: fn_begin=91, CMI=0
+Uplink, AMR AFS: fn_begin=95, CMI=1
+Uplink, AMR AFS: fn_begin=99, CMI=0
+
+Downlink, AMR AFS: fn_begin=0, CMI=0
+Downlink, AMR AFS: fn_begin=4, CMI=1
+Downlink, AMR AFS: fn_begin=8, CMI=0
+Downlink, AMR AFS: fn_begin=13, CMI=1
+Downlink, AMR AFS: fn_begin=17, CMI=0
+Downlink, AMR AFS: fn_begin=21, CMI=1
+Downlink, AMR AFS: fn_begin=26, CMI=0
+Downlink, AMR AFS: fn_begin=30, CMI=1
+Downlink, AMR AFS: fn_begin=34, CMI=0
+Downlink, AMR AFS: fn_begin=39, CMI=1
+Downlink, AMR AFS: fn_begin=43, CMI=0
+Downlink, AMR AFS: fn_begin=47, CMI=1
+Downlink, AMR AFS: fn_begin=52, CMI=0
+Downlink, AMR AFS: fn_begin=56, CMI=1
+Downlink, AMR AFS: fn_begin=60, CMI=0
+Downlink, AMR AFS: fn_begin=65, CMI=1
+Downlink, AMR AFS: fn_begin=69, CMI=0
+Downlink, AMR AFS: fn_begin=73, CMI=1
+Downlink, AMR AFS: fn_begin=78, CMI=0
+Downlink, AMR AFS: fn_begin=82, CMI=1
+Downlink, AMR AFS: fn_begin=86, CMI=0
+Downlink, AMR AFS: fn_begin=91, CMI=1
+Downlink, AMR AFS: fn_begin=95, CMI=0
+Downlink, AMR AFS: fn_begin=99, CMI=1
diff --git a/tests/meas/meas_testcases.h b/tests/meas/meas_testcases.h
index d7eee5c3..90f0f850 100644
--- a/tests/meas/meas_testcases.h
+++ b/tests/meas/meas_testcases.h
@@ -1,5 +1,5 @@
#define ULM(ber, ta, sub, neg_rssi) \
- { .ber10k = (ber), .ta_offs_256bits = (ta), .c_i = 1.0, .is_sub = sub, .inv_rssi = (neg_rssi) }
+ { .ber10k = (ber), .ta_offs_256bits = (ta), .c_i = 10, .is_sub = sub, .inv_rssi = (neg_rssi) }
struct meas_testcase {
const char *name;
diff --git a/tests/osmo-bts.vty b/tests/osmo-bts.vty
new file mode 100644
index 00000000..fb74747c
--- /dev/null
+++ b/tests/osmo-bts.vty
@@ -0,0 +1,297 @@
+OsmoBTS> list
+...
+ show bts [<0-255>]
+ show trx [<0-255>] [<0-255>]
+ show timeslot [<0-255>] [<0-255>] [<0-7>]
+ show lchan [<0-255>] [<0-255>] [<0-7>] [<0-7>]
+ show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]
+ show bts <0-255> gprs
+...
+ show timer [(bts|abis)] [TNNNN]
+ show e1_driver
+ show e1_line [<0-255>] [stats]
+ show e1_timeslot [<0-255>] [<0-31>]
+...
+OsmoBTS> ?
+...
+ show Show running system information
+...
+
+OsmoBTS> show ?
+...
+ bts Display information about a BTS
+ trx Display information about a TRX
+ timeslot Display information about a TS
+ lchan Display information about a logical channel
+ timer Show timers
+ e1_driver Display information about available E1 drivers
+ e1_line Display information about a E1 line
+ e1_timeslot Display information about a E1 timeslot
+...
+OsmoBTS> show bts ?
+ [<0-255>] BTS Number
+ <0-255> BTS Number
+OsmoBTS> show bts 0 ?
+ gprs GPRS/EGPRS configuration
+ <cr>
+OsmoBTS> show trx ?
+ [<0-255>] BTS Number
+OsmoBTS> show trx 0 ?
+ [<0-255>] TRX Number
+OsmoBTS> show timeslot ?
+ [<0-255>] BTS Number
+OsmoBTS> show timeslot 0 ?
+ [<0-255>] TRX Number
+OsmoBTS> show timeslot 0 0 ?
+ [<0-7>] Timeslot Number
+OsmoBTS> show lchan ?
+ [<0-255>] BTS Number
+ summary Short summary
+OsmoBTS> show lchan 0 ?
+ [<0-255>] TRX Number
+OsmoBTS> show lchan 0 0 ?
+ [<0-7>] Timeslot Number
+OsmoBTS> show lchan 0 0 0 ?
+ [<0-7>] Logical Channel Number
+OsmoBTS> show lchan summary ?
+ [<0-255>] BTS Number
+OsmoBTS> show lchan summary 0 ?
+ [<0-255>] TRX Number
+OsmoBTS> show lchan summary 0 0 ?
+ [<0-7>] Timeslot Number
+OsmoBTS> show lchan summary 0 0 0 ?
+ [<0-7>] Logical Channel Number
+
+OsmoBTS> show timer ?
+ [bts] BTS process timers
+ [abis] Abis (RSL) related timers
+OsmoBTS> show timer
+bts: X1 = 300 s Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+bts: X2 = 3 s Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+abis: X15 = 0 ms Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 0 ms)
+OsmoBTS> show timer bts ?
+ [TNNNN] T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234'; Osmocom-specific timer number of the format: 'X1234' or 'x1234'.
+OsmoBTS> show timer bts
+bts: X1 = 300 s Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+bts: X2 = 3 s Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+OsmoBTS> show timer bts X1
+bts: X1 = 300 s Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+OsmoBTS> show timer bts X2
+bts: X2 = 3 s Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+OsmoBTS> show timer abis ?
+ [TNNNN] T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234'; Osmocom-specific timer number of the format: 'X1234' or 'x1234'.
+OsmoBTS> show timer abis X15
+abis: X15 = 0 ms Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 0 ms)
+
+OsmoBTS> show e1_driver ?
+ <cr>
+OsmoBTS> show e1_line ?
+ [<0-255>] E1 Line Number
+OsmoBTS> show e1_line 0 ?
+ [stats] Include statistics
+OsmoBTS> show e1_timeslot ?
+ [<0-255>] E1 Line Number
+OsmoBTS> show e1_timeslot 0 ?
+ [<0-31>] E1 Timeslot Number
+
+OsmoBTS> enable
+OsmoBTS# list
+...
+ show bts [<0-255>]
+ show trx [<0-255>] [<0-255>]
+ show timeslot [<0-255>] [<0-255>] [<0-7>]
+ show lchan [<0-255>] [<0-255>] [<0-7>] [<0-7>]
+ show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]
+ show bts <0-255> gprs
+...
+ show timer [(bts|abis)] [TNNNN]
+ bts <0-0> trx <0-255> ts <0-7> (lchan|shadow-lchan) <0-7> rtp jitter-buffer <0-10000>
+ test send-failure-event-report <0-255>
+ bts <0-255> c0-power-red <0-6>
+ show e1_driver
+ show e1_line [<0-255>] [stats]
+ show e1_timeslot [<0-255>] [<0-31>]
+...
+
+OsmoBTS# ?
+...
+ show Show running system information
+...
+
+OsmoBTS# show ?
+...
+ bts Display information about a BTS
+ trx Display information about a TRX
+ timeslot Display information about a TS
+ lchan Display information about a logical channel
+ timer Show timers
+ e1_driver Display information about available E1 drivers
+ e1_line Display information about a E1 line
+ e1_timeslot Display information about a E1 timeslot
+...
+OsmoBTS# show bts ?
+ [<0-255>] BTS Number
+ <0-255> BTS Number
+OsmoBTS# show bts 0 ?
+ gprs GPRS/EGPRS configuration
+ <cr>
+OsmoBTS# show trx ?
+ [<0-255>] BTS Number
+OsmoBTS# show trx 0 ?
+ [<0-255>] TRX Number
+OsmoBTS# show timeslot ?
+ [<0-255>] BTS Number
+OsmoBTS# show timeslot 0 ?
+ [<0-255>] TRX Number
+OsmoBTS# show timeslot 0 0 ?
+ [<0-7>] Timeslot Number
+OsmoBTS# show lchan ?
+ [<0-255>] BTS Number
+ summary Short summary
+OsmoBTS# show lchan 0 ?
+ [<0-255>] TRX Number
+OsmoBTS# show lchan 0 0 ?
+ [<0-7>] Timeslot Number
+OsmoBTS# show lchan 0 0 0 ?
+ [<0-7>] Logical Channel Number
+OsmoBTS# show lchan summary ?
+ [<0-255>] BTS Number
+OsmoBTS# show lchan summary 0 ?
+ [<0-255>] TRX Number
+OsmoBTS# show lchan summary 0 0 ?
+ [<0-7>] Timeslot Number
+OsmoBTS# show lchan summary 0 0 0 ?
+ [<0-7>] Logical Channel Number
+OsmoBTS# show e1_driver ?
+ <cr>
+OsmoBTS# show e1_line ?
+ [<0-255>] E1 Line Number
+OsmoBTS# show e1_line 0 ?
+ [stats] Include statistics
+OsmoBTS# show e1_timeslot ?
+ [<0-255>] E1 Line Number
+OsmoBTS# show e1_timeslot 0 ?
+ [<0-31>] E1 Timeslot Number
+
+OsmoBTS# configure terminal
+OsmoBTS(config)# list
+...
+ bts BTS_NR
+...
+ timer [(bts|abis)] [TNNNN] [(<0-2147483647>|default)]
+ phy <0-255>
+ e1_input
+...
+OsmoBTS(config)# ?
+...
+ bts Select a BTS to configure
+...
+ timer Configure or show timers
+ phy Select a PHY to configure
+ e1_input Configure E1/T1/J1 TDM input
+...
+OsmoBTS(config)# bts ?
+ BTS_NR BTS Number
+OsmoBTS(config)# phy ?
+ <0-255> PHY number
+
+OsmoBTS(config)# timer ?
+ [bts] BTS process timers
+ [abis] Abis (RSL) related timers
+OsmoBTS(config)# timer bts ?
+ [TNNNN] T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234'; Osmocom-specific timer number of the format: 'X1234' or 'x1234'.
+OsmoBTS(config)# timer bts X1
+bts: X1 = 300 s Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+OsmoBTS(config)# timer bts X2
+bts: X2 = 3 s Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+OsmoBTS(config)# timer bts X1 ?
+ [<0-2147483647>] New timer value
+ [default] Set to default timer value
+OsmoBTS(config)# timer bts X1 123
+OsmoBTS(config)# timer bts X1
+bts: X1 = 123 s Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+OsmoBTS(config)# timer bts X1 default
+OsmoBTS(config)# timer bts X1
+bts: X1 = 300 s Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+
+OsmoBTS(config)# timer abis X15
+abis: X15 = 0 ms Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 0 ms)
+OsmoBTS(config)# timer abis X15 123
+OsmoBTS(config)# timer abis X15
+abis: X15 = 123 ms Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 0 ms)
+OsmoBTS(config)# timer abis X15 default
+OsmoBTS(config)# timer abis X15
+abis: X15 = 0 ms Time to wait between Channel Activation and dispatching a cached early Immediate Assignment (default: 0 ms)
+
+OsmoBTS(config)# bts 0
+OsmoBTS(bts)# list
+...
+ ipa unit-id <0-65534> <0-255>
+ oml remote-ip A.B.C.D
+ no oml remote-ip A.B.C.D
+ rtp jitter-buffer <0-10000> [adaptive]
+ rtp port-range <1-65534> <1-65534>
+ rtp ip-dscp <0-63>
+ rtp socket-priority <0-255>
+ band (450|GSM450|480|GSM480|750|GSM750|810|GSM810|850|GSM850|900|GSM900|1800|DCS1800|1900|PCS1900)
+ description .TEXT
+ no description
+ paging queue-size <1-1024>
+ paging lifetime <0-60>
+ agch-queue-mgmt default
+ agch-queue-mgmt threshold <0-100> low <0-100> high <0-100000>
+ min-qual-rach <-100-100>
+ min-qual-norm <-100-100>
+ max-ber10k-rach <0-10000>
+ pcu-socket PATH
+ supp-meas-info toa256
+ no supp-meas-info toa256
+ smscb queue-max-length <1-60>
+ smscb queue-target-length <1-30>
+ smscb queue-hysteresis <0-30>
+ gsmtap-remote-host [HOSTNAME]
+ no gsmtap-remote-host
+ gsmtap-sapi (enable-all|disable-all)
+ gsmtap-sapi (bcch|ccch|rach|agch|pch|sdcch|tch/f|tch/h|pacch|pdtch|ptcch|cbch|sacch)
+ no gsmtap-sapi (bcch|ccch|rach|agch|pch|sdcch|tch/f|tch/h|pacch|pdtch|ptcch|cbch|sacch)
+ trx <0-254>
+...
+OsmoBTS(bts)# ?
+...
+ ipa ip.access RSL commands
+ oml OML Parameters
+ no Negate a command or set its defaults
+ rtp RTP parameters
+ band Set the frequency band of this BTS
+ description Save human-readable description of the object
+ paging Paging related parameters
+ agch-queue-mgmt AGCH queue mgmt
+ min-qual-rach Set the minimum link quality level of Access Bursts to be accepted
+ min-qual-norm Set the minimum link quality level of Normal Bursts to be accepted
+ max-ber10k-rach Set the maximum BER for valid RACH requests
+ pcu-socket Configure the PCU socket file/path name
+ supp-meas-info Configure the RSL Supplementary Measurement Info
+ smscb SMSCB (SMS Cell Broadcast) / CBCH configuration
+ gsmtap-remote-host Enable GSMTAP Um logging (see also 'gsmtap-sapi')
+ gsmtap-sapi Enable/disable sending of UL/DL messages over GSMTAP
+ trx Select a TRX to configure
+...
+OsmoBTS(bts)# trx 0
+OsmoBTS(trx)# list
+...
+ user-gain <-100000-100000> (dB|mdB)
+ power-ramp max-initial <-10000-100000> (dBm|mdBm)
+ power-ramp step-size <1-100000> (dB|mdB)
+ power-ramp step-interval <1-100>
+ ms-power-control (dsp|osmo)
+ ta-control interval <0-31>
+ phy <0-255> instance <0-255>
+...
+OsmoBTS(trx)# ?
+...
+ user-gain Inform BTS about additional, user-provided gain or attenuation at TRX output
+ power-ramp Power-Ramp settings
+ ms-power-control Mobile Station Power Level Control
+ ta-control Timing Advance Control Parameters
+ phy Configure PHY Link+Instance for this TRX
+...
diff --git a/tests/power/bs_power_loop_test.c b/tests/power/bs_power_loop_test.c
index 53fdbba6..6b67ba2e 100644
--- a/tests/power/bs_power_loop_test.c
+++ b/tests/power/bs_power_loop_test.c
@@ -112,6 +112,14 @@ static void init_test(const char *name)
g_bts->band = GSM_BAND_900;
g_bts->c0 = g_trx;
+ /* Init defaultBS power control parameters, enable dynamic power control */
+ struct gsm_power_ctrl_params *params = &g_trx->ts[0].lchan[0].bs_dpc_params;
+ g_trx->ts[0].lchan[0].bs_power_ctrl.dpc_params = params;
+ *params = power_ctrl_params_def;
+
+ /* Disable loop SACCH block skip by default: */
+ params->ctrl_interval = 0;
+
printf("\nStarting test case '%s'\n", name);
}
@@ -219,9 +227,6 @@ static void exec_power_test(const struct power_test_step *steps,
struct gsm_lchan *lchan = &g_trx->ts[0].lchan[0];
struct gsm_power_ctrl_params *params = &lchan->bs_dpc_params;
- /* Default BS power control parameters */
- memcpy(params, &power_ctrl_params_def, sizeof(*params));
-
/* No RxLev hysteresis: lower == upper */
params->rxlev_meas.lower_thresh = PWR_TEST_RXLEV_TARGET;
params->rxlev_meas.upper_thresh = PWR_TEST_RXLEV_TARGET;
diff --git a/tests/power/bs_power_loop_test.err b/tests/power/bs_power_loop_test.err
index c4726b1b..dc4f411c 100644
--- a/tests/power/bs_power_loop_test.err
+++ b/tests/power/bs_power_loop_test.err
@@ -1,196 +1,199 @@
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 0 -> 2 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 0 dB => 2 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 2 -> 4 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 2 dB => 4 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 4 -> 6 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 4 dB => 6 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 6 -> 8 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 6 dB => 8 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 8 -> 10 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 8 dB => 10 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 10 -> 12 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 10 dB => 12 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 12 -> 14 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 12 dB => 14 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 14 -> 16 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 14 dB => 16 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 16 -> 18 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 16 dB => 18 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 18 -> 20 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 18 dB => 20 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 20 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 20 dB: max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 20 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 20 dB: max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 20 -> 16 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 20 dB => 16 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 16 -> 12 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 16 dB => 12 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 12 -> 8 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 12 dB => 8 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 8 -> 4 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 8 dB => 4 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 4 -> 0 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 4 dB => 0 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 0 -> 4 dB (maximum 20 dB, suggested delta 4 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 0 dB => 4 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 4 -> 8 dB (maximum 20 dB, suggested delta 4 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 4 dB => 8 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 8 -> 12 dB (maximum 20 dB, suggested delta 4 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 8 dB => 12 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 12 -> 16 dB (maximum 20 dB, suggested delta 4 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 12 dB => 16 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 16 -> 20 dB (maximum 20 dB, suggested delta 4 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 16 dB => 20 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 20 dB (maximum 20 dB, suggested delta 4 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 20 dB: max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 20 -> 14 dB (maximum 20 dB, suggested delta -6 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 20 dB => 14 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 14 -> 8 dB (maximum 20 dB, suggested delta -6 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 14 dB => 8 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 8 -> 2 dB (maximum 20 dB, suggested delta -6 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 8 dB => 2 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 2 -> 0 dB (maximum 20 dB, suggested delta -6 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 2 dB => 0 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta -6 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(31), RXQUAL-FULL(0), RXLEV-SUB(31), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 10 -> 11 dB (maximum 20 dB, suggested delta 1 dB, RxLev current 31 (-79 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 10 dB => 11 dB:max 20 dB, RSSI[curr -79, avg -79, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 11 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 11 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(32), RXQUAL-FULL(0), RXLEV-SUB(32), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 11 -> 13 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 32 (-78 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 11 dB => 13 dB:max 20 dB, RSSI[curr -78, avg -78, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 13 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 13 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(33), RXQUAL-FULL(0), RXLEV-SUB(33), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 13 -> 16 dB (maximum 20 dB, suggested delta 3 dB, RxLev current 33 (-77 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 13 dB => 16 dB:max 20 dB, RSSI[curr -77, avg -77, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(29), RXQUAL-FULL(0), RXLEV-SUB(29), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 10 -> 9 dB (maximum 20 dB, suggested delta -1 dB, RxLev current 29 (-81 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 10 dB => 9 dB:max 20 dB, RSSI[curr -81, avg -81, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 9 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 9 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(27), RXQUAL-FULL(0), RXLEV-SUB(27), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 9 -> 6 dB (maximum 20 dB, suggested delta -3 dB, RxLev current 27 (-83 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 9 dB => 6 dB:max 20 dB, RSSI[curr -83, avg -83, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 6 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 6 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(25), RXQUAL-FULL(0), RXLEV-SUB(25), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 6 -> 1 dB (maximum 20 dB, suggested delta -5 dB, RxLev current 25 (-85 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 6 dB => 1 dB:max 20 dB, RSSI[curr -85, avg -85, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 1 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 1 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(00), RXQUAL-FULL(7), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is enabled => using SUB
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(3), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is enabled => using SUB
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(63), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is enabled => using SUB
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 0 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(1), RXLEV-SUB(30), RXQUAL-SUB(1), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 1, avg 1, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(2), RXLEV-SUB(30), RXQUAL-SUB(2), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 2, avg 2, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(3), RXLEV-SUB(30), RXQUAL-SUB(3), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 3, avg 3, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(4), RXLEV-SUB(30), RXQUAL-SUB(4), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Reducing Downlink attenuation: 16 -> 12 dB due to RxQual 4 worse than L_RXQUAL_XX_P 3
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 16 dB => 12 dB:max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 4, avg 4, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(34), RXQUAL-FULL(5), RXLEV-SUB(34), RXQUAL-SUB(5), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Reducing Downlink attenuation: 12 -> 8 dB due to RxQual 5 worse than L_RXQUAL_XX_P 3
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 12 dB => 8 dB:max 20 dB, RSSI[curr -76, avg -76, thresh -80..-80] dBm, RxQual[curr 5, avg 5, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(38), RXQUAL-FULL(6), RXLEV-SUB(38), RXQUAL-SUB(6), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Reducing Downlink attenuation: 8 -> 4 dB due to RxQual 6 worse than L_RXQUAL_XX_P 3
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 8 dB => 4 dB:max 20 dB, RSSI[curr -72, avg -72, thresh -80..-80] dBm, RxQual[curr 6, avg 6, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(42), RXQUAL-FULL(7), RXLEV-SUB(42), RXQUAL-SUB(7), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Reducing Downlink attenuation: 4 -> 0 dB due to RxQual 7 worse than L_RXQUAL_XX_P 3
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 4 dB => 0 dB:max 20 dB, RSSI[curr -68, avg -68, thresh -80..-80] dBm, RxQual[curr 7, avg 7, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(46), RXQUAL-FULL(7), RXLEV-SUB(46), RXQUAL-SUB(7), DTx is disabled => using FULL
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -64, avg -64, thresh -80..-80] dBm, RxQual[curr 7, avg 7, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(46), RXQUAL-FULL(0), RXLEV-SUB(46), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 0 -> 2 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 46 (-64 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 0 dB => 2 dB:max 20 dB, RSSI[curr -64, avg -64, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(44), RXQUAL-FULL(0), RXLEV-SUB(44), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 2 -> 4 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 44 (-66 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 2 dB => 4 dB:max 20 dB, RSSI[curr -66, avg -66, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(42), RXQUAL-FULL(0), RXLEV-SUB(42), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 4 -> 6 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 42 (-68 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 4 dB => 6 dB:max 20 dB, RSSI[curr -68, avg -68, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(7), RXLEV-SUB(30), RXQUAL-SUB(7), DTx is disabled => using FULL
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 7, avg 7, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(7), RXLEV-SUB(30), RXQUAL-SUB(7), DTx is disabled => using FULL
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 0 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 7, avg 7, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) The measurement results are not valid
(bts=0,trx=0,ts=0,ss=0) The measurement results are not valid
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 20 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 20 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 0 -> 2 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 0 dB => 2 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 2 -> 4 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 2 dB => 4 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 4 -> 6 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 4 dB => 6 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 6 -> 8 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 6 dB => 8 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 8 -> 4 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 8 dB => 4 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 4 -> 0 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 4 dB => 0 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 0 -> 2 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 0 dB => 2 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 2 -> 4 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 2 dB => 4 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 4 -> 6 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 4 dB => 6 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 6 -> 8 dB (maximum 20 dB, suggested delta 2 dB, RxLev current 60 (-50 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 6 dB => 8 dB:max 20 dB, RSSI[curr -50, avg -50, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(60), RXQUAL-FULL(0), RXLEV-SUB(60), RXQUAL-SUB(0), DTx is disabled => using FULL
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 8 -> 4 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 8 dB => 4 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(10), RXQUAL-FULL(0), RXLEV-SUB(10), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 4 -> 0 dB (maximum 20 dB, suggested delta -4 dB, RxLev current 10 (-100 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 4 dB => 0 dB:max 20 dB, RSSI[curr -100, avg -100, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(31), RXQUAL-FULL(0), RXLEV-SUB(31), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 12 -> 13 dB (maximum 16 dB, suggested delta 1 dB, RxLev current 31 (-79 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 12 dB => 13 dB:max 16 dB, RSSI[curr -79, avg -79, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(28), RXQUAL-FULL(0), RXLEV-SUB(28), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 13 -> 11 dB (maximum 16 dB, suggested delta -2 dB, RxLev current 28 (-82 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 13 dB => 11 dB:max 16 dB, RSSI[curr -82, avg -82, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(33), RXQUAL-FULL(0), RXLEV-SUB(33), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 11 -> 13 dB (maximum 16 dB, suggested delta 2 dB, RxLev current 33 (-77 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 11 dB => 13 dB:max 16 dB, RSSI[curr -77, avg -77, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(28), RXQUAL-FULL(0), RXLEV-SUB(28), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 13 -> 11 dB (maximum 16 dB, suggested delta -2 dB, RxLev current 28 (-82 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 13 dB => 11 dB:max 16 dB, RSSI[curr -82, avg -82, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(31), RXQUAL-FULL(0), RXLEV-SUB(31), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 11 dB (maximum 16 dB, suggested delta 0 dB, RxLev current 31 (-79 dBm), thresholds 27 .. 33)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 11 dB: max 16 dB, RSSI[curr -79, avg -79, thresh -83..-77] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(28), RXQUAL-FULL(0), RXLEV-SUB(28), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 11 dB (maximum 16 dB, suggested delta 0 dB, RxLev current 28 (-82 dBm), thresholds 27 .. 33)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 11 dB: max 16 dB, RSSI[curr -82, avg -82, thresh -83..-77] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(33), RXQUAL-FULL(0), RXLEV-SUB(33), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 11 dB (maximum 16 dB, suggested delta 0 dB, RxLev current 33 (-77 dBm), thresholds 27 .. 33)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 11 dB: max 16 dB, RSSI[curr -77, avg -77, thresh -83..-77] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(28), RXQUAL-FULL(0), RXLEV-SUB(28), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 11 dB (maximum 16 dB, suggested delta 0 dB, RxLev current 28 (-82 dBm), thresholds 27 .. 33)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 11 dB: max 16 dB, RSSI[curr -82, avg -82, thresh -83..-77] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 30 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 30 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(30), RXQUAL-FULL(0), RXLEV-SUB(30), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Keeping Downlink attenuation at 16 dB (maximum 30 dB, suggested delta 0 dB, RxLev current 30 (-80 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Keeping DL attenuation at 16 dB: max 30 dB, RSSI[curr -80, avg -80, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(26), RXQUAL-FULL(0), RXLEV-SUB(26), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 16 -> 14 dB (maximum 30 dB, suggested delta -2 dB, RxLev current 26 (-84 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 16 dB => 14 dB:max 30 dB, RSSI[curr -84, avg -82, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(26), RXQUAL-FULL(0), RXLEV-SUB(26), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 14 -> 11 dB (maximum 30 dB, suggested delta -3 dB, RxLev current 26 (-84 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Lowering DL attenuation 14 dB => 11 dB:max 30 dB, RSSI[curr -84, avg -83, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(35), RXQUAL-FULL(0), RXLEV-SUB(35), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 11 -> 12 dB (maximum 30 dB, suggested delta 1 dB, RxLev current 35 (-75 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 11 dB => 12 dB:max 30 dB, RSSI[curr -75, avg -79, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
(bts=0,trx=0,ts=0,ss=0) Rx DL Measurement Report: RXLEV-FULL(35), RXQUAL-FULL(0), RXLEV-SUB(35), RXQUAL-SUB(0), DTx is disabled => using FULL
-(bts=0,trx=0,ts=0,ss=0) Changing Downlink attenuation: 12 -> 14 dB (maximum 30 dB, suggested delta 2 dB, RxLev current 35 (-75 dBm), thresholds 30 .. 30)
+(bts=0,trx=0,ts=0,ss=0) Raising DL attenuation 12 dB => 14 dB:max 30 dB, RSSI[curr -75, avg -77, thresh -80..-80] dBm, RxQual[curr 0, avg 0, thresh 3..0]
diff --git a/tests/power/ms_power_loop_test.c b/tests/power/ms_power_loop_test.c
index 0d863108..559eacc7 100644
--- a/tests/power/ms_power_loop_test.c
+++ b/tests/power/ms_power_loop_test.c
@@ -59,6 +59,9 @@ static void init_test(const char *name)
g_trx->ts[0].lchan[0].ms_power_ctrl.dpc_params = params;
*params = power_ctrl_params_def;
+ /* Disable loop SACCH block skip by default: */
+ params->ctrl_interval = 0;
+
/* Disable RxLev pre-processing and hysteresis by default */
struct gsm_power_ctrl_meas_params *mp = &params->rxlev_meas;
mp->lower_thresh = mp->upper_thresh = PWR_TEST_RXLEV_TARGET;
@@ -67,13 +70,13 @@ static void init_test(const char *name)
printf("\nStarting test case '%s'\n", name);
}
-static inline void apply_power_test(struct gsm_lchan *lchan, int rxlev, int exp_ret, uint8_t exp_current)
+static inline void apply_power_test(struct gsm_lchan *lchan, int rxlev, int lqual_cb, int exp_ret, uint8_t exp_current)
{
uint8_t old;
int ret;
old = lchan->ms_power_ctrl.current;
- ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, rxlev);
+ ret = lchan_ms_pwr_ctrl(lchan, lchan->ms_power_ctrl.current, rxlev, lqual_cb);
/* Keep the measurement counter updated */
lchan->meas.res_nr++;
@@ -87,9 +90,14 @@ static inline void apply_power_test(struct gsm_lchan *lchan, int rxlev, int exp_
static void test_power_loop(void)
{
struct gsm_lchan *lchan;
+ const struct gsm_power_ctrl_params *params;
+ int16_t good_lqual;
init_test(__func__);
lchan = &g_trx->ts[0].lchan[0];
+ params = lchan->ms_power_ctrl.dpc_params;
+ lchan->type = GSM_LCHAN_SDCCH;
+ good_lqual = (params->ci_sdcch_meas.lower_thresh + 2) * 10;
lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0);
OSMO_ASSERT(lchan->ms_power_ctrl.current == 15);
@@ -97,73 +105,78 @@ static void test_power_loop(void)
OSMO_ASSERT(lchan->ms_power_ctrl.max == 2);
/* Simply clamping */
- apply_power_test(lchan, -60, 0, 15);
+ apply_power_test(lchan, -60, good_lqual, 0, 15);
/*
* Now 15 dB too little and we should power it up. Could be a
* power level of 7 or 8 for 15 dBm. However, since we limit peace at
* which we change values, expect several steps of MS_RAISE_MAX_DB/2 levels:
*/
- apply_power_test(lchan, -90, 1, 13);
- apply_power_test(lchan, -90, 1, 11);
- apply_power_test(lchan, -90, 1, 9);
- apply_power_test(lchan, -90, 1, 7);
- apply_power_test(lchan, -90, 1, 5);
+ apply_power_test(lchan, -90, good_lqual, 1, 13);
+ apply_power_test(lchan, -90, good_lqual, 1, 11);
+ apply_power_test(lchan, -90, good_lqual, 1, 9);
+ apply_power_test(lchan, -90, good_lqual, 1, 7);
+ apply_power_test(lchan, -90, good_lqual, 1, 5);
/* Check good RSSI value keeps it at same power level: */
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM, 0, 5);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM, good_lqual, 0, 5);
- apply_power_test(lchan, -90, 1, 3);
- apply_power_test(lchan, -90, 1, 2); /* .max is pwr lvl 2 */
- apply_power_test(lchan, -90, 0, 2); /* .max is pwr lvl 2 */
+ apply_power_test(lchan, -90, good_lqual, 1, 3);
+ apply_power_test(lchan, -90, good_lqual, 1, 2); /* .max is pwr lvl 2 */
+ apply_power_test(lchan, -90, good_lqual, 0, 2); /* .max is pwr lvl 2 */
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 30);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 0);
- apply_power_test(lchan, -90, 1, 0); /* .max is pwr lvl 0 */
- apply_power_test(lchan, -90, 0, 0); /* .max is pwr lvl 0 */
+ apply_power_test(lchan, -90, good_lqual, 1, 0); /* .max is pwr lvl 0 */
+ apply_power_test(lchan, -90, good_lqual, 0, 0); /* .max is pwr lvl 0 */
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 36);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 29);
- apply_power_test(lchan, -90, 1, 30);
- apply_power_test(lchan, -90, 1, 29);
- apply_power_test(lchan, -90, 0, 29);
+ apply_power_test(lchan, -90, good_lqual, 1, 30);
+ apply_power_test(lchan, -90, good_lqual, 1, 29);
+ apply_power_test(lchan, -90, good_lqual, 0, 29);
/* Check good RSSI value keeps it at same power level: */
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM, 0, 29);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM, good_lqual, 0, 29);
/* Now go down, steps are double size in this direction: */
- apply_power_test(lchan, -45, 1, 1);
- apply_power_test(lchan, -45, 1, 5);
- apply_power_test(lchan, -45, 1, 9);
+ apply_power_test(lchan, -45, good_lqual, 1, 1);
+ apply_power_test(lchan, -45, good_lqual, 1, 5);
+ apply_power_test(lchan, -45, good_lqual, 1, 9);
/* Go down only one level down and up: */
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM + 2, 1, 10);
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM - 2, 1, 9);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM + 2, good_lqual, 1, 10);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM - 2, good_lqual, 1, 9);
/* Check if BSC requesting a low max power is applied after loop calculation: */
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 2);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 14);
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM + 2, 1, 14);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM + 2, good_lqual, 1, 14);
/* Set back a more normal max: */
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 30);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 0);
/* Disable dynamic power control and jump down */
lchan->ms_power_ctrl.dpc_params = NULL;
- apply_power_test(lchan, -60, 0, 14);
+ apply_power_test(lchan, -60, good_lqual, 0, 14);
/* Enable and leave it again */
lchan->ms_power_ctrl.dpc_params = &lchan->ms_dpc_params;
- apply_power_test(lchan, -40, 1, 15);
+ apply_power_test(lchan, -40, good_lqual, 1, 15);
}
static void test_pf_algo_ewma(void)
{
struct gsm_lchan *lchan;
+ const struct gsm_power_ctrl_params *params;
+ int16_t good_lqual;
const int *avg100;
init_test(__func__);
lchan = &g_trx->ts[0].lchan[0];
+ lchan->type = GSM_LCHAN_SDCCH;
+ params = lchan->ms_power_ctrl.dpc_params;
+ good_lqual = (params->ci_sdcch_meas.lower_thresh + 2) * 10;
avg100 = &lchan->ms_power_ctrl.rxlev_meas_proc.ewma.Avg100;
struct gsm_power_ctrl_meas_params *mp = &lchan->ms_dpc_params.rxlev_meas;
@@ -175,32 +188,30 @@ static void test_pf_algo_ewma(void)
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 26);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 2);
-#define CHECK_UL_RSSI_AVG100(exp) \
- printf("\tAvg[t] is %2.2f dBm (expected %2.2f dBm)\n", \
+#define CHECK_RXLEV_AVG100(exp) \
+ printf("\tAvg[t] is RxLev %2.2f (expected %2.2f)\n", \
((float) *avg100) / 100, exp);
/* UL RSSI remains constant => no UL power change */
- apply_power_test(lchan, -75, 0, 15);
- CHECK_UL_RSSI_AVG100(-75.00);
+ apply_power_test(lchan, -75, good_lqual, 0, 15);
+ CHECK_RXLEV_AVG100((float)dbm2rxlev(-75)); /* RXLEV 35 */
- /* Avg[t] = (0.2 * -90) + (0.8 * -75) = -78.0 dBm */
- apply_power_test(lchan, -90, 1, 13);
- CHECK_UL_RSSI_AVG100(-78.00);
+ /* Avg[t] = (0.2 * 20) + (0.8 * 35) = RXLEV 32, (-78 dBm) */
+ apply_power_test(lchan, -90, good_lqual, 1, 13); /* -90 dBm = RXLEV 20 */
+ CHECK_RXLEV_AVG100(32.00);
- /* Avg[t] = (0.2 * -90) + (0.8 * -78) = -80.4 dBm */
- apply_power_test(lchan, -90, 1, 11);
- CHECK_UL_RSSI_AVG100(-80.40);
+ /* Avg[t] = (0.2 * 20) + (0.8 * 32) = RXLEV 29.6 (-80.4 dBm) */
+ apply_power_test(lchan, -90, good_lqual, 1, 11); /* -90 dBm = RXLEV 20 */
+ CHECK_RXLEV_AVG100(29.60);
- /* Avg[t] = (0.2 * -70) + (0.8 * -80.4) = -78.32 dBm,
+ /* Avg[t] = (0.2 * 40) + (0.8 * 29.60) = RXLEV 31.68 (-78.32 dBm),
* but due to up-/down-scaling artefacts we get the following:
* Avg100[t] = Avg100[t - 1] + A * (Pwr - Avg[t] / 100)
- * Avg100[t] = -8040 + 20 * (-70 - (-8040 / 100))
- * Avg100[t] = -8040 + 20 * (-70 - (-8040 / 100))
- * Avg100[t] = -8040 + 20 * (-70 + 80)
- * Avg100[t] = -8040 + 200 = -7840
- * Avg[t] = -7840 / 100 = -78.4 */
- apply_power_test(lchan, -70, 1, 9);
- CHECK_UL_RSSI_AVG100(-78.40);
+ * Avg100[t] = 2960 + 20 * (40 - ((2960+50) / 100)) <- HERE we lose 0.1: (2960+50) / 100) = 30.1
+ * Avg100[t] = 2960 + 20 * (40 - 30) <- HERE we lose 20*0.1 = 2.0! (upscaled, hence we lose finally 2.0/100=0.2)
+ * Avg[t] = (3160) / 100 = 31.60*/
+ apply_power_test(lchan, -70, good_lqual, 1, 9); /* RXLEV 40 */
+ CHECK_RXLEV_AVG100(31.60);
mp->ewma.alpha = 70; /* 30% smoothing */
lchan->ms_power_ctrl.current = 15;
@@ -208,25 +219,30 @@ static void test_pf_algo_ewma(void)
(struct gsm_power_ctrl_meas_proc_state) { 0 };
/* This is the first sample, the filter outputs it as-is */
- apply_power_test(lchan, -50, 0, 15);
- CHECK_UL_RSSI_AVG100(-50.00);
+ apply_power_test(lchan, -50, good_lqual, 0, 15); /* RXLEV 60 */
+ CHECK_RXLEV_AVG100((float)dbm2rxlev(-50));
- /* Avg[t] = (0.7 * -50) + (0.3 * -50) = -50.0 dBm */
- apply_power_test(lchan, -50, 0, 15);
- CHECK_UL_RSSI_AVG100(-50.0);
+ /* Avg[t] = (0.7 * 60) + (0.3 * 60) = RXLEV 60 (-50.0 dBm) */
+ apply_power_test(lchan, -50, good_lqual, 0, 15);
+ CHECK_RXLEV_AVG100((float)dbm2rxlev(-50));
/* Simulate SACCH block loss (-110 dBm):
- * Avg[t] = (0.7 * -110) + (0.3 * -50) = -92.0 dBm */
- apply_power_test(lchan, -110, 1, 13);
- CHECK_UL_RSSI_AVG100(-92.0);
+ * Avg[t] = (0.7 * 0) + (0.3 * 60) = RXLEV 18.0 (-92.0 dBm) */
+ apply_power_test(lchan, -110, good_lqual, 1, 13); /* RXLEV 0 */
+ CHECK_RXLEV_AVG100(18.0);
}
static void test_power_hysteresis(void)
{
struct gsm_lchan *lchan;
+ const struct gsm_power_ctrl_params *params;
+ int16_t good_lqual;
init_test(__func__);
lchan = &g_trx->ts[0].lchan[0];
+ lchan->type = GSM_LCHAN_SDCCH;
+ params = lchan->ms_power_ctrl.dpc_params;
+ good_lqual = (params->ci_sdcch_meas.lower_thresh + 2) * 10;
/* Tolerate power deviations in range -80 .. -70 */
lchan->ms_dpc_params.rxlev_meas.lower_thresh = 30;
@@ -237,61 +253,66 @@ static void test_power_hysteresis(void)
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 26);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 2);
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM, 0, 15);
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM + 3, 0, 15);
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM - 3, 0, 15);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM, good_lqual, 0, 15);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM + 3, good_lqual, 0, 15);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM - 3, good_lqual, 0, 15);
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM, 0, 15);
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM + 5, 0, 15);
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM - 5, 0, 15);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM, good_lqual, 0, 15);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM + 5, good_lqual, 0, 15);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM - 5, good_lqual, 0, 15);
- apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM - 10, 1, 13);
+ apply_power_test(lchan, PWR_TEST_RXLEV_TARGET_DBM - 10, good_lqual, 1, 13);
}
static void test_power_ctrl_interval(void)
{
struct gsm_lchan *lchan;
+ const struct gsm_power_ctrl_params *params;
+ int16_t good_lqual;
unsigned int i, j;
init_test(__func__);
lchan = &g_trx->ts[0].lchan[0];
+ lchan->type = GSM_LCHAN_SDCCH;
+ params = lchan->ms_power_ctrl.dpc_params;
+ good_lqual = (params->ci_sdcch_meas.lower_thresh + 2) * 10;
lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 26);
OSMO_ASSERT(lchan->ms_power_ctrl.max == 2);
- static const int script[][8][3] = {
+ const int script[][8][4] = {
{ /* P_Con_INTERVAL=0 (480 ms) */
/* { UL RxLev, expected rc, expected Tx power level } */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 13 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 11 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 9 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 7 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 5 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 3 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 2 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 2 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 13 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 11 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 9 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 7 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 5 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 3 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 2 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 2 },
},
{ /* P_Con_INTERVAL=1 (960 ms) */
/* { UL RxLev, expected rc, expected Tx power level } */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 13 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 13 }, /* skipped */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 11 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 11 }, /* skipped */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 9 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 9 }, /* skipped */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 7 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 7 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 13 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 13 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 11 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 11 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 9 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 9 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 7 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 7 }, /* skipped */
},
{ /* P_Con_INTERVAL=2 (1920 ms) */
/* { UL RxLev, expected rc, expected Tx power level } */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 13 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 13 }, /* skipped */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 13 }, /* skipped */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 13 }, /* skipped */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 1, 11 },
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 11 }, /* skipped */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 11 }, /* skipped */
- { PWR_TEST_RXLEV_TARGET_DBM - 15, 0, 11 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 13 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 13 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 13 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 13 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 1, 11 },
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 11 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 11 }, /* skipped */
+ { PWR_TEST_RXLEV_TARGET_DBM - 15, good_lqual, 0, 11 }, /* skipped */
},
};
@@ -305,14 +326,54 @@ static void test_power_ctrl_interval(void)
for (j = 0; j < ARRAY_SIZE(script[i]); j++) {
apply_power_test(lchan, script[i][j][0], /* UL RxLev */
- script[i][j][1], /* expected rc */
- script[i][j][2]); /* expected Tx power level */
+ script[i][j][1], /* UL C/I */
+ script[i][j][2], /* expected rc */
+ script[i][j][3]); /* expected Tx power level */
}
printf("\n");
}
}
+static void test_power_loop_ci(void)
+{
+ struct gsm_lchan *lchan;
+ const struct gsm_power_ctrl_params *params;
+ int16_t good_lqual, too_low_lqual, too_high_lqual;
+
+ init_test(__func__);
+ lchan = &g_trx->ts[0].lchan[0];
+ params = lchan->ms_power_ctrl.dpc_params;
+ lchan->type = GSM_LCHAN_SDCCH;
+ good_lqual = (params->ci_sdcch_meas.lower_thresh + 2) * 10;
+ too_low_lqual = (params->ci_sdcch_meas.lower_thresh - 1) * 10;
+ too_high_lqual = (params->ci_sdcch_meas.upper_thresh + 1) * 10;
+
+ lchan->ms_power_ctrl.current = ms_pwr_ctl_lvl(GSM_BAND_1800, 0);
+ OSMO_ASSERT(lchan->ms_power_ctrl.current == 15);
+ lchan->ms_power_ctrl.max = ms_pwr_ctl_lvl(GSM_BAND_1800, 26);
+ OSMO_ASSERT(lchan->ms_power_ctrl.max == 2);
+
+ /* Simply clamping */
+ apply_power_test(lchan, -60, good_lqual, 0, 15);
+
+ /* Now UL C/I is too bad as well as RSSI: */
+ apply_power_test(lchan, -100, too_low_lqual, 1, 13);
+ apply_power_test(lchan, -100, too_low_lqual, 1, 11);
+
+ /* Now UL C/I is good again while RSSI is good: */
+ apply_power_test(lchan, -60, good_lqual, 1, 12);
+ apply_power_test(lchan, -60, too_high_lqual, 1, 13);
+
+ /* Now UL C/I is good while RSSI is bad, C/I mandates: */
+ apply_power_test(lchan, -100, good_lqual, 1, 11);
+ apply_power_test(lchan, -100, too_high_lqual, 1, 12);
+
+ /* Now UL C/I is bad again while RSSI is good, C/I mandates: */
+ apply_power_test(lchan, -60, good_lqual, 1, 13);
+ apply_power_test(lchan, -60, too_high_lqual, 1, 14);
+}
+
int main(int argc, char **argv)
{
printf("Testing power loop...\n");
@@ -332,6 +393,7 @@ int main(int argc, char **argv)
test_pf_algo_ewma();
test_power_hysteresis();
test_power_ctrl_interval();
+ test_power_loop_ci();
printf("Power loop test OK\n");
diff --git a/tests/power/ms_power_loop_test.err b/tests/power/ms_power_loop_test.err
index ae8ad033..8f588821 100644
--- a/tests/power/ms_power_loop_test.err
+++ b/tests/power/ms_power_loop_test.err
@@ -1,51 +1,60 @@
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -60 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 15 (0 dBm) to 13, 4 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 13 (4 dBm) to 11, 8 dBm (rx-ms-pwr-lvl 13, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 11 (8 dBm) to 9, 12 dBm (rx-ms-pwr-lvl 11, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 9 (12 dBm) to 7, 16 dBm (rx-ms-pwr-lvl 9, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 7 (16 dBm) to 5, 20 dBm (rx-ms-pwr-lvl 7, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 5, 20 dBm (rx-ms-pwr-lvl 5, max-ms-pwr-lvl 2, rx-current -75 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 5 (20 dBm) to 3, 24 dBm (rx-ms-pwr-lvl 5, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 3 (24 dBm) to 2, 26 dBm (rx-ms-pwr-lvl 3, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 2, 26 dBm (rx-ms-pwr-lvl 2, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 2 (26 dBm) to 0, 30 dBm (rx-ms-pwr-lvl 2, max-ms-pwr-lvl 0, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 0, 30 dBm (rx-ms-pwr-lvl 0, max-ms-pwr-lvl 0, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 0 (30 dBm) to 30, 34 dBm (rx-ms-pwr-lvl 0, max-ms-pwr-lvl 29, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 30 (34 dBm) to 29, 36 dBm (rx-ms-pwr-lvl 30, max-ms-pwr-lvl 29, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 29, 36 dBm (rx-ms-pwr-lvl 29, max-ms-pwr-lvl 29, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 29, 36 dBm (rx-ms-pwr-lvl 29, max-ms-pwr-lvl 29, rx-current -75 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Lowering MS power from control level 29 (36 dBm) to 30, 34 dBm (rx-ms-pwr-lvl 29, max-ms-pwr-lvl 29, rx-current -45 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Lowering MS power from control level 30 (34 dBm) to 31, 32 dBm (rx-ms-pwr-lvl 30, max-ms-pwr-lvl 29, rx-current -45 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Lowering MS power from control level 31 (32 dBm) to 0, 30 dBm (rx-ms-pwr-lvl 31, max-ms-pwr-lvl 29, rx-current -45 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Lowering MS power from control level 0 (30 dBm) to 1, 28 dBm (rx-ms-pwr-lvl 0, max-ms-pwr-lvl 29, rx-current -73 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 1 (28 dBm) to 0, 30 dBm (rx-ms-pwr-lvl 1, max-ms-pwr-lvl 29, rx-current -77 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Lowering MS power from control level 0 (30 dBm) to 14, 2 dBm (rx-ms-pwr-lvl 0, max-ms-pwr-lvl 14, rx-current -73 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Lowering MS power from control level 14 (2 dBm) to 15, 0 dBm (rx-ms-pwr-lvl 14, max-ms-pwr-lvl 0, rx-current -40 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -75 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 15 (0 dBm) to 13, 3 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 13 (4 dBm) to 11, 8 dBm (rx-ms-pwr-lvl 13, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 11 (8 dBm) to 9, 11 dBm (rx-ms-pwr-lvl 11, max-ms-pwr-lvl 2, rx-current -70 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -50 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -50 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 15 (0 dBm) to 13, 4 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -110 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -75 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -72 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -78 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -75 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -70 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15, 0 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -80 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 15 (0 dBm) to 13, 4 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -85 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 15 (0 dBm) to 13, 4 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 13 (4 dBm) to 11, 8 dBm (rx-ms-pwr-lvl 13, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 11 (8 dBm) to 9, 12 dBm (rx-ms-pwr-lvl 11, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 9 (12 dBm) to 7, 16 dBm (rx-ms-pwr-lvl 9, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 7 (16 dBm) to 5, 20 dBm (rx-ms-pwr-lvl 7, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 5 (20 dBm) to 3, 24 dBm (rx-ms-pwr-lvl 5, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 3 (24 dBm) to 2, 26 dBm (rx-ms-pwr-lvl 3, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 2, 26 dBm (rx-ms-pwr-lvl 2, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 15 (0 dBm) to 13, 4 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 13 (4 dBm) to 11, 8 dBm (rx-ms-pwr-lvl 13, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 11 (8 dBm) to 9, 12 dBm (rx-ms-pwr-lvl 11, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 9 (12 dBm) to 7, 16 dBm (rx-ms-pwr-lvl 9, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 15 (0 dBm) to 13, 4 dBm (rx-ms-pwr-lvl 15, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
-(bts=0,trx=0,ts=0,ss=0) Raising MS power from control level 13 (4 dBm) to 11, 8 dBm (rx-ms-pwr-lvl 13, max-ms-pwr-lvl 2, rx-current -90 dBm, rx-target -75 dBm)
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -60, avg -60, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 15 (0 dBm) => 13 (4 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 13 (4 dBm) => 11 (8 dBm): ms-pwr-lvl[curr 13, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 11 (8 dBm) => 9 (12 dBm): ms-pwr-lvl[curr 11, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 9 (12 dBm) => 7 (16 dBm): ms-pwr-lvl[curr 9, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 7 (16 dBm) => 5 (20 dBm): ms-pwr-lvl[curr 7, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 5 (20 dBm): ms-pwr-lvl[curr 5, max 2], RSSI[curr -75, avg -75, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 5 (20 dBm) => 3 (24 dBm): ms-pwr-lvl[curr 5, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 3 (24 dBm) => 2 (26 dBm): ms-pwr-lvl[curr 3, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 2 (26 dBm): ms-pwr-lvl[curr 2, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 2 (26 dBm) => 0 (30 dBm): ms-pwr-lvl[curr 2, max 0], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 0 (30 dBm): ms-pwr-lvl[curr 0, max 0], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 0 (30 dBm) => 30 (34 dBm): ms-pwr-lvl[curr 0, max 29], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 30 (34 dBm) => 29 (36 dBm): ms-pwr-lvl[curr 30, max 29], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 29 (36 dBm): ms-pwr-lvl[curr 29, max 29], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 29 (36 dBm): ms-pwr-lvl[curr 29, max 29], RSSI[curr -75, avg -75, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 29 (36 dBm) => 30 (34 dBm): ms-pwr-lvl[curr 29, max 29], RSSI[curr -45, avg -47, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 30 (34 dBm) => 31 (32 dBm): ms-pwr-lvl[curr 30, max 29], RSSI[curr -45, avg -47, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 31 (32 dBm) => 0 (30 dBm): ms-pwr-lvl[curr 31, max 29], RSSI[curr -45, avg -47, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 0 (30 dBm) => 1 (28 dBm): ms-pwr-lvl[curr 0, max 29], RSSI[curr -73, avg -73, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 1 (28 dBm) => 0 (30 dBm): ms-pwr-lvl[curr 1, max 29], RSSI[curr -77, avg -77, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 0 (30 dBm) => 14 (2 dBm): ms-pwr-lvl[curr 0, max 14], RSSI[curr -73, avg -73, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 14 (2 dBm) => 15 (0 dBm): ms-pwr-lvl[curr 14, max 0], RSSI[curr -40, avg -47, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -75, avg -75, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 15 (0 dBm) => 13 (3 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -90, avg -78, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 13 (4 dBm) => 11 (8 dBm): ms-pwr-lvl[curr 13, max 2], RSSI[curr -90, avg -80, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 11 (8 dBm) => 9 (11 dBm): ms-pwr-lvl[curr 11, max 2], RSSI[curr -70, avg -78, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -50, avg -50, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -50, avg -50, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 15 (0 dBm) => 13 (4 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -110, avg -92, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -75, avg -75, thresh -80..-70] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -72, avg -72, thresh -80..-70] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -78, avg -78, thresh -80..-70] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -75, avg -75, thresh -80..-70] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -70, avg -70, thresh -80..-70] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -80, avg -80, thresh -80..-70] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 15 (0 dBm) => 13 (4 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -85, avg -85, thresh -80..-70] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 15 (0 dBm) => 13 (4 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 13 (4 dBm) => 11 (8 dBm): ms-pwr-lvl[curr 13, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 11 (8 dBm) => 9 (12 dBm): ms-pwr-lvl[curr 11, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 9 (12 dBm) => 7 (16 dBm): ms-pwr-lvl[curr 9, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 7 (16 dBm) => 5 (20 dBm): ms-pwr-lvl[curr 7, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 5 (20 dBm) => 3 (24 dBm): ms-pwr-lvl[curr 5, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 3 (24 dBm) => 2 (26 dBm): ms-pwr-lvl[curr 3, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 2 (26 dBm): ms-pwr-lvl[curr 2, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 15 (0 dBm) => 13 (4 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 13 (4 dBm) => 11 (8 dBm): ms-pwr-lvl[curr 13, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 11 (8 dBm) => 9 (12 dBm): ms-pwr-lvl[curr 11, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 9 (12 dBm) => 7 (16 dBm): ms-pwr-lvl[curr 9, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 15 (0 dBm) => 13 (4 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 13 (4 dBm) => 11 (8 dBm): ms-pwr-lvl[curr 13, max 2], RSSI[curr -90, avg -90, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Keeping MS power at control level 15 (0 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -60, avg -60, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 15 (0 dBm) => 13 (4 dBm): ms-pwr-lvl[curr 15, max 2], RSSI[curr -100, avg -100, thresh -75..-75] dBm, C/I[curr 11, avg 11, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 13 (4 dBm) => 11 (8 dBm): ms-pwr-lvl[curr 13, max 2], RSSI[curr -100, avg -100, thresh -75..-75] dBm, C/I[curr 11, avg 11, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 11 (8 dBm) => 12 (6 dBm): ms-pwr-lvl[curr 11, max 2], RSSI[curr -60, avg -60, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 12 (6 dBm) => 13 (4 dBm): ms-pwr-lvl[curr 12, max 2], RSSI[curr -60, avg -60, thresh -75..-75] dBm, C/I[curr 17, avg 17, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Raising MS power control level 13 (4 dBm) => 11 (8 dBm): ms-pwr-lvl[curr 13, max 2], RSSI[curr -100, avg -100, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 11 (8 dBm) => 12 (6 dBm): ms-pwr-lvl[curr 11, max 2], RSSI[curr -100, avg -100, thresh -75..-75] dBm, C/I[curr 17, avg 17, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 12 (6 dBm) => 13 (4 dBm): ms-pwr-lvl[curr 12, max 2], RSSI[curr -60, avg -60, thresh -75..-75] dBm, C/I[curr 14, avg 14, thresh 12..16] dB
+(bts=0,trx=0,ts=0,ss=0) Lowering MS power control level 13 (4 dBm) => 14 (2 dBm): ms-pwr-lvl[curr 13, max 2], RSSI[curr -60, avg -60, thresh -75..-75] dBm, C/I[curr 17, avg 17, thresh 12..16] dB
diff --git a/tests/power/ms_power_loop_test.ok b/tests/power/ms_power_loop_test.ok
index 5fea4747..27992b14 100644
--- a/tests/power/ms_power_loop_test.ok
+++ b/tests/power/ms_power_loop_test.ok
@@ -53,25 +53,25 @@ lchan_ms_pwr_ctrl(RxLvl=-40 dBm) returns 1 (expected 1)
Starting test case 'test_pf_algo_ewma'
lchan_ms_pwr_ctrl(RxLvl=-75 dBm) returns 0 (expected 0)
MS current power 15 -> 15 (expected 15)
- Avg[t] is -75.00 dBm (expected -75.00 dBm)
+ Avg[t] is RxLev 35.00 (expected 35.00)
lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
MS current power 15 -> 13 (expected 13)
- Avg[t] is -78.00 dBm (expected -78.00 dBm)
+ Avg[t] is RxLev 32.00 (expected 32.00)
lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 1 (expected 1)
MS current power 13 -> 11 (expected 11)
- Avg[t] is -80.40 dBm (expected -80.40 dBm)
+ Avg[t] is RxLev 29.60 (expected 29.60)
lchan_ms_pwr_ctrl(RxLvl=-70 dBm) returns 1 (expected 1)
MS current power 11 -> 9 (expected 9)
- Avg[t] is -78.40 dBm (expected -78.40 dBm)
+ Avg[t] is RxLev 31.60 (expected 31.60)
lchan_ms_pwr_ctrl(RxLvl=-50 dBm) returns 0 (expected 0)
MS current power 15 -> 15 (expected 15)
- Avg[t] is -50.00 dBm (expected -50.00 dBm)
+ Avg[t] is RxLev 60.00 (expected 60.00)
lchan_ms_pwr_ctrl(RxLvl=-50 dBm) returns 0 (expected 0)
MS current power 15 -> 15 (expected 15)
- Avg[t] is -50.00 dBm (expected -50.00 dBm)
+ Avg[t] is RxLev 60.00 (expected 60.00)
lchan_ms_pwr_ctrl(RxLvl=-110 dBm) returns 1 (expected 1)
MS current power 15 -> 13 (expected 13)
- Avg[t] is -92.00 dBm (expected -92.00 dBm)
+ Avg[t] is RxLev 18.00 (expected 18.00)
Starting test case 'test_power_hysteresis'
lchan_ms_pwr_ctrl(RxLvl=-75 dBm) returns 0 (expected 0)
@@ -144,4 +144,24 @@ lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 0 (expected 0)
lchan_ms_pwr_ctrl(RxLvl=-90 dBm) returns 0 (expected 0)
MS current power 11 -> 11 (expected 11)
+
+Starting test case 'test_power_loop_ci'
+lchan_ms_pwr_ctrl(RxLvl=-60 dBm) returns 0 (expected 0)
+ MS current power 15 -> 15 (expected 15)
+lchan_ms_pwr_ctrl(RxLvl=-100 dBm) returns 1 (expected 1)
+ MS current power 15 -> 13 (expected 13)
+lchan_ms_pwr_ctrl(RxLvl=-100 dBm) returns 1 (expected 1)
+ MS current power 13 -> 11 (expected 11)
+lchan_ms_pwr_ctrl(RxLvl=-60 dBm) returns 1 (expected 1)
+ MS current power 11 -> 12 (expected 12)
+lchan_ms_pwr_ctrl(RxLvl=-60 dBm) returns 1 (expected 1)
+ MS current power 12 -> 13 (expected 13)
+lchan_ms_pwr_ctrl(RxLvl=-100 dBm) returns 1 (expected 1)
+ MS current power 13 -> 11 (expected 11)
+lchan_ms_pwr_ctrl(RxLvl=-100 dBm) returns 1 (expected 1)
+ MS current power 11 -> 12 (expected 12)
+lchan_ms_pwr_ctrl(RxLvl=-60 dBm) returns 1 (expected 1)
+ MS current power 12 -> 13 (expected 13)
+lchan_ms_pwr_ctrl(RxLvl=-60 dBm) returns 1 (expected 1)
+ MS current power 13 -> 14 (expected 14)
Power loop test OK
diff --git a/tests/ta_control/ta_control_test.c b/tests/ta_control/ta_control_test.c
index 2e981b38..253491a8 100644
--- a/tests/ta_control/ta_control_test.c
+++ b/tests/ta_control/ta_control_test.c
@@ -26,36 +26,35 @@
#include <osmo-bts/logging.h>
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/ta_control.h>
+#include <osmo-bts/bts_trx.h>
void lchan_ms_ta_ctrl_test(int16_t toa256_start, unsigned int steps)
{
- struct gsm_lchan lchan = { };
+ struct gsm_bts_trx trx = { };
+ struct gsm_bts_trx_ts ts = { .trx = &trx };
+ struct gsm_lchan lchan = { .ts = &ts };
unsigned int i;
uint8_t rqd_ta_after;
uint8_t rqd_ta_before;
int16_t toa256 = toa256_start;
- /* Arbitrary value, high enough so that a computation can happen. */
- lchan.meas.num_ul_meas = 10;
-
printf("toa256_start = %u / 256 = %u, steps = %u\n", toa256_start,
toa256_start / 256, steps);
for (i = 0; i < steps; i++) {
printf("Step #%u\n", i);
- printf(" lchan.rqd_ta (before) = %u\n", lchan.rqd_ta);
+ printf(" lchan.ta_ctrl.current (before) = %u\n", lchan.ta_ctrl.current);
printf(" toa256 (before) = %u / 256 = %u\n", toa256,
toa256 / 256);
- rqd_ta_before = lchan.rqd_ta;
+ rqd_ta_before = lchan.ta_ctrl.current;
- lchan.meas.ms_toa256 = toa256;
- lchan_ms_ta_ctrl(&lchan);
+ lchan_ms_ta_ctrl(&lchan, rqd_ta_before, toa256);
- rqd_ta_after = lchan.rqd_ta;
+ rqd_ta_after = lchan.ta_ctrl.current;
toa256 -= (rqd_ta_after - rqd_ta_before) * 256;
- printf(" lchan.rqd_ta (after) = %u\n", lchan.rqd_ta);
+ printf(" lchan.ta_ctrl.current (after) = %u\n", lchan.ta_ctrl.current);
printf(" toa256 (after) = %u / 256 = %u\n", toa256,
toa256 / 256);
}
diff --git a/tests/ta_control/ta_control_test.ok b/tests/ta_control/ta_control_test.ok
index 8ebe5d54..a1586759 100644
--- a/tests/ta_control/ta_control_test.ok
+++ b/tests/ta_control/ta_control_test.ok
@@ -1,609 +1,609 @@
toa256_start = 4096 / 256 = 16, steps = 20
Step #0
- lchan.rqd_ta (before) = 0
+ lchan.ta_ctrl.current (before) = 0
toa256 (before) = 4096 / 256 = 16
- lchan.rqd_ta (after) = 1
- toa256 (after) = 3840 / 256 = 15
-Step #1
- lchan.rqd_ta (before) = 1
- toa256 (before) = 3840 / 256 = 15
- lchan.rqd_ta (after) = 2
+ lchan.ta_ctrl.current (after) = 2
toa256 (after) = 3584 / 256 = 14
-Step #2
- lchan.rqd_ta (before) = 2
+Step #1
+ lchan.ta_ctrl.current (before) = 2
toa256 (before) = 3584 / 256 = 14
- lchan.rqd_ta (after) = 3
- toa256 (after) = 3328 / 256 = 13
-Step #3
- lchan.rqd_ta (before) = 3
- toa256 (before) = 3328 / 256 = 13
- lchan.rqd_ta (after) = 4
+ lchan.ta_ctrl.current (after) = 4
toa256 (after) = 3072 / 256 = 12
-Step #4
- lchan.rqd_ta (before) = 4
+Step #2
+ lchan.ta_ctrl.current (before) = 4
toa256 (before) = 3072 / 256 = 12
- lchan.rqd_ta (after) = 5
- toa256 (after) = 2816 / 256 = 11
-Step #5
- lchan.rqd_ta (before) = 5
- toa256 (before) = 2816 / 256 = 11
- lchan.rqd_ta (after) = 6
+ lchan.ta_ctrl.current (after) = 6
toa256 (after) = 2560 / 256 = 10
-Step #6
- lchan.rqd_ta (before) = 6
+Step #3
+ lchan.ta_ctrl.current (before) = 6
toa256 (before) = 2560 / 256 = 10
- lchan.rqd_ta (after) = 7
- toa256 (after) = 2304 / 256 = 9
-Step #7
- lchan.rqd_ta (before) = 7
- toa256 (before) = 2304 / 256 = 9
- lchan.rqd_ta (after) = 8
+ lchan.ta_ctrl.current (after) = 8
toa256 (after) = 2048 / 256 = 8
-Step #8
- lchan.rqd_ta (before) = 8
+Step #4
+ lchan.ta_ctrl.current (before) = 8
toa256 (before) = 2048 / 256 = 8
- lchan.rqd_ta (after) = 9
- toa256 (after) = 1792 / 256 = 7
-Step #9
- lchan.rqd_ta (before) = 9
- toa256 (before) = 1792 / 256 = 7
- lchan.rqd_ta (after) = 10
+ lchan.ta_ctrl.current (after) = 10
toa256 (after) = 1536 / 256 = 6
-Step #10
- lchan.rqd_ta (before) = 10
+Step #5
+ lchan.ta_ctrl.current (before) = 10
toa256 (before) = 1536 / 256 = 6
- lchan.rqd_ta (after) = 11
- toa256 (after) = 1280 / 256 = 5
-Step #11
- lchan.rqd_ta (before) = 11
- toa256 (before) = 1280 / 256 = 5
- lchan.rqd_ta (after) = 12
+ lchan.ta_ctrl.current (after) = 12
toa256 (after) = 1024 / 256 = 4
-Step #12
- lchan.rqd_ta (before) = 12
+Step #6
+ lchan.ta_ctrl.current (before) = 12
toa256 (before) = 1024 / 256 = 4
- lchan.rqd_ta (after) = 13
- toa256 (after) = 768 / 256 = 3
-Step #13
- lchan.rqd_ta (before) = 13
- toa256 (before) = 768 / 256 = 3
- lchan.rqd_ta (after) = 14
+ lchan.ta_ctrl.current (after) = 14
toa256 (after) = 512 / 256 = 2
-Step #14
- lchan.rqd_ta (before) = 14
+Step #7
+ lchan.ta_ctrl.current (before) = 14
toa256 (before) = 512 / 256 = 2
- lchan.rqd_ta (after) = 15
- toa256 (after) = 256 / 256 = 1
+ lchan.ta_ctrl.current (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #8
+ lchan.ta_ctrl.current (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.ta_ctrl.current (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #9
+ lchan.ta_ctrl.current (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.ta_ctrl.current (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #10
+ lchan.ta_ctrl.current (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.ta_ctrl.current (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #11
+ lchan.ta_ctrl.current (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.ta_ctrl.current (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #12
+ lchan.ta_ctrl.current (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.ta_ctrl.current (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #13
+ lchan.ta_ctrl.current (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.ta_ctrl.current (after) = 16
+ toa256 (after) = 0 / 256 = 0
+Step #14
+ lchan.ta_ctrl.current (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.ta_ctrl.current (after) = 16
+ toa256 (after) = 0 / 256 = 0
Step #15
- lchan.rqd_ta (before) = 15
- toa256 (before) = 256 / 256 = 1
- lchan.rqd_ta (after) = 16
+ lchan.ta_ctrl.current (before) = 16
+ toa256 (before) = 0 / 256 = 0
+ lchan.ta_ctrl.current (after) = 16
toa256 (after) = 0 / 256 = 0
Step #16
- lchan.rqd_ta (before) = 16
+ lchan.ta_ctrl.current (before) = 16
toa256 (before) = 0 / 256 = 0
- lchan.rqd_ta (after) = 16
+ lchan.ta_ctrl.current (after) = 16
toa256 (after) = 0 / 256 = 0
Step #17
- lchan.rqd_ta (before) = 16
+ lchan.ta_ctrl.current (before) = 16
toa256 (before) = 0 / 256 = 0
- lchan.rqd_ta (after) = 16
+ lchan.ta_ctrl.current (after) = 16
toa256 (after) = 0 / 256 = 0
Step #18
- lchan.rqd_ta (before) = 16
+ lchan.ta_ctrl.current (before) = 16
toa256 (before) = 0 / 256 = 0
- lchan.rqd_ta (after) = 16
+ lchan.ta_ctrl.current (after) = 16
toa256 (after) = 0 / 256 = 0
Step #19
- lchan.rqd_ta (before) = 16
+ lchan.ta_ctrl.current (before) = 16
toa256 (before) = 0 / 256 = 0
- lchan.rqd_ta (after) = 16
+ lchan.ta_ctrl.current (after) = 16
toa256 (after) = 0 / 256 = 0
Done.
toa256_start = 4000 / 256 = 15, steps = 50
Step #0
- lchan.rqd_ta (before) = 0
+ lchan.ta_ctrl.current (before) = 0
toa256 (before) = 4000 / 256 = 15
- lchan.rqd_ta (after) = 1
- toa256 (after) = 3744 / 256 = 14
-Step #1
- lchan.rqd_ta (before) = 1
- toa256 (before) = 3744 / 256 = 14
- lchan.rqd_ta (after) = 2
+ lchan.ta_ctrl.current (after) = 2
toa256 (after) = 3488 / 256 = 13
-Step #2
- lchan.rqd_ta (before) = 2
+Step #1
+ lchan.ta_ctrl.current (before) = 2
toa256 (before) = 3488 / 256 = 13
- lchan.rqd_ta (after) = 3
- toa256 (after) = 3232 / 256 = 12
-Step #3
- lchan.rqd_ta (before) = 3
- toa256 (before) = 3232 / 256 = 12
- lchan.rqd_ta (after) = 4
+ lchan.ta_ctrl.current (after) = 4
toa256 (after) = 2976 / 256 = 11
-Step #4
- lchan.rqd_ta (before) = 4
+Step #2
+ lchan.ta_ctrl.current (before) = 4
toa256 (before) = 2976 / 256 = 11
- lchan.rqd_ta (after) = 5
- toa256 (after) = 2720 / 256 = 10
-Step #5
- lchan.rqd_ta (before) = 5
- toa256 (before) = 2720 / 256 = 10
- lchan.rqd_ta (after) = 6
+ lchan.ta_ctrl.current (after) = 6
toa256 (after) = 2464 / 256 = 9
-Step #6
- lchan.rqd_ta (before) = 6
+Step #3
+ lchan.ta_ctrl.current (before) = 6
toa256 (before) = 2464 / 256 = 9
- lchan.rqd_ta (after) = 7
- toa256 (after) = 2208 / 256 = 8
-Step #7
- lchan.rqd_ta (before) = 7
- toa256 (before) = 2208 / 256 = 8
- lchan.rqd_ta (after) = 8
+ lchan.ta_ctrl.current (after) = 8
toa256 (after) = 1952 / 256 = 7
-Step #8
- lchan.rqd_ta (before) = 8
+Step #4
+ lchan.ta_ctrl.current (before) = 8
toa256 (before) = 1952 / 256 = 7
- lchan.rqd_ta (after) = 9
- toa256 (after) = 1696 / 256 = 6
-Step #9
- lchan.rqd_ta (before) = 9
- toa256 (before) = 1696 / 256 = 6
- lchan.rqd_ta (after) = 10
+ lchan.ta_ctrl.current (after) = 10
toa256 (after) = 1440 / 256 = 5
-Step #10
- lchan.rqd_ta (before) = 10
+Step #5
+ lchan.ta_ctrl.current (before) = 10
toa256 (before) = 1440 / 256 = 5
- lchan.rqd_ta (after) = 11
- toa256 (after) = 1184 / 256 = 4
-Step #11
- lchan.rqd_ta (before) = 11
- toa256 (before) = 1184 / 256 = 4
- lchan.rqd_ta (after) = 12
+ lchan.ta_ctrl.current (after) = 12
toa256 (after) = 928 / 256 = 3
-Step #12
- lchan.rqd_ta (before) = 12
+Step #6
+ lchan.ta_ctrl.current (before) = 12
toa256 (before) = 928 / 256 = 3
- lchan.rqd_ta (after) = 13
- toa256 (after) = 672 / 256 = 2
-Step #13
- lchan.rqd_ta (before) = 13
- toa256 (before) = 672 / 256 = 2
- lchan.rqd_ta (after) = 14
+ lchan.ta_ctrl.current (after) = 14
toa256 (after) = 416 / 256 = 1
-Step #14
- lchan.rqd_ta (before) = 14
+Step #7
+ lchan.ta_ctrl.current (before) = 14
toa256 (before) = 416 / 256 = 1
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #8
+ lchan.ta_ctrl.current (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.ta_ctrl.current (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #9
+ lchan.ta_ctrl.current (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.ta_ctrl.current (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #10
+ lchan.ta_ctrl.current (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.ta_ctrl.current (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #11
+ lchan.ta_ctrl.current (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.ta_ctrl.current (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #12
+ lchan.ta_ctrl.current (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.ta_ctrl.current (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #13
+ lchan.ta_ctrl.current (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.ta_ctrl.current (after) = 15
+ toa256 (after) = 160 / 256 = 0
+Step #14
+ lchan.ta_ctrl.current (before) = 15
+ toa256 (before) = 160 / 256 = 0
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #15
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #16
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #17
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #18
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #19
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #20
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #21
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #22
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #23
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #24
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #25
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #26
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #27
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #28
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #29
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #30
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #31
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #32
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #33
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #34
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #35
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #36
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #37
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #38
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #39
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #40
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #41
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #42
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #43
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #44
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #45
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #46
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #47
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #48
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Step #49
- lchan.rqd_ta (before) = 15
+ lchan.ta_ctrl.current (before) = 15
toa256 (before) = 160 / 256 = 0
- lchan.rqd_ta (after) = 15
+ lchan.ta_ctrl.current (after) = 15
toa256 (after) = 160 / 256 = 0
Done.
toa256_start = 12345 / 256 = 48, steps = 50
Step #0
- lchan.rqd_ta (before) = 0
+ lchan.ta_ctrl.current (before) = 0
toa256 (before) = 12345 / 256 = 48
- lchan.rqd_ta (after) = 1
- toa256 (after) = 12089 / 256 = 47
-Step #1
- lchan.rqd_ta (before) = 1
- toa256 (before) = 12089 / 256 = 47
- lchan.rqd_ta (after) = 2
+ lchan.ta_ctrl.current (after) = 2
toa256 (after) = 11833 / 256 = 46
-Step #2
- lchan.rqd_ta (before) = 2
+Step #1
+ lchan.ta_ctrl.current (before) = 2
toa256 (before) = 11833 / 256 = 46
- lchan.rqd_ta (after) = 3
- toa256 (after) = 11577 / 256 = 45
-Step #3
- lchan.rqd_ta (before) = 3
- toa256 (before) = 11577 / 256 = 45
- lchan.rqd_ta (after) = 4
+ lchan.ta_ctrl.current (after) = 4
toa256 (after) = 11321 / 256 = 44
-Step #4
- lchan.rqd_ta (before) = 4
+Step #2
+ lchan.ta_ctrl.current (before) = 4
toa256 (before) = 11321 / 256 = 44
- lchan.rqd_ta (after) = 5
- toa256 (after) = 11065 / 256 = 43
-Step #5
- lchan.rqd_ta (before) = 5
- toa256 (before) = 11065 / 256 = 43
- lchan.rqd_ta (after) = 6
+ lchan.ta_ctrl.current (after) = 6
toa256 (after) = 10809 / 256 = 42
-Step #6
- lchan.rqd_ta (before) = 6
+Step #3
+ lchan.ta_ctrl.current (before) = 6
toa256 (before) = 10809 / 256 = 42
- lchan.rqd_ta (after) = 7
- toa256 (after) = 10553 / 256 = 41
-Step #7
- lchan.rqd_ta (before) = 7
- toa256 (before) = 10553 / 256 = 41
- lchan.rqd_ta (after) = 8
+ lchan.ta_ctrl.current (after) = 8
toa256 (after) = 10297 / 256 = 40
-Step #8
- lchan.rqd_ta (before) = 8
+Step #4
+ lchan.ta_ctrl.current (before) = 8
toa256 (before) = 10297 / 256 = 40
- lchan.rqd_ta (after) = 9
- toa256 (after) = 10041 / 256 = 39
-Step #9
- lchan.rqd_ta (before) = 9
- toa256 (before) = 10041 / 256 = 39
- lchan.rqd_ta (after) = 10
+ lchan.ta_ctrl.current (after) = 10
toa256 (after) = 9785 / 256 = 38
-Step #10
- lchan.rqd_ta (before) = 10
+Step #5
+ lchan.ta_ctrl.current (before) = 10
toa256 (before) = 9785 / 256 = 38
- lchan.rqd_ta (after) = 11
- toa256 (after) = 9529 / 256 = 37
-Step #11
- lchan.rqd_ta (before) = 11
- toa256 (before) = 9529 / 256 = 37
- lchan.rqd_ta (after) = 12
+ lchan.ta_ctrl.current (after) = 12
toa256 (after) = 9273 / 256 = 36
-Step #12
- lchan.rqd_ta (before) = 12
+Step #6
+ lchan.ta_ctrl.current (before) = 12
toa256 (before) = 9273 / 256 = 36
- lchan.rqd_ta (after) = 13
- toa256 (after) = 9017 / 256 = 35
-Step #13
- lchan.rqd_ta (before) = 13
- toa256 (before) = 9017 / 256 = 35
- lchan.rqd_ta (after) = 14
+ lchan.ta_ctrl.current (after) = 14
toa256 (after) = 8761 / 256 = 34
-Step #14
- lchan.rqd_ta (before) = 14
+Step #7
+ lchan.ta_ctrl.current (before) = 14
toa256 (before) = 8761 / 256 = 34
- lchan.rqd_ta (after) = 15
- toa256 (after) = 8505 / 256 = 33
-Step #15
- lchan.rqd_ta (before) = 15
- toa256 (before) = 8505 / 256 = 33
- lchan.rqd_ta (after) = 16
+ lchan.ta_ctrl.current (after) = 16
toa256 (after) = 8249 / 256 = 32
-Step #16
- lchan.rqd_ta (before) = 16
+Step #8
+ lchan.ta_ctrl.current (before) = 16
toa256 (before) = 8249 / 256 = 32
- lchan.rqd_ta (after) = 17
- toa256 (after) = 7993 / 256 = 31
-Step #17
- lchan.rqd_ta (before) = 17
- toa256 (before) = 7993 / 256 = 31
- lchan.rqd_ta (after) = 18
+ lchan.ta_ctrl.current (after) = 18
toa256 (after) = 7737 / 256 = 30
-Step #18
- lchan.rqd_ta (before) = 18
+Step #9
+ lchan.ta_ctrl.current (before) = 18
toa256 (before) = 7737 / 256 = 30
- lchan.rqd_ta (after) = 19
- toa256 (after) = 7481 / 256 = 29
-Step #19
- lchan.rqd_ta (before) = 19
- toa256 (before) = 7481 / 256 = 29
- lchan.rqd_ta (after) = 20
+ lchan.ta_ctrl.current (after) = 20
toa256 (after) = 7225 / 256 = 28
-Step #20
- lchan.rqd_ta (before) = 20
+Step #10
+ lchan.ta_ctrl.current (before) = 20
toa256 (before) = 7225 / 256 = 28
- lchan.rqd_ta (after) = 21
- toa256 (after) = 6969 / 256 = 27
-Step #21
- lchan.rqd_ta (before) = 21
- toa256 (before) = 6969 / 256 = 27
- lchan.rqd_ta (after) = 22
+ lchan.ta_ctrl.current (after) = 22
toa256 (after) = 6713 / 256 = 26
-Step #22
- lchan.rqd_ta (before) = 22
+Step #11
+ lchan.ta_ctrl.current (before) = 22
toa256 (before) = 6713 / 256 = 26
- lchan.rqd_ta (after) = 23
- toa256 (after) = 6457 / 256 = 25
-Step #23
- lchan.rqd_ta (before) = 23
- toa256 (before) = 6457 / 256 = 25
- lchan.rqd_ta (after) = 24
+ lchan.ta_ctrl.current (after) = 24
toa256 (after) = 6201 / 256 = 24
-Step #24
- lchan.rqd_ta (before) = 24
+Step #12
+ lchan.ta_ctrl.current (before) = 24
toa256 (before) = 6201 / 256 = 24
- lchan.rqd_ta (after) = 25
- toa256 (after) = 5945 / 256 = 23
-Step #25
- lchan.rqd_ta (before) = 25
- toa256 (before) = 5945 / 256 = 23
- lchan.rqd_ta (after) = 26
+ lchan.ta_ctrl.current (after) = 26
toa256 (after) = 5689 / 256 = 22
-Step #26
- lchan.rqd_ta (before) = 26
+Step #13
+ lchan.ta_ctrl.current (before) = 26
toa256 (before) = 5689 / 256 = 22
- lchan.rqd_ta (after) = 27
- toa256 (after) = 5433 / 256 = 21
-Step #27
- lchan.rqd_ta (before) = 27
- toa256 (before) = 5433 / 256 = 21
- lchan.rqd_ta (after) = 28
+ lchan.ta_ctrl.current (after) = 28
toa256 (after) = 5177 / 256 = 20
-Step #28
- lchan.rqd_ta (before) = 28
+Step #14
+ lchan.ta_ctrl.current (before) = 28
toa256 (before) = 5177 / 256 = 20
- lchan.rqd_ta (after) = 29
- toa256 (after) = 4921 / 256 = 19
-Step #29
- lchan.rqd_ta (before) = 29
- toa256 (before) = 4921 / 256 = 19
- lchan.rqd_ta (after) = 30
+ lchan.ta_ctrl.current (after) = 30
toa256 (after) = 4665 / 256 = 18
-Step #30
- lchan.rqd_ta (before) = 30
+Step #15
+ lchan.ta_ctrl.current (before) = 30
toa256 (before) = 4665 / 256 = 18
- lchan.rqd_ta (after) = 31
- toa256 (after) = 4409 / 256 = 17
-Step #31
- lchan.rqd_ta (before) = 31
- toa256 (before) = 4409 / 256 = 17
- lchan.rqd_ta (after) = 32
+ lchan.ta_ctrl.current (after) = 32
toa256 (after) = 4153 / 256 = 16
-Step #32
- lchan.rqd_ta (before) = 32
+Step #16
+ lchan.ta_ctrl.current (before) = 32
toa256 (before) = 4153 / 256 = 16
- lchan.rqd_ta (after) = 33
- toa256 (after) = 3897 / 256 = 15
-Step #33
- lchan.rqd_ta (before) = 33
- toa256 (before) = 3897 / 256 = 15
- lchan.rqd_ta (after) = 34
+ lchan.ta_ctrl.current (after) = 34
toa256 (after) = 3641 / 256 = 14
-Step #34
- lchan.rqd_ta (before) = 34
+Step #17
+ lchan.ta_ctrl.current (before) = 34
toa256 (before) = 3641 / 256 = 14
- lchan.rqd_ta (after) = 35
- toa256 (after) = 3385 / 256 = 13
-Step #35
- lchan.rqd_ta (before) = 35
- toa256 (before) = 3385 / 256 = 13
- lchan.rqd_ta (after) = 36
+ lchan.ta_ctrl.current (after) = 36
toa256 (after) = 3129 / 256 = 12
-Step #36
- lchan.rqd_ta (before) = 36
+Step #18
+ lchan.ta_ctrl.current (before) = 36
toa256 (before) = 3129 / 256 = 12
- lchan.rqd_ta (after) = 37
- toa256 (after) = 2873 / 256 = 11
-Step #37
- lchan.rqd_ta (before) = 37
- toa256 (before) = 2873 / 256 = 11
- lchan.rqd_ta (after) = 38
+ lchan.ta_ctrl.current (after) = 38
toa256 (after) = 2617 / 256 = 10
-Step #38
- lchan.rqd_ta (before) = 38
+Step #19
+ lchan.ta_ctrl.current (before) = 38
toa256 (before) = 2617 / 256 = 10
- lchan.rqd_ta (after) = 39
- toa256 (after) = 2361 / 256 = 9
-Step #39
- lchan.rqd_ta (before) = 39
- toa256 (before) = 2361 / 256 = 9
- lchan.rqd_ta (after) = 40
+ lchan.ta_ctrl.current (after) = 40
toa256 (after) = 2105 / 256 = 8
-Step #40
- lchan.rqd_ta (before) = 40
+Step #20
+ lchan.ta_ctrl.current (before) = 40
toa256 (before) = 2105 / 256 = 8
- lchan.rqd_ta (after) = 41
- toa256 (after) = 1849 / 256 = 7
-Step #41
- lchan.rqd_ta (before) = 41
- toa256 (before) = 1849 / 256 = 7
- lchan.rqd_ta (after) = 42
+ lchan.ta_ctrl.current (after) = 42
toa256 (after) = 1593 / 256 = 6
-Step #42
- lchan.rqd_ta (before) = 42
+Step #21
+ lchan.ta_ctrl.current (before) = 42
toa256 (before) = 1593 / 256 = 6
- lchan.rqd_ta (after) = 43
- toa256 (after) = 1337 / 256 = 5
-Step #43
- lchan.rqd_ta (before) = 43
- toa256 (before) = 1337 / 256 = 5
- lchan.rqd_ta (after) = 44
+ lchan.ta_ctrl.current (after) = 44
toa256 (after) = 1081 / 256 = 4
-Step #44
- lchan.rqd_ta (before) = 44
+Step #22
+ lchan.ta_ctrl.current (before) = 44
toa256 (before) = 1081 / 256 = 4
- lchan.rqd_ta (after) = 45
- toa256 (after) = 825 / 256 = 3
-Step #45
- lchan.rqd_ta (before) = 45
- toa256 (before) = 825 / 256 = 3
- lchan.rqd_ta (after) = 46
+ lchan.ta_ctrl.current (after) = 46
toa256 (after) = 569 / 256 = 2
-Step #46
- lchan.rqd_ta (before) = 46
+Step #23
+ lchan.ta_ctrl.current (before) = 46
toa256 (before) = 569 / 256 = 2
- lchan.rqd_ta (after) = 47
- toa256 (after) = 313 / 256 = 1
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #24
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #25
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #26
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #27
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #28
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #29
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #30
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #31
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #32
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #33
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #34
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #35
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #36
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #37
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #38
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #39
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #40
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #41
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #42
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #43
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #44
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #45
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
+Step #46
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
+ toa256 (after) = 57 / 256 = 0
Step #47
- lchan.rqd_ta (before) = 47
- toa256 (before) = 313 / 256 = 1
- lchan.rqd_ta (after) = 48
+ lchan.ta_ctrl.current (before) = 48
+ toa256 (before) = 57 / 256 = 0
+ lchan.ta_ctrl.current (after) = 48
toa256 (after) = 57 / 256 = 0
Step #48
- lchan.rqd_ta (before) = 48
+ lchan.ta_ctrl.current (before) = 48
toa256 (before) = 57 / 256 = 0
- lchan.rqd_ta (after) = 48
+ lchan.ta_ctrl.current (after) = 48
toa256 (after) = 57 / 256 = 0
Step #49
- lchan.rqd_ta (before) = 48
+ lchan.ta_ctrl.current (before) = 48
toa256 (before) = 57 / 256 = 0
- lchan.rqd_ta (after) = 48
+ lchan.ta_ctrl.current (after) = 48
toa256 (after) = 57 / 256 = 0
Done.
diff --git a/tests/testsuite.at b/tests/testsuite.at
index ba5a409b..f2d17fbf 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -63,3 +63,9 @@ AT_KEYWORDS([ta_control])
cat $abs_srcdir/ta_control/ta_control_test.ok > expout
AT_CHECK([$abs_top_builddir/tests/ta_control/ta_control_test], [], [expout], [ignore])
AT_CLEANUP
+
+AT_SETUP([amr])
+AT_KEYWORDS([amr])
+cat $abs_srcdir/amr/amr_test.ok > expout
+AT_CHECK([$abs_top_builddir/tests/amr/amr_test], [], [expout], [ignore])
+AT_CLEANUP