aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-05-18 17:22:49 +0200
committerHarald Welte <laforge@gnumonks.org>2016-05-31 11:58:08 +0000
commit201b424b73ebd4da49d2fbad85d66a7068a9a28f (patch)
tree9c88d59d15d75c886e1efd5da95e167b96ac39b2
parent0778cd488a6696772e2fda32ee9ab9889f439d62 (diff)
Use libosmocore function for uplink measurements
Related: OS#1563 Change-Id: Ide47e8e69e0d2d5859c5249b22f4bad22c18aa57 Reviewed-on: https://gerrit.osmocom.org/108 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
-rw-r--r--include/osmo-bts/measurement.h3
-rw-r--r--src/common/measurement.c11
-rw-r--r--src/common/rsl.c13
3 files changed, 9 insertions, 18 deletions
diff --git a/include/osmo-bts/measurement.h b/include/osmo-bts/measurement.h
index 493b6ff..2037ff6 100644
--- a/include/osmo-bts/measurement.h
+++ b/include/osmo-bts/measurement.h
@@ -5,7 +5,4 @@ int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm);
int trx_meas_check_compute(struct gsm_bts_trx *trx, uint32_t fn);
-/* build the 3 byte RSL uplinke measurement IE content */
-int lchan_build_rsl_ul_meas(struct gsm_lchan *, uint8_t *buf);
-
#endif
diff --git a/src/common/measurement.c b/src/common/measurement.c
index 41a0170..b0906d4 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -200,17 +200,6 @@ static int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
return 1;
}
-/* build the 3 byte RSL uplinke measurement IE content */
-int lchan_build_rsl_ul_meas(struct gsm_lchan *lchan, uint8_t *buf)
-{
- struct gsm_meas_rep_unidir *mru = &lchan->meas.ul_res;
- buf[0] = (mru->full.rx_lev & 0x3f); /* FIXME: DTXu support */
- buf[1] = (mru->sub.rx_lev & 0x3f);
- buf[2] = ((mru->full.rx_qual & 7) << 3) | (mru->sub.rx_qual & 7);
-
- return 3;
-}
-
/* Copied from OpenBSC and enlarged to _GSM_PCHAN_MAX */
static const uint8_t subslots_per_pchan[_GSM_PCHAN_MAX] = {
[GSM_PCHAN_NONE] = 0,
diff --git a/src/common/rsl.c b/src/common/rsl.c
index ecf570c..e13d48c 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <errno.h>
#include <netdb.h>
+#include <stdbool.h>
#include <sys/types.h>
#include <arpa/inet.h>
@@ -31,6 +32,7 @@
#include <osmocom/gsm/rsl.h>
#include <osmocom/gsm/lapdm.h>
#include <osmocom/gsm/protocol/gsm_12_21.h>
+#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/gsm/protocol/ipaccess.h>
#include <osmocom/trau/osmo_ortp.h>
@@ -1692,7 +1694,8 @@ static int rslms_is_meas_rep(struct msgb *msg)
}
/* 8.4.8 MEASUREMENT RESult */
-static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len)
+static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len,
+ bool dtxd_used)
{
struct msgb *msg;
uint8_t meas_res[16];
@@ -1710,7 +1713,8 @@ static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len)
return -ENOMEM;
msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++);
- int ie_len = lchan_build_rsl_ul_meas(lchan, meas_res);
+ size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, dtxd_used,
+ meas_res);
if (ie_len >= 3) {
msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, ie_len, meas_res);
lchan->meas.flags &= ~LC_UL_M_F_RES_VALID;
@@ -1751,8 +1755,9 @@ int lapdm_rll_tx_cb(struct msgb *msg, struct lapdm_entity *le, void *ctx)
LOGP(DRSL, LOGL_INFO, "%s Handing RLL msg %s from LAPDm to MEAS REP\n",
gsm_lchan_name(lchan), rsl_msg_name(rh->msg_type));
-
- rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg));
+ /* FIXME: add dtx downlink support */
+ rc = rsl_tx_meas_res(lchan, msgb_l3(msg), msgb_l3len(msg),
+ false);
msgb_free(msg);
return rc;
} else {