From 51845765727ddf994f4ccea38bee9490f2d5a95f Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 14 Feb 2020 16:00:40 +0100 Subject: osmo-bts-sysmo: merge measurement data and payload For osmo-bts-sysmo the MPH INFO MEAS IND indication is still sent separately. Lets merge the measurement information into the PH DATA Change-Id: Iffe7865727fbf9bca8eb32a96e8ea05cf718a948 Related: OS#2977 --- src/common/l1sap.c | 12 +++++++++++- src/osmo-bts-litecell15/tch.c | 4 ++-- src/osmo-bts-oc2g/tch.c | 4 ++-- src/osmo-bts-octphy/l1_tch.c | 4 ++-- src/osmo-bts-sysmo/l1_if.c | 21 --------------------- src/osmo-bts-sysmo/main.c | 1 + src/osmo-bts-sysmo/tch.c | 10 ++++++++-- 7 files changed, 26 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 0b51045f..05dbb6f8 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -176,9 +176,15 @@ struct msgb *l1sap_msgb_alloc(unsigned int l2_len) return msg; } +/* Enclose rmsg into an osmo_phsap primitive and hand it over to the higher + * layers. The phsap primitive also contains measurement information. The + * parameters rssi, ta_offs and is_sub are only needed when the measurement + * information is passed along with the TCH data. When separate measurement + * indications are used, those last three parameters may be set to zero. */ int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn, - uint16_t ber10k, int16_t lqual_cb) + uint16_t ber10k, int16_t lqual_cb, int8_t rssi, + int16_t ta_offs, uint8_t is_sub) { struct osmo_phsap_prim *l1sap; @@ -194,6 +200,10 @@ int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg, l1sap->u.tch.ber10k = ber10k; l1sap->u.tch.lqual_cb = lqual_cb; + l1sap->u.tch.rssi = rssi; + l1sap->u.tch.ta_offs_256bits = ta_offs; + l1sap->u.tch.is_sub = is_sub; + return l1sap_up(trx, l1sap); } diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 5eae7538..526b2ddf 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -373,7 +373,7 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, data_ind->measParam.fBer * 10000, - data_ind->measParam.fLinkQuality * 10); + data_ind->measParam.fLinkQuality * 10, 0, 0, 0); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; @@ -463,7 +463,7 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) if (rmsg) return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, data_ind->measParam.fBer * 10000, - data_ind->measParam.fLinkQuality * 10); + data_ind->measParam.fLinkQuality * 10, 0, 0, 0); return 0; diff --git a/src/osmo-bts-oc2g/tch.c b/src/osmo-bts-oc2g/tch.c index 1bd93e4b..09ee1e7c 100644 --- a/src/osmo-bts-oc2g/tch.c +++ b/src/osmo-bts-oc2g/tch.c @@ -373,7 +373,7 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, data_ind->measParam.fBer * 10000, - data_ind->measParam.fLinkQuality * 10); + data_ind->measParam.fLinkQuality * 10, 0, 0, 0); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; @@ -475,7 +475,7 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) if (rmsg) return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, data_ind->measParam.fBer * 10000, - data_ind->measParam.fLinkQuality * 10); + data_ind->measParam.fLinkQuality * 10, 0, 0, 0); return 0; diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c index df0469dd..bffa1e95 100644 --- a/src/osmo-bts-octphy/l1_tch.c +++ b/src/osmo-bts-octphy/l1_tch.c @@ -151,7 +151,7 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->Data.ulFrameNumber, - ber10k, lqual_cb); + ber10k, lqual_cb, 0, 0, 0); } payload_len = data_ind->Data.ulDataLength; @@ -210,7 +210,7 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, if (rmsg) return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->Data.ulFrameNumber, - ber10k, lqual_cb); + ber10k, lqual_cb, 0, 0, 0); return 0; diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index a891f48f..2e5e5b67 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -940,25 +940,6 @@ empty_frame: #define LOG_FMT_MEAS "Meas: RSSI %-3.2f dBm, Qual %-3.2f dB, BER %-3.2f, Timing %d" #define LOG_PARAM_MEAS(meas_param) (meas_param)->fRssi, (meas_param)->fLinkQuality, (meas_param)->fBer, (meas_param)->i16BurstTiming -static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr, - uint32_t fn, GsmL1_MeasParam_t *m) -{ - struct osmo_phsap_prim l1sap; - memset(&l1sap, 0, sizeof(l1sap)); - osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, - PRIM_OP_INDICATION, NULL); - l1sap.u.info.type = PRIM_INFO_MEAS; - l1sap.u.info.u.meas_ind.chan_nr = chan_nr; - l1sap.u.info.u.meas_ind.ta_offs_256bits = m->i16BurstTiming * 64; - l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 10000); - l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1); - l1sap.u.info.u.meas_ind.fn = fn; - - /* l1sap wants to take msgb ownership. However, as there is no - * msg, it will msgb_free(l1sap.oph.msg == NULL) */ - return l1sap_up(trx, &l1sap); -} - static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_ind, struct msgb *l1p_msg) { @@ -983,8 +964,6 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i fn = data_ind->u32Fn; link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; - process_meas_res(trx, chan_nr, fn, &data_ind->measParam); - gsm_fn2gsmtime(&g_time, fn); DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind %s (hL2 %08x): %s, " LOG_FMT_MEAS "\n", diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index bb2c4363..44c6d5d4 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -87,6 +87,7 @@ int bts_model_init(struct gsm_bts *bts) gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_AMR); gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_AMR); gsm_bts_set_feature(bts, BTS_FEAT_MS_PWR_CTRL_DSP); + gsm_bts_set_feature(bts, BTS_FEAT_MEAS_PAYLOAD_COMB); bts_model_vty_init(bts); diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 54e73136..eb719f1d 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -518,7 +518,10 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) rmsg = msgb_alloc_headroom(256, 128, "L1P-to-RTP"); return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, data_ind->measParam.fBer * 10000, - data_ind->measParam.fLinkQuality * 10); + data_ind->measParam.fLinkQuality * 10, + data_ind->measParam.fRssi, + data_ind->measParam.i16BurstTiming * 64, + 0); } payload_type = data_ind->msgUnitParam.u8Buffer[0]; @@ -613,7 +616,10 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr, struct msgb *l1p_msg) if (rmsg) return add_l1sap_header(trx, rmsg, lchan, chan_nr, data_ind->u32Fn, data_ind->measParam.fBer * 10000, - data_ind->measParam.fLinkQuality * 10); + data_ind->measParam.fLinkQuality * 10, + data_ind->measParam.fRssi, + data_ind->measParam.i16BurstTiming * 64, + 0); return 0; -- cgit v1.2.3