aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-octphy')
-rw-r--r--src/osmo-bts-octphy/l1_if.c2
-rw-r--r--src/osmo-bts-octphy/l1_tch.c18
2 files changed, 14 insertions, 6 deletions
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 427acdff..5785b9a0 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -1050,8 +1050,6 @@ static int handle_ph_data_ind(struct octphy_hdl *fl1,
process_meas_res(trx, chan_nr, fn, data_ind->Data.ulDataLength,
&data_ind->MeasurementInfo);
- /* FIXME: check min_qual_norm! */
-
DEBUGP(DL1C, "Rx PH-DATA.ind %s: %s data_len:%d \n",
get_value_string(octphy_l1sapi_names, sapi),
osmo_hexdump(data_ind->Data.abyDataContent,
diff --git a/src/osmo-bts-octphy/l1_tch.c b/src/osmo-bts-octphy/l1_tch.c
index 79bf245b..38fb9fb6 100644
--- a/src/osmo-bts-octphy/l1_tch.c
+++ b/src/osmo-bts-octphy/l1_tch.c
@@ -188,16 +188,25 @@ int l1if_tch_rx(struct gsm_bts_trx *trx, uint8_t chan_nr,
uint32_t payload_type = data_ind->Data.ulPayloadType;
uint8_t *payload = data_ind->Data.abyDataContent;
+ uint16_t b_total = data_ind->MeasurementInfo.usBERTotalBitCnt;
+ uint16_t b_error = data_ind->MeasurementInfo.usBERCnt;
+ uint16_t ber10k = b_total ? BER_10K * b_error / b_total : 0;
+ int16_t lqual_cb = 0; /* FIXME: check min_qual_norm! */
+
uint8_t payload_len;
struct msgb *rmsg = NULL;
struct gsm_lchan *lchan =
&trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)];
if (data_ind->Data.ulDataLength < 1) {
- LOGP(DL1C, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n",
- chan_nr);
- return -EINVAL;
+ LOGP(DL1P, LOGL_DEBUG, "chan_nr %d Rx Payload size 0\n", chan_nr);
+ /* Push empty payload to upper layers */
+ 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);
}
+
payload_len = data_ind->Data.ulDataLength;
switch (payload_type) {
@@ -255,7 +264,8 @@ 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);
+ data_ind->Data.ulFrameNumber,
+ ber10k, lqual_cb);
return 0;